subscribeListLogic.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package logic
  2. import (
  3. "context"
  4. "jyBXSubscribe/api/internal/svc"
  5. "jyBXSubscribe/api/internal/types"
  6. "jyBXSubscribe/rpc/type/bxsubscribe"
  7. "net/http"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type SubscribeListLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. r *http.Request
  15. }
  16. func NewSubscribeListLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *SubscribeListLogic {
  17. return &SubscribeListLogic{
  18. Logger: logx.WithContext(ctx),
  19. ctx: ctx,
  20. svcCtx: svcCtx,
  21. r: r,
  22. }
  23. }
  24. func (l *SubscribeListLogic) SubscribeList(req *types.SubscribeReq) (resp *types.CommonResp, err error) {
  25. res, err := l.svcCtx.Suscribe.GetSubList(l.ctx, &bxsubscribe.SubscribeInfosReq{
  26. PageNum: req.PageNum,
  27. PageSize: req.PageSize,
  28. SelectTime: req.SelectTime,
  29. Area: req.Area,
  30. City: req.City,
  31. Industry: req.Industry,
  32. BuyerClass: req.BuyerClass,
  33. KeyWords: req.KeyWords,
  34. Subtype: req.Subtype,
  35. UserType: req.UserType,
  36. Price: req.Price,
  37. FileExists: req.FileExists,
  38. IsRead: req.IsRead,
  39. Source: req.Source,
  40. Staffs: req.Staffs,
  41. UserId: req.UserId,
  42. EntId: req.EntId,
  43. EntUserId: req.EntUserId,
  44. DeptId: req.DeptId,
  45. NewUserId: req.NewUserId,
  46. IsEnt: req.IsEnt,
  47. })
  48. if err != nil {
  49. return &types.CommonResp{
  50. Err_code: res.ErrCode,
  51. Err_msg: res.ErrMsg,
  52. Data: nil,
  53. }, nil
  54. }
  55. return &types.CommonResp{
  56. Err_code: res.ErrCode,
  57. Err_msg: res.ErrMsg,
  58. Data: res.Data,
  59. }, nil
  60. }