yujian
2019-07-30 dadacf7c1065876248bec86cf17c06ca4be1b97c
fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoApiUtil.java
@@ -29,6 +29,7 @@
public class PinDuoDuoApiUtil {
   public final static String PID_FANLI = "8590899_72067894";
   public final static String PID_SHARE = "8590899_72067895";
   public final static String PID_COUPON = "8590899_102657575";
   private final static String CLIENT_ID = "9f6ee5ebd3b94c2080c4d51c2427e9fa";
   private final static String CLIENT_SECRET = "95e1f1904385664bf4b87d4b34de12f9f31c505d";
@@ -177,7 +178,7 @@
   public static PDDGoodsResult getTopList(String pid, Integer page, Integer pageSize, Integer sortType) {
      Map<String, String> map = new HashMap<>();
      map.put("type", "pdd.ddk.top.goods.list.query");
      map.put("offset", (page == null? 0: page) +"");
      map.put("offset", (page == null? 0: (page-1) * Constant.PAGE_SIZE) +"");
      map.put("limit", (pageSize == null? Constant.PAGE_SIZE : pageSize) +"");
      
      if (!StringUtil.isNullOrEmpty(pid))
@@ -194,7 +195,8 @@
      
      Gson gson = new GsonBuilder().disableHtmlEscaping().create();
      List<PDDGoodsDetail> goodsList = gson.fromJson(array.toString(), type);
      int totalCount = root.optInt("total");
      //int totalCount = root.optInt("total");
      int totalCount = 400; // 默认设置成400
      return new PDDGoodsResult(totalCount, goodsList);
   }
@@ -217,7 +219,9 @@
      JSONArray array = new JSONArray();
      array.add(goodsId);
      map.put("goods_id_list", array.toString());
      map.put("custom_parameters", customParams);
      if (!StringUtil.isNullOrEmpty(customParams)) {
         map.put("custom_parameters", customParams);
      }
      String result = baseRequest(map);
      JSONObject root = JSONObject.fromObject(result);