package logic import ( quitl "app.yhyue.com/moapp/jybase/common" "app.yhyue.com/moapp/jybase/encrypt" "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter" "context" "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/svc" "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/types" "github.com/zeromicro/go-zero/core/logx" ) type UpdateReadByIdLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewUpdateReadByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateReadByIdLogic { return &UpdateReadByIdLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *UpdateReadByIdLogic) UpdateReadById(req *types.ReadStateReq) (*types.CommonRes, error) { readStateReq := &messagecenter.ReadStateReq{ SendId: quitl.Int64All(encrypt.SE.Decode4Hex(req.SendId)), EntUserId: req.EntUserId, NewUserId: req.NewUserId, PositionId: req.PositionId, SendType: req.SendType, UserType: req.UserType, } resp, err := l.svcCtx.Message.UpdateReadById(l.ctx, readStateReq) if err != nil { return nil, err } return &types.CommonRes{ Error_msg: resp.ErrorMsg, Error_code: int(resp.ErrorCode), }, nil }