delmypublishlogic.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
  4. "context"
  5. "app.yhyue.com/moapp/jybase/common"
  6. "app.yhyue.com/moapp/jyInfo/api/internal/svc"
  7. "app.yhyue.com/moapp/jyInfo/api/internal/types"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type DelMyPublishLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewDelMyPublishLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DelMyPublishLogic {
  16. return &DelMyPublishLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *DelMyPublishLogic) DelMyPublish(req *types.MyPublishCommonReq) (resp *types.CommonRes, err error) {
  23. publishDetial, err0 := l.svcCtx.Consumer.InfoChange(l.ctx, &consumerclient.InfoDetailReq{
  24. UserId: req.UserId,
  25. MsgId: req.MsgId,
  26. AppId: req.AppId,
  27. Type: common.Int64All(req.Type),
  28. MsgType: req.MsgType,
  29. })
  30. if err0 != nil {
  31. return &types.CommonRes{
  32. Err_code: -1,
  33. Err_msg: "错误",
  34. Data: nil,
  35. }, nil
  36. }
  37. return &types.CommonRes{
  38. Err_code: common.IntAll(publishDetial.ErrCode),
  39. Err_msg: publishDetial.ErrMsg,
  40. Data: publishDetial.Results,
  41. }, nil
  42. }