byPushHistoryLogic.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. PositionType: req.PositionType,
  46. })
  47. if err != nil {
  48. return &types.CommonResp{
  49. Err_code: res.ErrorCode,
  50. Err_msg: res.ErrorMsg,
  51. Data: nil,
  52. }, nil
  53. }
  54. return &types.CommonResp{
  55. Err_code: res.ErrorCode,
  56. Err_msg: res.ErrorMsg,
  57. Data: res.Data,
  58. }, nil
  59. return
  60. }