| | |
| | | "aps_crm/pkg/contextx" |
| | | "aps_crm/pkg/ecode" |
| | | "github.com/gin-gonic/gin" |
| | | "strconv" |
| | | ) |
| | | |
| | | type ContactApi struct{} |
| | |
| | | // @Tags Contact |
| | | // @Summary 删除联系人 |
| | | // @Produce application/json |
| | | // @Param id path int true "查询参数" |
| | | // @Param object body request.DeleteContact true "查询参数" |
| | | // @Success 200 {object} contextx.Response{} |
| | | // @Router /api/contact/delete/{id} [delete] |
| | | // @Router /api/contact/delete [delete] |
| | | func (con *ContactApi) Delete(c *gin.Context) { |
| | | ctx, ok := contextx.NewContext(c, nil) |
| | | var params request.DeleteContact |
| | | ctx, ok := contextx.NewContext(c, ¶ms) |
| | | if !ok { |
| | | return |
| | | } |
| | | |
| | | id, _ := strconv.Atoi(c.Param("id")) |
| | | errCode := contactService.DeleteContact(id) |
| | | errCode := contactService.DeleteContact(params.Ids) |
| | | if errCode != ecode.OK { |
| | | ctx.Fail(errCode) |
| | | return |
| | |
| | | List: contacts, |
| | | Count: int(total), |
| | | }) |
| | | } |
| | | } |