package logic import ( quitl "app.yhyue.com/moapp/jybase/common" "app.yhyue.com/moapp/jybase/encrypt" "context" "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/svc" "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/types" "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter" "github.com/zeromicro/go-zero/core/logx" ) type FindMessageLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewFindMessageLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FindMessageLogic { return &FindMessageLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *FindMessageLogic) FindMessage(req *types.MessageReq) (*types.CommonRes, error) { // todo: add your logic here and delete this line resp, err := l.svcCtx.Message.FindMessage(l.ctx, &messagecenter.MessageReq{ UserType: req.UserType, MsgType: req.MsgType, SendId: quitl.Int64All(encrypt.SE.Decode4Hex(req.SendId)), LastId: quitl.Int64All(encrypt.SE.Decode4Hex(req.LastId)), EntId: req.EntId, PageSize: req.PageSize, EntUserId: req.EntUserId, NewUserId: req.NewUserId, Sort: req.Sort, ChatGroupId: req.ChatGroupId, PositionId: req.PositionId, }) if err != nil { return nil, err } return &types.CommonRes{ Error_msg: resp.ErrorMsg, Error_code: int(resp.ErrorCode), Data: resp.Data, Count: resp.Count, }, nil }