From 2267c97ab1cbbe94edcc221e960084fc63d52afe Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期三, 26 七月 2023 10:19:49 +0800 Subject: [PATCH] fix fix file name --- api/v1/serviceFollowup.go | 78 +++++++++++++++++++++------------------ 1 files changed, 42 insertions(+), 36 deletions(-) diff --git a/api/v1/serviceFollowup.go b/api/v1/serviceFollowup.go index 0a74b42..76d9629 100644 --- a/api/v1/serviceFollowup.go +++ b/api/v1/serviceFollowup.go @@ -87,6 +87,8 @@ return } + serviceFollowup.Id = params.Id + errCode = serviceFollowupService.UpdateServiceFollowup(&serviceFollowup) if errCode != ecode.OK { ctx.Fail(errCode) @@ -96,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) { @@ -131,20 +110,47 @@ //} serviceFollowupModel = model.ServiceFollowup{ - ClientId: serviceFollowup.ClientId, - Number: serviceFollowup.Number, - ContactId: serviceFollowup.ContactId, - ServiceId: serviceFollowup.ServiceId, - MemberId: serviceFollowup.MemberId, - PlanId: serviceFollowup.PlanId, - Satisfaction: serviceFollowup.Satisfaction, - TimelyRate: serviceFollowup.TimelyRate, - SolveRate: serviceFollowup.SolveRate, - IsVisit: serviceFollowup.IsVisit, - OldMemberId: serviceFollowup.OldMemberId, - Remark: serviceFollowup.Remark, - File: serviceFollowup.File, + ClientId: serviceFollowup.ClientId, + Number: serviceFollowup.Number, + ContactId: serviceFollowup.ContactId, + ServiceId: serviceFollowup.ServiceId, + MemberId: serviceFollowup.MemberId, + PlanId: serviceFollowup.PlanId, + SatisfactionId: serviceFollowup.Satisfaction, + TimelyRateId: serviceFollowup.TimelyRate, + SolveRateId: serviceFollowup.SolveRate, + IsVisitId: serviceFollowup.IsVisit, + OldMemberId: serviceFollowup.OldMemberId, + Remark: serviceFollowup.Remark, + File: serviceFollowup.File, } 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