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