package logic import ( "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{MessageId: req.MessageId} 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 }