checkSearchScreenLogic.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jybase/common"
  4. "context"
  5. "jyBXBase/rpc/type/bxbase"
  6. "net/http"
  7. "jyBXBase/api/internal/svc"
  8. "jyBXBase/api/internal/types"
  9. "github.com/zeromicro/go-zero/core/logx"
  10. )
  11. type CheckSearchScreenLogic struct {
  12. logx.Logger
  13. ctx context.Context
  14. svcCtx *svc.ServiceContext
  15. r *http.Request
  16. }
  17. func NewCheckSearchScreenLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *CheckSearchScreenLogic {
  18. return &CheckSearchScreenLogic{
  19. Logger: logx.WithContext(ctx),
  20. ctx: ctx,
  21. svcCtx: svcCtx,
  22. r: r,
  23. }
  24. }
  25. func (l *CheckSearchScreenLogic) CheckSearchScreen(req *types.AddSearchScreen) (resp *types.CommonRes, err error) {
  26. res, err0 := l.svcCtx.Bxbase.CheckSearch(l.ctx, &bxbase.AddSearchReq{
  27. UserId: req.UserId,
  28. Type: req.Type,
  29. Keywords: req.Keywords,
  30. PublishTime: req.Publishtime,
  31. Area: req.Area,
  32. City: req.City,
  33. Subtype: req.Subtype,
  34. MinPrice: req.Minprice,
  35. MaxPrice: req.Maxprice,
  36. Industry: req.Industry,
  37. SelectType: req.SelectType,
  38. BuyerClass: req.Buyerclass,
  39. HasBuyerTel: req.Hasbuyertel,
  40. HasWinnerTel: req.Haswinnertel,
  41. FileExists: req.FileExists,
  42. NotKey: req.Notkey,
  43. AppId: req.AppId,
  44. SearchGroup: req.SearchGroup,
  45. SearchMode: req.SearchMode,
  46. WordsMode: req.WordsMode,
  47. AdditionalWords: req.AdditionalWords,
  48. })
  49. if err0 != nil {
  50. return &types.CommonRes{
  51. Err_code: -1,
  52. Err_msg: "错误",
  53. Data: nil,
  54. }, nil
  55. }
  56. return &types.CommonRes{
  57. Err_code: common.IntAll(res.ErrCode),
  58. Err_msg: res.ErrMsg,
  59. Data: res.Data,
  60. }, nil
  61. }