yujian
2019-07-17 5b76a083d60ea12781e92fa4f0d842d602e53bdc
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;
@@ -95,6 +96,41 @@
   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