Browse Source

Merge branch 'crm1.0' into debug

Roc 3 years ago
parent
commit
776bcf62e7
3 changed files with 17 additions and 7 deletions
  1. 10 5
      controllers/contract.go
  2. 2 2
      controllers/seal.go
  3. 5 0
      models/request/contract/contract.go

+ 10 - 5
controllers/contract.go

@@ -256,18 +256,23 @@ func (this *ContractCommon) List() {
 
 // @Title 作废合同
 // @Description 作废合同接口
-// @Param   ContractId   query   int  true       "合同id"
+// @Param	request	body contract.InvalidReq true "type json string"
 // @Success Ret=200 作废成功
-// @router /invalid [get]
+// @router /invalid [post]
 func (this *ContractCommon) Invalid() {
-	contractId, _ := this.GetInt("ContractId")
+	var req contractReq.InvalidReq
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
+	if err != nil {
+		this.FailWithMessage("参数解析异常!", "参数解析失败,Err:"+err.Error())
+		return
+	}
 	//合同id
-	if contractId <= 0 {
+	if req.ContractId <= 0 {
 		this.FailWithMessage("合同id必传!", "合同id必传!")
 		return
 	}
 
-	err := contractService.InvalidContract(contractId, this.AdminWx)
+	err = contractService.InvalidContract(req.ContractId, this.AdminWx)
 	if err != nil {
 		this.FailWithMessage("作废合同失败!", "作废合同失败,Err:"+err.Error())
 		return

+ 2 - 2
controllers/seal.go

@@ -183,9 +183,9 @@ func (this *SealCommon) Detail() {
 
 // @Title 作废合同
 // @Description 作废合同接口
-// @Param   SealId   query   int  true       "用印id"
+// @Param	request	body seal.InvalidReq true "type json string"
 // @Success Ret=200 作废成功
-// @router /invalid [get]
+// @router /invalid [post]
 func (this *SealCommon) Invalid() {
 	var req sealReq.InvalidReq
 	err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)

+ 5 - 0
models/request/contract/contract.go

@@ -17,3 +17,8 @@ type UploadCheckBackFileReq struct {
 	FileUrl    string `description:"签回合同url"`
 	ContractId int    `description:"合同id"`
 }
+
+//作废用印请求
+type InvalidReq struct {
+	ContractId int `description:"合同id"`
+}