yujian
2020-06-29 ec60e757d358636dcac1589c44a66f3e276fe58c
fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoApiUtil.java
@@ -80,6 +80,7 @@
    * @return
    */
   public static PDDGoodsResult searchGoods(PDDSearchFilter sf) {
      Gson gson = new GsonBuilder().disableHtmlEscaping().create();
      Map<String, String> map = new HashMap<>();
      map.put("type", "pdd.ddk.goods.search");
      if (sf.getOptId() != null)
@@ -102,6 +103,11 @@
         map.put("goods_id_list", "[" + StringUtil.concat(sf.getGoodsIdList(), ",") + "]");
      if (sf.getMerchantType() != null)
         map.put("merchant_type", sf.getMerchantType() + "");
      if (sf.getRangeList() != null && sf.getRangeList().size() > 0) {
         map.put("range_list",gson.toJson(sf.getRangeList()).toString());
      }
      map.put("pid", PID_FANLI);
      String result = baseRequest(map);
      JSONObject json = JSONObject.fromObject(result);
@@ -118,7 +124,6 @@
      Type type = new TypeToken<List<PDDGoodsDetail>>() {
      }.getType();
      Gson gson = new GsonBuilder().disableHtmlEscaping().create();
      List<PDDGoodsDetail> goodsList = gson.fromJson(array.toString(), type);
      int totalCount = root.optInt("total_count");
      return new PDDGoodsResult(totalCount, goodsList);