| | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | public static VIPConvertResultDTO convertLinkByUrl(String url, String tag) { |
| | | JSONObject taskParams = new JSONObject(); |
| | | JSONArray urlArray = new JSONArray(); |
| | | urlArray.add(url); |
| | | taskParams.put("urlList", urlArray); |
| | | if (tag != null) { |
| | | taskParams.put("chanTag", tag); |
| | | } |
| | | taskParams.put("requestId", System.currentTimeMillis() + "_" + UUID.randomUUID()); |
| | | String result = baseRequest("com.vip.adp.api.open.service.UnionUrlService", "genByVIPUrl", |
| | | JSONObject.fromObject(taskParams)); |
| | | System.out.println(result); |
| | | JSONObject resultJSON = JSONObject.fromObject(result); |
| | | if (resultJSON.optInt("returnCode") == 0) { |
| | | String re = resultJSON.optJSONObject("result").optJSONArray("urlInfoList").optJSONObject(0).toString(); |
| | | return new Gson().fromJson(re, VIPConvertResultDTO.class); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 根据商品ID获取商品详情 |
| | | * |
| | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | convertLink("6919237495414585303","437032"); |
| | | |
| | | convertLinkByUrl("https://t.vip.com/T7RyKKCJLj9", "437032"); |
| | | } |
| | | |
| | | } |