From b0c07ddee23e2d54d03636f08af19f0934857cf4 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 25 八月 2023 10:32:56 +0800
Subject: [PATCH] Merge branch 'hotfix'
---
api/v1/contact.go | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/api/v1/contact.go b/api/v1/contact.go
index 136b7ab..7daace8 100644
--- a/api/v1/contact.go
+++ b/api/v1/contact.go
@@ -7,7 +7,6 @@
"aps_crm/pkg/contextx"
"aps_crm/pkg/ecode"
"github.com/gin-gonic/gin"
- "strconv"
)
type ContactApi struct{}
@@ -47,17 +46,17 @@
// @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
@@ -160,7 +159,7 @@
return
}
- contacts, errCode := contactService.GetContactList(params.Page, params.PageSize, params.Keyword)
+ contacts, total, errCode := contactService.GetContactList(params.Page, params.PageSize, params.SearchMap)
if errCode != ecode.OK {
ctx.Fail(errCode)
return
@@ -168,6 +167,6 @@
ctx.OkWithDetailed(response.ContactResponse{
List: contacts,
- Count: len(contacts),
+ Count: int(total),
})
}
--
Gitblit v1.8.0