| | |
| | | import com.yeshi.fanli.service.inter.user.HistorySearchService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.GsonUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.Utils;
|
| | |
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 粘贴板信息推荐
|
| | | *
|
| | |
| | | out.print(JsonUtil.loadFalseResult("值过长"));
|
| | | return;
|
| | | }
|
| | |
|
| | | SearchFilter sf = new SearchFilter();
|
| | | sf.setKey(text);
|
| | | JSONObject root = new JSONObject();
|
| | |
|
| | | TaoBaoSearchResult result = TaoBaoUtil.search(sf);
|
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null && result.getTaoBaoGoodsBriefs().size() > 0)
|
| | | for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs()) {
|
| | | // 是属于淘宝联盟商品
|
| | | if (goods.getTitle().equalsIgnoreCase(text)) {
|
| | | root.put("type", 2);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("title", goods.getTitle());
|
| | | data.put("title", text);
|
| | | root.put("data", data);
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | // 查询大淘客标题
|
| | | List<DaTaoKeDetail> list = daTaoKeGoodsDetailService.listByDtitle(text);
|
| | | if (list != null && list.size() > 0) {
|
| | | root.put("type", 2);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("title", list.get(0).getdTitle());
|
| | | root.put("data", data);
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | return;
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadFalseResult("暂不支持该类型!"));
|
| | | return;
|
| | | }
|
| | |
|
| | |
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 搜索候选词
|
| | | *
|
| | |
| | | * @param kw
|
| | | * @param page
|
| | | * @param filter
|
| | | * @param order 销量由高到低:1 、 价格从高到低:2 、 价格从低到高:3 、 推广量高到低:4(综合默认)、返利比高到低:5
|
| | | * @param order
|
| | | * 销量由高到低:1 、 价格从高到低:2 、 价格从低到高:3 、 推广量高到低:4(综合默认)、返利比高到低:5
|
| | | * 、返利比低到高:6 、推荐20
|
| | | * @param startprice
|
| | | * @param endprice
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "searchGoods")
|
| | | public void searchGoods(AcceptData acceptData, Integer goodsType, String key, Integer page, String filter, Integer order, |
| | | PrintWriter out) {
|
| | | public void searchGoods(AcceptData acceptData, Integer goodsType, String key, Integer page, String filter,
|
| | | Integer order, PrintWriter out) {
|
| | | if (goodsType == null || goodsType < 1 || goodsType >3) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请传递正确平台参数"));
|
| | | return;
|
| | |
| | | historySearchService.addHistorySearch(searchkey, bid);
|
| | | }
|
| | | });
|
| | | |
| | |
|
| | | if (searchkey.startsWith("http://") || searchkey.startsWith("https://")) {
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 京东
|
| | | *
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(filter)) {
|
| | | JSONObject jsonfilter = JSONObject.fromObject(filter);
|
| | | Boolean coupon = jsonfilter.optBoolean("coupon");
|
| | |
| | | if (zy != null && zy) {
|
| | | filterAPI.setOwner("g"); // 自营
|
| | | }
|
| | | |
| | |
|
| | | String minPrice = jsonfilter.optString("minPrice");
|
| | | if (!StringUtil.isNullOrEmpty(minPrice)) {
|