| | |
| | | "aps_crm/pkg/contextx" |
| | | "aps_crm/pkg/ecode" |
| | | "github.com/gin-gonic/gin" |
| | | "strconv" |
| | | ) |
| | | |
| | | type ContractApi struct{} |
| | |
| | | // @Tags Contract |
| | | // @Summary 删除合同 |
| | | // @Produce application/json |
| | | // @Param id path int true "查询参数" |
| | | // @Param object body request.DeleteContract true "查询参数" |
| | | // @Success 200 {object} contextx.Response{} |
| | | // @Router /api/contract/delete/{id} [delete] |
| | | // @Router /api/contract/delete [delete] |
| | | func (s *ContractApi) Delete(c *gin.Context) { |
| | | ctx, ok := contextx.NewContext(c, nil) |
| | | var params request.DeleteContract |
| | | ctx, ok := contextx.NewContext(c, ¶ms) |
| | | if !ok { |
| | | return |
| | | } |
| | | |
| | | id, _ := strconv.Atoi(c.Param("id")) |
| | | errCode := contractService.DeleteContract(id) |
| | | errCode := contractService.DeleteContract(params.Ids) |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |