From 69bee82b81626b82b7f39f0e459e4f56b1699b51 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 13 三月 2019 12:02:16 +0800 Subject: [PATCH] 正式数据库修改 --- fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java | 37 ++++++++++++++++++++++++++++++++++++- 1 files changed, 36 insertions(+), 1 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java b/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java index ee53c59..904a707 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java @@ -1694,6 +1694,7 @@ taoBaoGoods.setCouponStartFee(commonGoods.getCouponStartPrice()); taoBaoGoods.setCouponTotalCount(commonGoods.getCouponTotalCount()); taoBaoGoods.setPictUrl(commonGoods.getPicture()); + taoBaoGoods.setPictUrlWhite(commonGoods.getPictureWhite()); taoBaoGoods.setSellerId(commonGoods.getSellerId()); taoBaoGoods.setShopTitle(commonGoods.getSellerName()); taoBaoGoods.setTitle(commonGoods.getTitle()); @@ -1715,13 +1716,14 @@ * @param uid-鐢ㄦ埛ID * @return */ - public static String getTaoBaoUnionAuthUrl(String appKey, String callBackUrl, Long uid) { + public static String getTaoBaoUnionAuthUrl(String appKey, String callBackUrl, Long uid, String source) { if (uid == null) return null; long timestamp = System.currentTimeMillis(); JSONObject json = new JSONObject(); json.put("u", uid); json.put("t", timestamp); + json.put("s", source); String url = null; try { url = String.format( @@ -1734,6 +1736,39 @@ return url; } + public static TaoBaoGoodsBrief getSimpleGoodsBrief(Long actionId) { + JSONObject data = new JSONObject(); + data.put("itemNumId", actionId + ""); + + String url = ""; + try { + url = String.format("https://acs.m.taobao.com/h5/mtop.taobao.detail.getdetail/6.0/?data=%s", + URLEncoder.encode(data.toString(), "UTF-8")); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + String result = HttpUtil.get(url); + JSONObject resultOBJ = JSONObject.fromObject(result); + if (resultOBJ.optJSONObject("data") != null) { + data = resultOBJ.optJSONObject("data"); + JSONObject item = data.optJSONObject("item"); + JSONObject seller = data.optJSONObject("seller"); + TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief(); + goods.setAuctionId(item.optLong("itemId")); + goods.setTitle(item.optString("title")); + if (item.optJSONArray("images") != null && item.optJSONArray("images").size() > 0) + { + String picture=item.optJSONArray("images").optString(0); + goods.setPictUrl(picture.startsWith("http")?picture:"https:"+picture); + } + goods.setSellerId(seller.optLong("shopId")); + goods.setShopTitle(seller.optString("shopName")); + return goods; + } + return null; + } + public static void main(String[] args) { String s = channelMap.get("3"); System.out.println(s); -- Gitblit v1.8.0