package logic import ( "SocialPlatform.messageCenter/entity" "context" "SocialPlatform.messageCenter/rpc/internal/svc" "SocialPlatform.messageCenter/rpc/messagecenter" "github.com/zeromicro/go-zero/core/logx" ) type CountLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } func NewCountLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CountLogic { return &CountLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } // 查询数量 func (l *CountLogic) Count(in *messageCenter.CountReq) (*messageCenter.CountResp, error) { // todo: add your logic here and delete this line m := entity.MessageMailBox{} count, err := m.Count(in.ReceiveId, in.SendId, int(in.MsgType), int(in.ReadType)) if err != nil { return nil, err } return &messageCenter.CountResp{ Count: int64(count), }, nil }