subscribeListLogic.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. PositionType: req.PositionType,
  48. AccountId: req.AccountId,
  49. PositionId: req.PositionId,
  50. MgoUserId: req.MgoUserId,
  51. })
  52. if err != nil {
  53. return &types.CommonResp{
  54. Err_code: res.ErrCode,
  55. Err_msg: res.ErrMsg,
  56. Data: nil,
  57. }, nil
  58. }
  59. return &types.CommonResp{
  60. Err_code: res.ErrCode,
  61. Err_msg: res.ErrMsg,
  62. Data: res.Data,
  63. }, nil
  64. }