From e0a433e9c31594527a3bf7766c0bfb2cbbceffdb Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期三, 26 七月 2023 10:09:04 +0800 Subject: [PATCH] fix add pageInfo, keyword to all the list --- api/v1/serviceFollowup.go | 50 +++++++++++++++++++++++++++----------------------- 1 files changed, 27 insertions(+), 23 deletions(-) diff --git a/api/v1/serviceFollowup.go b/api/v1/serviceFollowup.go index 9e97657..76d9629 100644 --- a/api/v1/serviceFollowup.go +++ b/api/v1/serviceFollowup.go @@ -98,29 +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) { @@ -150,3 +127,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, ¶ms) + if !ok { + return + } + + serviceFollowups, errCode := serviceFollowupService.GetServiceFollowupList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.ServiceFollowupResponse{ + List: serviceFollowups, + Count: len(serviceFollowups), + }) +} -- Gitblit v1.8.0