From 4038b87864a43e4e9a68b07112a9c97339199440 Mon Sep 17 00:00:00 2001 From: Leufolium Date: Thu, 12 Sep 2024 16:18:48 +0800 Subject: [PATCH] by Robin at 20240912; --- .../proto/contact_customer_service_session_api.go | 8 ++++---- .../proto/contact_customer_service_session_op.go | 8 ++++---- .../proto/not_null_def_api.go | 2 +- .../controller/contact_customer_service_session_api.go | 10 +++++----- .../controller/contact_customer_service_session_op.go | 10 +++++----- app/mix/controller/init.go | 4 ++-- app/mix/service/apiservice.go | 2 +- app/mix/service/service.go | 2 +- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/api/proto/contact_customer_service_session/proto/contact_customer_service_session_api.go b/api/proto/contact_customer_service_session/proto/contact_customer_service_session_api.go index c64b85f2..b6822394 100644 --- a/api/proto/contact_customer_service_session/proto/contact_customer_service_session_api.go +++ b/api/proto/contact_customer_service_session/proto/contact_customer_service_session_api.go @@ -50,16 +50,16 @@ type ApiListResp struct { } // op 统计未读总数 -type ApiCountUnreadByMidReq struct { +type ApiCountUnreadBySessionIdReq struct { base.BaseRequest SessionId *int64 `json:"session_id"` } -type ApiCountUnreadByMidData struct { +type ApiCountUnreadBySessionIdData struct { UnreadCount int64 `json:"unread_count"` } -type ApiCountUnreadByMidResp struct { +type ApiCountUnreadBySessionIdResp struct { base.BaseResponse - Data *ApiCountUnreadByMidData `json:"data"` + Data *ApiCountUnreadBySessionIdData `json:"data"` } diff --git a/api/proto/contact_customer_service_session/proto/contact_customer_service_session_op.go b/api/proto/contact_customer_service_session/proto/contact_customer_service_session_op.go index 6a5c06ab..bcd900ab 100644 --- a/api/proto/contact_customer_service_session/proto/contact_customer_service_session_op.go +++ b/api/proto/contact_customer_service_session/proto/contact_customer_service_session_op.go @@ -98,16 +98,16 @@ type OpListResp struct { } // op 统计未读总数 -type OpCountUnreadByMidReq struct { +type OpCountUnreadBySessionIdReq struct { base.BaseRequest SessionId *int64 `json:"session_id"` } -type OpCountUnreadByMidData struct { +type OpCountUnreadBySessionIdData struct { UnreadCount int64 `json:"unread_count"` } -type OpCountUnreadByMidResp struct { +type OpCountUnreadBySessionIdResp struct { base.BaseResponse - Data *OpCountUnreadByMidData `json:"data"` + Data *OpCountUnreadBySessionIdData `json:"data"` } diff --git a/api/proto/contact_customer_service_session/proto/not_null_def_api.go b/api/proto/contact_customer_service_session/proto/not_null_def_api.go index eec231b8..ecf72257 100644 --- a/api/proto/contact_customer_service_session/proto/not_null_def_api.go +++ b/api/proto/contact_customer_service_session/proto/not_null_def_api.go @@ -22,7 +22,7 @@ func (p *ApiListByMidReq) ProvideNotNullValue() (params []*validator.JsonParam) } // api 统计未读总数 -func (p *ApiCountUnreadByMidReq) ProvideNotNullValue() (params []*validator.JsonParam) { +func (p *ApiCountUnreadBySessionIdReq) ProvideNotNullValue() (params []*validator.JsonParam) { params = make([]*validator.JsonParam, 0) params = append(params, validator.NewInt64PtrParam("请输入对话id!", p.SessionId)) return params diff --git a/app/mix/controller/contact_customer_service_session_api.go b/app/mix/controller/contact_customer_service_session_api.go index 638e4657..4d84343a 100644 --- a/app/mix/controller/contact_customer_service_session_api.go +++ b/app/mix/controller/contact_customer_service_session_api.go @@ -41,16 +41,16 @@ func ApiGetContactCustomerServiceSessionListByMid(ctx *gin.Context) { ReplyOk(ctx, data) } -func ApiGetUnreadContactCustomerServiceCountByMid(ctx *gin.Context) { - req := ctx.MustGet("client_req").(*contact_customer_service_sessionproto.ApiCountUnreadByMidReq) - unreadCount, ec := service.DefaultService.ApiGetUnreadContactCustomerServiceCountByMid(ctx, req) +func ApiGetUnreadContactCustomerServiceCountBySessionId(ctx *gin.Context) { + req := ctx.MustGet("client_req").(*contact_customer_service_sessionproto.ApiCountUnreadBySessionIdReq) + unreadCount, ec := service.DefaultService.ApiGetUnreadContactCustomerServiceCountBySessionId(ctx, req) if ec != errcode.ErrCodeContactCustomerServiceSessionSrvOk { - logger.Error("ApiGetUnreadContactCustomerServiceCountByMid fail, req: %v, ec: %v", util.ToJson(req), ec) + logger.Error("ApiGetUnreadContactCustomerServiceCountBySessionId fail, req: %v, ec: %v", util.ToJson(req), ec) ReplyErrCodeMsg(ctx, ec) return } - data := &contact_customer_service_sessionproto.ApiCountUnreadByMidData{ + data := &contact_customer_service_sessionproto.ApiCountUnreadBySessionIdData{ UnreadCount: unreadCount, } ReplyOk(ctx, data) diff --git a/app/mix/controller/contact_customer_service_session_op.go b/app/mix/controller/contact_customer_service_session_op.go index 0117e820..625ae43b 100644 --- a/app/mix/controller/contact_customer_service_session_op.go +++ b/app/mix/controller/contact_customer_service_session_op.go @@ -71,16 +71,16 @@ func OpGetContactCustomerServiceSessionList(ctx *gin.Context) { ReplyOk(ctx, data) } -func OpGetUnreadContactCustomerServiceCountByMid(ctx *gin.Context) { - req := ctx.MustGet("client_req").(*contact_customer_service_sessionproto.OpCountUnreadByMidReq) - unreadCount, ec := service.DefaultService.OpGetUnreadContactCustomerServiceCountByMid(ctx, req) +func OpGetUnreadContactCustomerServiceCountBySessionId(ctx *gin.Context) { + req := ctx.MustGet("client_req").(*contact_customer_service_sessionproto.OpCountUnreadBySessionIdReq) + unreadCount, ec := service.DefaultService.OpGetUnreadContactCustomerServiceCountBySessionId(ctx, req) if ec != errcode.ErrCodeContactCustomerServiceSessionSrvOk { - logger.Error("OpGetUnreadContactCustomerServiceCountByMid fail, req: %v, ec: %v", util.ToJson(req), ec) + logger.Error("OpGetUnreadContactCustomerServiceCountBySessionId fail, req: %v, ec: %v", util.ToJson(req), ec) ReplyErrCodeMsg(ctx, ec) return } - data := &contact_customer_service_sessionproto.OpCountUnreadByMidData{ + data := &contact_customer_service_sessionproto.OpCountUnreadBySessionIdData{ UnreadCount: unreadCount, } ReplyOk(ctx, data) diff --git a/app/mix/controller/init.go b/app/mix/controller/init.go index be5e8636..2ab88bfe 100644 --- a/app/mix/controller/init.go +++ b/app/mix/controller/init.go @@ -205,7 +205,7 @@ func Init(r *gin.Engine) { apiContactCustomerServiceSessionGroup := r.Group("/api/contact_customer_service_session", PrepareToC()) apiContactCustomerServiceSessionGroup.POST("create", middleware.JSONParamValidator(contact_customer_service_sessionproto.ApiCreateReq{}), middleware.JwtAuthenticator(), ApiCreateContactCustomerServiceSession) apiContactCustomerServiceSessionGroup.POST("list_by_mid", middleware.JSONParamValidator(contact_customer_service_sessionproto.ApiListByMidReq{}), middleware.JwtAuthenticator(), ApiGetContactCustomerServiceSessionListByMid) - apiContactCustomerServiceSessionGroup.POST("get_unread_count_by_mid", middleware.JSONParamValidator(contact_customer_service_sessionproto.ApiCountUnreadByMidReq{}), middleware.JwtAuthenticator(), ApiGetUnreadContactCustomerServiceCountByMid) + apiContactCustomerServiceSessionGroup.POST("get_unread_count_by_session_id", middleware.JSONParamValidator(contact_customer_service_sessionproto.ApiCountUnreadBySessionIdReq{}), middleware.JwtAuthenticator(), ApiGetUnreadContactCustomerServiceCountBySessionId) // 应用配置表 apiAppConfigGroup := r.Group("/api/app_config", PrepareToC()) @@ -498,7 +498,7 @@ func Init(r *gin.Engine) { opContactCustomerServiceSessionGroup.POST("create", middleware.JSONParamValidator(contact_customer_service_sessionproto.OpCreateReq{}), middleware.JwtAuthenticator(), OpCreateContactCustomerServiceSession) opContactCustomerServiceSessionGroup.POST("list_by_mid", middleware.JSONParamValidator(contact_customer_service_sessionproto.OpListByMidReq{}), middleware.JwtAuthenticator(), OpGetContactCustomerServiceSessionListByMid) opContactCustomerServiceSessionGroup.POST("list", middleware.JSONParamValidator(contact_customer_service_sessionproto.OpListReq{}), middleware.JwtAuthenticator(), OpGetContactCustomerServiceSessionList) - opContactCustomerServiceSessionGroup.POST("get_unread_count", middleware.JSONParamValidator(contact_customer_service_sessionproto.OpCountUnreadByMidReq{}), middleware.JwtAuthenticator(), OpGetUnreadContactCustomerServiceCountByMid) + opContactCustomerServiceSessionGroup.POST("get_unread_count", middleware.JSONParamValidator(contact_customer_service_sessionproto.OpCountUnreadBySessionIdReq{}), middleware.JwtAuthenticator(), OpGetUnreadContactCustomerServiceCountBySessionId) // 图片审核任务 opImageAuditTaskGroup := r.Group("/op/image_audit_task", PrepareOp()) diff --git a/app/mix/service/apiservice.go b/app/mix/service/apiservice.go index 822c7d43..186afe27 100644 --- a/app/mix/service/apiservice.go +++ b/app/mix/service/apiservice.go @@ -2171,7 +2171,7 @@ func (s *Service) ApiGetContactCustomerServiceSessionListByMid(ctx *gin.Context, return } -func (s *Service) ApiGetUnreadContactCustomerServiceCountByMid(ctx *gin.Context, req *contact_customer_service_sessionproto.ApiCountUnreadByMidReq) (unreadCount int64, ec errcode.ErrCode) { +func (s *Service) ApiGetUnreadContactCustomerServiceCountBySessionId(ctx *gin.Context, req *contact_customer_service_sessionproto.ApiCountUnreadBySessionIdReq) (unreadCount int64, ec errcode.ErrCode) { ec = errcode.ErrCodeContactCustomerServiceSessionSrvOk key := logic.GetCreateContactCustomerServiceCountIdForRedis(util.DerefInt64(req.SessionId), consts.ContactCustomerService_FromSupportor) diff --git a/app/mix/service/service.go b/app/mix/service/service.go index 3670b337..deaac834 100644 --- a/app/mix/service/service.go +++ b/app/mix/service/service.go @@ -3648,7 +3648,7 @@ func (s *Service) OpGetContactCustomerServiceSessionList(ctx *gin.Context, req * return } -func (s *Service) OpGetUnreadContactCustomerServiceCountByMid(ctx *gin.Context, req *contact_customer_service_sessionproto.OpCountUnreadByMidReq) (unreadCount int64, ec errcode.ErrCode) { +func (s *Service) OpGetUnreadContactCustomerServiceCountBySessionId(ctx *gin.Context, req *contact_customer_service_sessionproto.OpCountUnreadBySessionIdReq) (unreadCount int64, ec errcode.ErrCode) { ec = errcode.ErrCodeContactCustomerServiceSessionSrvOk if req.SessionId != nil {