by Robin at 20240912;

This commit is contained in:
Leufolium 2024-09-12 16:18:48 +08:00
parent 321988d149
commit 4038b87864
8 changed files with 23 additions and 23 deletions

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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())

View File

@ -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)

View File

@ -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 {