liujiandao
2023-10-17 d4bf53dd19a45ef09a367babcf7a2ac04ae1d08f
api/v1/contract.go
@@ -9,6 +9,7 @@
   "aps_crm/pkg/ecode"
   "aps_crm/utils"
   "github.com/gin-gonic/gin"
   "strconv"
)
type ContractApi struct{}
@@ -67,13 +68,18 @@
//   @Success   200   {object}   contextx.Response{}
//   @Router      /api/contract/delete [delete]
func (s *ContractApi) Delete(c *gin.Context) {
   var params request.DeleteContract
   ctx, ok := contextx.NewContext(c, &params)
   if !ok {
   id := c.Param("id")
   ctx, _ := contextx.NewContext(c, nil)
   if id == "" {
      ctx.Fail(ecode.ParamsErr)
      return
   }
   errCode := contractService.DeleteContract(params.Ids)
   atoi, err := strconv.Atoi(id)
   if err != nil {
      ctx.FailWithMsg(ecode.UnknownErr, "数据转换失败")
      return
   }
   errCode := contractService.DeleteContract(atoi)
   if errCode != ecode.OK {
      ctx.Fail(errCode)
      return