From 6e9274c27ffc8fe7f41e2c3c06a239d4c3fb09e5 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期三, 02 八月 2023 14:38:15 +0800
Subject: [PATCH] 增加服务回访单搜索条件

---
 api/v1/serviceFollowup.go |   51 +++++++++++++++++++++++++++------------------------
 1 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/api/v1/serviceFollowup.go b/api/v1/serviceFollowup.go
index 9e97657..8819528 100644
--- a/api/v1/serviceFollowup.go
+++ b/api/v1/serviceFollowup.go
@@ -98,30 +98,6 @@
 	ctx.Ok()
 }
 
-// List
-//
-//	@Tags		ServiceFollowup
-//	@Summary	鏈嶅姟璺熻繘鍒楄〃
-//	@Produce	application/json
-//	@Success	200	{object}	contextx.Response{data=response.ServiceFollowupResponse}
-//	@Router		/api/serviceFollowup/list [get]
-func (s *ServiceFollowupApi) List(c *gin.Context) {
-	ctx, ok := contextx.NewContext(c, nil)
-	if !ok {
-		return
-	}
-
-	list, errCode := serviceFollowupService.GetServiceFollowupList()
-	if errCode != ecode.OK {
-		ctx.Fail(errCode)
-		return
-	}
-
-	ctx.OkWithDetailed(response.ServiceFollowupResponse{
-		List: list,
-	})
-}
-
 // checkServiceFollowupParams
 func checkServiceFollowupParams(serviceFollowup request.ServiceFollowup) (errCode int, serviceFollowupModel model.ServiceFollowup) {
 	//if serviceFollowup.Number == "" {
@@ -150,3 +126,30 @@
 
 	return ecode.OK, serviceFollowupModel
 }
+
+// List
+//
+//	@Tags		ServiceFollowup
+//	@Summary	鍥炶鍗曠鐞嗗垪琛�
+//	@Produce	application/json
+//	@Param		object	body		request.GetServiceFollowupList	true	"鍙傛暟"
+//	@Success	200		{object}	contextx.Response{data=response.ServiceFollowupResponse}
+//	@Router		/api/serviceFollowup/list [post]
+func (con *ServiceFollowupApi) List(c *gin.Context) {
+	var params request.GetServiceFollowupList
+	ctx, ok := contextx.NewContext(c, &params)
+	if !ok {
+		return
+	}
+
+	serviceFollowups, total, errCode := serviceFollowupService.GetServiceFollowupList(params.Page, params.PageSize, params.KeywordType, params.Keyword)
+	if errCode != ecode.OK {
+		ctx.Fail(errCode)
+		return
+	}
+
+	ctx.OkWithDetailed(response.ServiceFollowupResponse{
+		List:  serviceFollowups,
+		Count: int(total),
+	})
+}

--
Gitblit v1.8.0