From a89c3af49d0be3e635ef13b3bd3dd9410e4d6d46 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 03 八月 2023 20:03:12 +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, ¶ms) + 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