yujian
2019-07-17 010efba33ae0e00ff06e5a95004e0f624f073ba7
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
@@ -149,8 +185,8 @@
         return;
      }
      // 拼多多商品 TODO
      if (goodsType.intValue() == Constant.SOURCE_TYPE_PDD) {
         // 拼多多商品 TODO
         searchPDDGoods(kw, page, filter, order, startprice, endprice, out);
         return;
      }
@@ -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;
      }