From 46f410ae18f22f5e9a8368f0ea7c721863d18fce Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期三, 02 八月 2023 17:22:35 +0800 Subject: [PATCH] fix --- api/v1/client.go | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/api/v1/client.go b/api/v1/client.go index ad91842..278374b 100644 --- a/api/v1/client.go +++ b/api/v1/client.go @@ -7,7 +7,6 @@ "aps_crm/pkg/contextx" "aps_crm/pkg/ecode" "github.com/gin-gonic/gin" - "strconv" ) type ClientApi struct{} @@ -120,17 +119,17 @@ // @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 @@ -192,7 +191,7 @@ return } - clients, total, errCode := clientService.GetClientList(params.Page, params.PageSize, params.Keyword) + clients, total, errCode := clientService.GetClientList(params.Page, params.PageSize, params.SearchMap) if errCode != ecode.OK { ctx.Fail(errCode) return -- Gitblit v1.8.0