mypublishlistlogic.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerinfo"
  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 MyPublishListLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewMyPublishListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MyPublishListLogic {
  16. return &MyPublishListLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *MyPublishListLogic) MyPublishList(req *types.MyPublishListReq) (resp *types.CommonRes, err error) {
  23. pubList, err0 := l.svcCtx.Consumer.MyPublishList(l.ctx, &consumerinfo.MyPublishListReq{
  24. UserId: req.UserId,
  25. AppId: req.AppId,
  26. Match: req.Match,
  27. MsgType: req.MsgType,
  28. ReviewStatus: common.Int64All(req.ReviewStatus),
  29. PageSize: common.Int64All(req.PageSize),
  30. PageIndex: common.Int64All(req.PageIndex),
  31. EntId: req.EntId,
  32. Classify: req.Classify,
  33. })
  34. if err0 != nil {
  35. return &types.CommonRes{
  36. Err_code: -1,
  37. Err_msg: "错误",
  38. Data: nil,
  39. }, nil
  40. }
  41. return &types.CommonRes{
  42. Err_code: common.IntAll(pubList.ErrCode),
  43. Err_msg: pubList.ErrMsg,
  44. Data: pubList.Results,
  45. }, nil
  46. }