123456789101112131415161718192021222324252627282930313233343536373839 |
- 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{MessageId: quitl.Int64All(encrypt.SE.Decode4Hex(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
- }
|