subscribeListLogic.go 1.4 KB

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