| | |
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | |
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | /**
|
| | | * 搜索候选词
|
| | | * |
| | | * @param acceptData
|
| | | * @param kw
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "suggestSearch", method = RequestMethod.POST)
|
| | | public void getSugguestSearch(AcceptData acceptData, String kw, Integer goodsType, PrintWriter out) {
|
| | | if (goodsType == null) {
|
| | | out.print(JsonUtil.loadFalseResult("平台类型不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | List<String> list = null;
|
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | list = TaoBaoUtil.getSuguestSearch(kw);
|
| | | } else if (goodsType == Constant.SOURCE_TYPE_JD) {
|
| | |
|
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) {
|
| | |
|
| | | }
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | out.print(JsonUtil.loadFalseResult("暂无建议内容"));
|
| | | return;
|
| | | }
|
| | |
|
| | | JSONArray array = new JSONArray();
|
| | | for (String words : list) {
|
| | | array.add(words);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(array));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 搜索-新版
|
| | | *
|
| | | * @param acceptData
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | // 拼多多商品 TODO
|
| | | if (goodsType.intValue() == Constant.SOURCE_TYPE_PDD) {
|
| | | // 拼多多商品 TODO
|
| | | searchPDDGoods(kw, page, filter, order, startprice, endprice, out);
|
| | | return;
|
| | | }
|
| | |
| | | jdfilter.setSortName(JDSearchFilter.SORTNAME_COMMISSION_SHARE);
|
| | | break;
|
| | | default: // 默认:销量 desc
|
| | | //jdfilter.setSort(JDSearchFilter.SORT_DESC);
|
| | | //jdfilter.setSortName(JDSearchFilter.SORTNAME_ORDER_COUNT_30DAYS);
|
| | | // jdfilter.setSort(JDSearchFilter.SORT_DESC);
|
| | | // jdfilter.setSortName(JDSearchFilter.SORTNAME_ORDER_COUNT_30DAYS);
|
| | | break;
|
| | | }
|
| | |
|