From 9a7e0a7da01a9f9625ceaca0c61a59c540c6438f Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期五, 18 八月 2023 17:32:10 +0800 Subject: [PATCH] fix --- api/v1/serviceFollowup.go | 68 +++++++++++++++++---------------- 1 files changed, 35 insertions(+), 33 deletions(-) diff --git a/api/v1/serviceFollowup.go b/api/v1/serviceFollowup.go index 2157325..3c2dda4 100644 --- a/api/v1/serviceFollowup.go +++ b/api/v1/serviceFollowup.go @@ -7,7 +7,6 @@ "aps_crm/pkg/contextx" "aps_crm/pkg/ecode" "github.com/gin-gonic/gin" - "strconv" ) type ServiceFollowupApi struct{} @@ -47,17 +46,17 @@ // @Tags ServiceFollowup // @Summary 鍒犻櫎鏈嶅姟璺熻繘 // @Produce application/json -// @Param id path int true "鏌ヨ鍙傛暟" +// @Param object body request.DeleteServiceFollowup true "鏌ヨ鍙傛暟" // @Success 200 {object} contextx.Response{} -// @Router /api/serviceFollowup/delete/{id} [delete] +// @Router /api/serviceFollowup/delete [delete] func (s *ServiceFollowupApi) Delete(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) + var params request.DeleteServiceFollowup + ctx, ok := contextx.NewContext(c, ¶ms) if !ok { return } - id, _ := strconv.Atoi(c.Param("id")) - errCode := serviceFollowupService.DeleteServiceFollowup(id) + errCode := serviceFollowupService.DeleteServiceFollowup(params.Ids) if errCode != ecode.OK { ctx.Fail(errCode) return @@ -98,30 +97,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 == "" { @@ -136,13 +111,13 @@ ClientId: serviceFollowup.ClientId, Number: serviceFollowup.Number, ContactId: serviceFollowup.ContactId, - ServiceId: serviceFollowup.ServiceId, + ServiceOrderId: serviceFollowup.ServiceOrderId, MemberId: serviceFollowup.MemberId, PlanId: serviceFollowup.PlanId, SatisfactionId: serviceFollowup.Satisfaction, TimelyRateId: serviceFollowup.TimelyRate, - SolveRate: serviceFollowup.SolveRate, - IsVisit: serviceFollowup.IsVisit, + SolveRateId: serviceFollowup.SolveRate, + IsVisitId: serviceFollowup.IsVisit, OldMemberId: serviceFollowup.OldMemberId, Remark: serviceFollowup.Remark, File: serviceFollowup.File, @@ -150,3 +125,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, params.ServiceOrderId) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.ServiceFollowupResponse{ + List: serviceFollowups, + Count: int(total), + }) +} -- Gitblit v1.8.0