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