mypublishlistlogic.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 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, &consumerclient.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. })
  33. if err0 != nil {
  34. return &types.CommonRes{
  35. Err_code: -1,
  36. Err_msg: "错误",
  37. Data: nil,
  38. }, nil
  39. }
  40. return &types.CommonRes{
  41. Err_code: common.IntAll(pubList.ErrCode),
  42. Err_msg: pubList.ErrMsg,
  43. Data: pubList.Results,
  44. }, nil
  45. }