From 84e28cb08ba7d5b50bc43aae7628c31a31c185a0 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Thu, 12 Sep 2024 16:29:24 +0800 Subject: [PATCH 1/2] by Robin at 20240912; read all --- app/mix/controller/contact_customer_service_api.go | 12 ++++++++++++ app/mix/controller/init.go | 1 + 2 files changed, 13 insertions(+) diff --git a/app/mix/controller/contact_customer_service_api.go b/app/mix/controller/contact_customer_service_api.go index 3eadc6c6..aac72173 100644 --- a/app/mix/controller/contact_customer_service_api.go +++ b/app/mix/controller/contact_customer_service_api.go @@ -51,3 +51,15 @@ func ApiGetContactCustomerServiceListBySessionId(ctx *gin.Context) { } ReplyOk(ctx, data) } + +func ApiReadAllContactCustomerService(ctx *gin.Context) { + req := ctx.MustGet("client_req").(*contact_customer_serviceproto.ApiReadAllReq) + ec := service.DefaultService.ApiReadAllContactCustomerService(ctx, req) + if ec != errcode.ErrCodeContactCustomerServiceSrvOk { + logger.Error("OpReadAllContactCustomerService fail, req: %v, ec: %v", util.ToJson(req), ec) + ReplyErrorMsg(ctx, "server error") + return + } + + ReplyOk(ctx, nil) +} diff --git a/app/mix/controller/init.go b/app/mix/controller/init.go index 2ab88bfe..93f664ee 100644 --- a/app/mix/controller/init.go +++ b/app/mix/controller/init.go @@ -200,6 +200,7 @@ func Init(r *gin.Engine) { apiContactCustomerServiceGroup := r.Group("/api/contact_customer_service", PrepareToC()) apiContactCustomerServiceGroup.POST("create", middleware.JSONParamValidator(contact_customer_serviceproto.ApiCreateReq{}), middleware.JwtAuthenticator(), ApiCreateContactCustomerService) apiContactCustomerServiceGroup.POST("list_by_session_id", middleware.JSONParamValidator(contact_customer_serviceproto.ApiListBySessionIdReq{}), middleware.JwtAuthenticator(), ApiGetContactCustomerServiceListBySessionId) + apiContactCustomerServiceGroup.POST("read_all", middleware.JSONParamValidator(contact_customer_serviceproto.ApiReadAllReq{}), middleware.JwtAuthenticator(), ApiReadAllContactCustomerService) // 联系客服对话表 apiContactCustomerServiceSessionGroup := r.Group("/api/contact_customer_service_session", PrepareToC()) From 857679c1fcb870c2c7bee90feb5ec81516f66e52 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Thu, 12 Sep 2024 16:32:04 +0800 Subject: [PATCH 2/2] 1 --- app/mix/controller/contact_customer_service_api.go | 12 ++++++++++++ app/mix/controller/init.go | 1 + 2 files changed, 13 insertions(+) diff --git a/app/mix/controller/contact_customer_service_api.go b/app/mix/controller/contact_customer_service_api.go index aac72173..353dc6bc 100644 --- a/app/mix/controller/contact_customer_service_api.go +++ b/app/mix/controller/contact_customer_service_api.go @@ -52,6 +52,18 @@ func ApiGetContactCustomerServiceListBySessionId(ctx *gin.Context) { ReplyOk(ctx, data) } +func ApiUpdateContactCustomerServiceByIds(ctx *gin.Context) { + req := ctx.MustGet("client_req").(*contact_customer_serviceproto.ApiUpdateByIdsReq) + ec := service.DefaultService.ApiUpdateContactCustomerServiceByIds(ctx, req) + if ec != errcode.ErrCodeContactCustomerServiceSrvOk { + logger.Error("ApiUpdateContactCustomerService fail, req: %v, ec: %v", util.ToJson(req), ec) + ReplyErrCodeMsg(ctx, ec) + return + } + + ReplyOk(ctx, nil) +} + func ApiReadAllContactCustomerService(ctx *gin.Context) { req := ctx.MustGet("client_req").(*contact_customer_serviceproto.ApiReadAllReq) ec := service.DefaultService.ApiReadAllContactCustomerService(ctx, req) diff --git a/app/mix/controller/init.go b/app/mix/controller/init.go index 93f664ee..82935d2c 100644 --- a/app/mix/controller/init.go +++ b/app/mix/controller/init.go @@ -200,6 +200,7 @@ func Init(r *gin.Engine) { apiContactCustomerServiceGroup := r.Group("/api/contact_customer_service", PrepareToC()) apiContactCustomerServiceGroup.POST("create", middleware.JSONParamValidator(contact_customer_serviceproto.ApiCreateReq{}), middleware.JwtAuthenticator(), ApiCreateContactCustomerService) apiContactCustomerServiceGroup.POST("list_by_session_id", middleware.JSONParamValidator(contact_customer_serviceproto.ApiListBySessionIdReq{}), middleware.JwtAuthenticator(), ApiGetContactCustomerServiceListBySessionId) + apiContactCustomerServiceGroup.POST("update_by_ids", middleware.JSONParamValidator(contact_customer_serviceproto.ApiUpdateByIdsReq{}), middleware.JwtAuthenticator(), ApiUpdateContactCustomerServiceByIds) apiContactCustomerServiceGroup.POST("read_all", middleware.JSONParamValidator(contact_customer_serviceproto.ApiReadAllReq{}), middleware.JwtAuthenticator(), ApiReadAllContactCustomerService) // 联系客服对话表