yujian
2019-07-17 07a2639739705af4e2f8676d18fdcc10739b0474
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
@@ -12,6 +12,7 @@
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;
@@ -93,6 +94,41 @@
   @Resource
   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));
   }
   /**
    * 搜索-新版
@@ -554,8 +590,8 @@
         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;
      }