byPushHistoryLogic.go 1.5 KB

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