withdrawmessagelogic.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package logic
  2. import (
  3. util "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/entity"
  4. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/service"
  5. "context"
  6. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/internal/svc"
  7. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type WithdrawMessageLogic struct {
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. logx.Logger
  14. }
  15. func NewWithdrawMessageLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WithdrawMessageLogic {
  16. return &WithdrawMessageLogic{
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. Logger: logx.WithContext(ctx),
  20. }
  21. }
  22. // 用户撤回消息
  23. func (l *WithdrawMessageLogic) WithdrawMessage(in *messagecenter.ReadWithdrawReq) (*messagecenter.CurrencyResp, error) {
  24. // todo: add your logic here and delete this line
  25. m := service.MessaggeService{}
  26. errorCode := m.WithdrawMessage(in)
  27. if !errorCode {
  28. return &messagecenter.CurrencyResp{
  29. ErrorCode: util.ERROR_CODE,
  30. ErrorMsg: "撤回消息失败",
  31. }, nil
  32. }
  33. return &messagecenter.CurrencyResp{ErrorCode: util.SUCCESS_CODE,
  34. ErrorMsg: ""}, nil
  35. }