yujian
2019-01-14 92c681fabac989d1a9f16fa13202d7f5ccac52d9
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java
@@ -224,25 +224,24 @@
      }
      return null;
   }
   public static List<TaoBaoGoodsBrief> getBatchGoodsInfo(List<Long> listId) throws TaoKeApiException,TaobaoGoodsDownException {
   public static List<TaoBaoGoodsBrief> getBatchGoodsInfo(List<Long> listId)
         throws TaoKeApiException, TaobaoGoodsDownException {
      if (listId == null || listId.size() == 0) {
         throw new TaobaoGoodsDownException(1,"淘宝商品ID不能为空");
         throw new TaobaoGoodsDownException(1, "淘宝商品ID不能为空");
      }
      if ( listId.size() > 40) {
         throw new TaobaoGoodsDownException(1,"淘宝商品ID不能超过40个");
      if (listId.size() > 40) {
         throw new TaobaoGoodsDownException(1, "淘宝商品ID不能超过40个");
      }
      StringBuffer ids = new StringBuffer();
      for (Long id: listId) {
      for (Long id : listId) {
         ids.append(id + ",");
      }
      return getBatchGoodsInfos(ids.substring(0, ids.length() -1));
      return getBatchGoodsInfos(ids.substring(0, ids.length() - 1));
   }
   /**
    * 获取商品详情,简版
@@ -1436,6 +1435,29 @@
      return result;
   }
   /**
    * 从淘宝链接中解析商品ID(高级接口)
    * @param link
    * @return
    */
   public static String parseAuctionIdFromLink(String link) {
      Map<String, String> map = new HashMap<>();
      map.put("method", "taobao.tbk.item.click.extract");
      map.put("click_url", link + "");
      JSONObject resultJSON = null;
      try {
         resultJSON = TaoKeBaseUtil.baseRequest(map, true);
      } catch (TaoKeApiException e) {
         e.printStackTrace();
      }
      if (resultJSON == null)
         return null;
      return null;
   }
   private static TaoBaoGoodsBrief parseWuLiaoItemFromMaterialId(JSONObject item) {
      TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief();
      // 设置成320*320的图片尺寸