operatorsearchlogic.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package logic
  2. import (
  3. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXCore/rpc/service"
  4. "context"
  5. "encoding/json"
  6. "github.com/gogf/gf/v2/util/gconv"
  7. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXCore/rpc/internal/svc"
  8. "bp.jydev.jianyu360.cn/BaseService/jyMicroservices/jyBXCore/rpc/type/bxcore"
  9. "github.com/zeromicro/go-zero/core/logx"
  10. )
  11. type OperatorSearchLogic struct {
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. logx.Logger
  15. }
  16. func NewOperatorSearchLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OperatorSearchLogic {
  17. return &OperatorSearchLogic{
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. Logger: logx.WithContext(ctx),
  21. }
  22. }
  23. // 运营商搜索
  24. func (l *OperatorSearchLogic) OperatorSearch(in *bxcore.OperatorSearchReq) (*bxcore.OperatorSearchResp, error) {
  25. // todo: add your logic here and delete this line
  26. operator := service.Operator{
  27. EntId: in.EntId,
  28. Tag: in.Tag,
  29. PageNum: in.PageNum,
  30. PageSize: in.PageSize,
  31. Province: in.Province,
  32. TopType: in.TopType,
  33. PublishTime: in.PublishTime,
  34. SelectType: in.SelectType,
  35. Industry: in.Industry,
  36. Price: in.Price,
  37. Tagname: in.Tagname,
  38. Tagname1: in.Tagname1,
  39. Tagname2: in.Tagname2,
  40. WordsMode: in.WordsMode,
  41. KeyWords: in.KeyWords,
  42. PurchaseTime: in.PurchaseTime,
  43. OpeningTime: in.OpeningTime,
  44. WinnerTag: in.WinnerTag,
  45. PositionId: in.PositionId,
  46. Order: gconv.Int64(in.Order),
  47. UserId: in.UserId,
  48. }
  49. count, data, total := service.SearchList(operator)
  50. result := map[string]interface{}{
  51. "list": data,
  52. "total": total,
  53. "count": count,
  54. }
  55. infoByte, _ := json.Marshal(result)
  56. return &bxcore.OperatorSearchResp{
  57. Data: infoByte,
  58. }, nil
  59. }