| | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * @author hxh |
| | | * @description 从链接中解析商品ID |
| | | * @date 17:36 2024/4/26 |
| | | * @param: link |
| | | * @return java.lang.String |
| | | **/ |
| | | public static String parseGoodsIdFromLink(String link){ |
| | | String url = "http://api.tbk.dingdanxia.com/vip/viplink_check?apikey=" + API_KEY; |
| | | url += "&url=" + URLEncoder.encode(link); |
| | | String result = HttpUtil.get(url); |
| | | JSONObject resultJSON = JSONObject.fromObject(result); |
| | | if(resultJSON.optInt("code")==200){ |
| | | return resultJSON.optJSONObject("data").optString("goodsId"); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | //获取accesstoken的信息 |
| | | public static String getAcessTokenInfo(String code, String state) { |
| | |
| | | // convertLinkByUrl("6918302458239328477", "123"); |
| | | // convertLinkByUrl("https://t.vip.com/T7RyKKCJLj9", "437032"); |
| | | |
| | | |
| | | VipShopOrderQueryModel queryModel = new VipShopOrderQueryModel(); |
| | | queryModel.setPage(1); |
| | | queryModel.setPageSize(20); |
| | | queryModel.setOrderTimeEnd(System.currentTimeMillis()); |
| | | queryModel.setOrderTimeStart(System.currentTimeMillis() - 1000 * 60 * 60 * 48L); |
| | | VipShopQueryOrderResultDTO resultDTO = getOrderList(queryModel); |
| | | System.out.println(resultDTO); |
| | | // |
| | | // VipShopOrderQueryModel queryModel = new VipShopOrderQueryModel(); |
| | | // queryModel.setPage(1); |
| | | // queryModel.setPageSize(20); |
| | | // queryModel.setOrderTimeEnd(System.currentTimeMillis()); |
| | | // queryModel.setOrderTimeStart(System.currentTimeMillis() - 1000 * 60 * 60 * 48L); |
| | | // VipShopQueryOrderResultDTO resultDTO = getOrderList(queryModel); |
| | | // System.out.println(resultDTO); |
| | | |
| | | // String result = getAcessTokenInfo("576a51ae7b9b4db1bbfc921cf381ac0c", "1234"); |
| | | // System.out.println(result); |
| | | VipShopOrder order = getOrderDetail("20071472613828"); |
| | | |
| | | |
| | | // System.out.println(order); |
| | | VipShopOrder order = getOrderDetail("24092976176343"); |
| | | // convertLink("6920342191507923649","437032"); |
| | | // System.out.println(parseGoodsIdFromLink("https://t.vip.com/8F39raFxwN7")); |
| | | } |
| | | |
| | | } |