yujian
2020-05-09 7e7db2fa55a9a3af46d4fd8ede0dee147f101d64
fanli/src/main/java/com/yeshi/fanli/util/dataoke/DaTaoKeApiUtil.java
@@ -113,8 +113,6 @@
      return result;
   }
   /**
    * 获取大淘客品牌优选 品牌id
    * 
@@ -503,7 +501,7 @@
         for (int cid : cidList)
            cids += cid + ",";
         cids = cids.endsWith(",") ? cids.substring(0, cids.length() - 1) : cids;
         params.put("cids", cids + "");
      }
@@ -691,4 +689,43 @@
      }
      return hotWords;
   }
   /**
    * 高效转链
    * @Title: convertLink
    * @Description:
    * @param auctionId
    * @param pid
    * void 返回类型
    * @throws
    */
   public static String convertLink(Long auctionId, String pid) {
      TaoKeAppInfo app = APP_KEYS[1];
      Map<String, String> params = new TreeMap<>();
      params.put("version", "v1.1.1");
      params.put("goodsId", auctionId + "");
      params.put("pid", pid);
      params.put("appKey", app.getAppKey());
      params.put("sign", getSign(params, app.getAppSecret()));
      String result = null;
      try {
         result = HttpUtil.get("https://openapi.dataoke.com/api/tb-service/get-privilege-link", params,
               new HashMap<>());
      } catch (Exception e) {
         result = HttpUtil.get("https://openapi.dataoke.com/api/tb-service/get-privilege-link", params,
               new HashMap<>());
      }
      System.out.println(result);
      JSONObject json = JSONObject.fromObject(result);
      if (json != null) {
         json = json.getJSONObject("data");
         if (json != null) {
            return json.optString("couponClickUrl");
         }
      }
      return null;
   }
}