withdrawmessagelogic.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package logic
  2. import (
  3. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/svc"
  4. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/types"
  5. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
  6. "context"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type WithdrawMessageLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewWithdrawMessageLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WithdrawMessageLogic {
  15. return &WithdrawMessageLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *WithdrawMessageLogic) WithdrawMessage(req *types.ReadWithdrawReq) (resp *types.CommonRes, err error) {
  22. // todo: add your logic here and delete this line
  23. r, err := l.svcCtx.Message.WithdrawMessage(l.ctx, &messagecenter.ReadWithdrawReq{
  24. MessageId: req.MessageId,
  25. Appid: req.Appid,
  26. UserType: req.UserType,
  27. EntId: req.EntId,
  28. SenderId: req.SenderId,
  29. RecipientId: req.RecipientId,
  30. ChatGroupId: req.ChatGroupId,
  31. ConversationType: req.ConversationType,
  32. })
  33. if err != nil {
  34. return nil, err
  35. }
  36. return &types.CommonRes{
  37. Error_msg: r.ErrorMsg,
  38. Error_code: int(r.ErrorCode),
  39. }, nil
  40. }