yujian
2019-12-19 626d711cb15896055c13fe344eb7fcc824589715
fanli/src/main/java/com/yeshi/fanli/util/pinduoduo/PinDuoDuoApiUtil.java
@@ -124,6 +124,17 @@
      return new PDDGoodsResult(totalCount, goodsList);
   }
   public static List<PDDGoodsDetail> listGoodsDetail(List<Long> goodsIds) {
      PDDSearchFilter filter = new PDDSearchFilter();
      Long[] ids = new Long[goodsIds.size()];
      goodsIds.toArray(ids);
      filter.setGoodsIdList(ids);
      PDDGoodsResult result = searchGoods(filter);
      if (result != null)
         return result.getGoodsList();
      return null;
   }
   /**
    * 运营频道商品查询API
    * 
@@ -435,36 +446,36 @@
      return null;
   }
   /**
    * 获取商品详情
    * 
    * @param goodsId
    */
   public static PDDShopResult getShopList(Integer page,Long catId) {
   public static PDDShopResult getShopList(Integer page, Long catId) {
      JSONArray arrayType = new JSONArray();
      arrayType.add(3);
      Map<String, String> map = new HashMap<>();
      map.put("type", "pdd.ddk.merchant.list.get");
      if (catId != null)
         map.put("cat_id", catId +"");
         map.put("cat_id", catId + "");
      if (page != null)
         map.put("page_number", page +"");
         map.put("page_number", page + "");
      if (page != null)
         map.put("page_number", page +"");
         map.put("page_number", page + "");
      map.put("merchant_type_list", arrayType.toString());
      String result = baseRequest(map);
      JSONObject resultJson = JSONObject.fromObject(result);
      JSONObject root = resultJson.optJSONObject("merchant_list_response");
      if (root != null) {
         int totalCount = root.optInt("total");
         JSONArray array = root.optJSONArray("mall_search_info_vo_list");
         Type type = new TypeToken<List<PDDShopDetail>>() {}.getType();
         Type type = new TypeToken<List<PDDShopDetail>>() {
         }.getType();
         List<PDDShopDetail> listShop = new Gson().fromJson(array.toString(), type);
         return new PDDShopResult(totalCount, listShop);
      }