123456789101112131415161718192021222324252627282930313233343536373839 |
- package logic
- import (
- service "app.yhyue.com/moapp/MessageCenter/rpc/internal/common"
- "app.yhyue.com/moapp/MessageCenter/rpc/messageclient"
- qutil "app.yhyue.com/moapp/jybase/common"
- "context"
- "log"
- "app.yhyue.com/moapp/MessageCenter/rpc/internal/svc"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type GetUnreadCountLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewGetUnreadCountLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUnreadCountLogic {
- return &GetUnreadCountLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- // 查询指定用户未读消息合计
- func (l *GetUnreadCountLogic) GetUnreadCount(in *messageclient.GetUnreadCountRequest) (*messageclient.GetUnreadCountResponse, error) {
- m := &service.MessageService{}
- log.Println("参数:", in.Appid, in.UserId)
- code, msg, count := m.CountUnread(in.UserId, in.Appid)
- return &messageclient.GetUnreadCountResponse{
- Code: code,
- Message: msg,
- Count: qutil.Int64All(count),
- }, nil
- }
|