byPushHistoryLogic.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. UserId: req.UserId,
  36. EntId: req.EntId,
  37. EntUserId: req.EntUserId,
  38. DeptId: req.DeptId,
  39. NewUserId: req.NewUserId,
  40. IsEnt: req.IsEnt,
  41. SelectIds: req.SelectIds,
  42. })
  43. if err != nil {
  44. return &types.CommonResp{
  45. Err_code: res.ErrorCode,
  46. Err_msg: res.ErrorMsg,
  47. Data: nil,
  48. }, nil
  49. }
  50. return &types.CommonResp{
  51. Err_code: res.ErrorCode,
  52. Err_msg: res.ErrorMsg,
  53. Data: res.Data,
  54. }, nil
  55. return
  56. }