package logic import ( "context" "github.com/zeromicro/go-zero/core/logx" "jyBXCore/api/internal/svc" "jyBXCore/api/internal/types" "jyBXCore/api/internal/util" "jyBXCore/rpc/type/bxcore" "log" "net/http" "time" ) type SearchListLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext r *http.Request } func NewSearchListLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *SearchListLogic { return &SearchListLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, r: r, } } func (l *SearchListLogic) SearchList(req *types.SearchReq) (resp *types.CommonResp, err error) { t := time.Now() res, err := l.svcCtx.BxCore.GetSearchList(l.ctx, &bxcore.SearchReq{ AppId: req.AppId, UserId: req.UserId, Phone: req.Phone, NewUserId: req.NewUserId, EntId: req.EntId, EntUserId: req.EntUserId, PageNum: req.PageNum, PageSize: req.PageSize, Province: req.Province, City: req.City, Subtype: req.Subtype, TopType: req.TopType, PublishTime: req.PublishTime, SelectType: req.SelectType, Price: req.Price, Industry: req.Industry, BuyerClass: req.BuyerClass, BuyerTel: req.BuyerTel, WinnerTel: req.WinnerTel, FileExists: req.FileExists, SearchGroup: req.SearchGroup, SearchMode: req.SearchMode, WordsMode: req.WordsMode, KeyWords: req.KeyWords, AdditionalWords: req.AdditionalWords, ExclusionWords: req.ExclusionWords, UserType: req.UserType, Platform: util.CheckPlatform(l.r), BidField: req.BidField, }) log.Println("请求接口耗时:", time.Since(t).Seconds()) if err != nil { return &types.CommonResp{ Err_code: res.ErrCode, Err_msg: res.ErrMsg, Data: nil, }, nil } return &types.CommonResp{ Err_code: res.ErrCode, Err_msg: res.ErrMsg, Data: res.Data, }, nil }