| | |
| | | package com.yeshi.fanli.util.taobao; |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.yeshi.common.entity.PageEntity; |
| | | import com.yeshi.common.entity.taobao.TaoBaoShopInfo; |
| | | import com.yeshi.common.entity.taobao.TaoKeAppInfo; |
| | |
| | | } |
| | | |
| | | String resultStr = TaoKeBaseUtil.baseRequestForThreeTimes(map, app); |
| | | System.out.println(resultStr); |
| | | JSONObject data = JSONObject.fromObject(resultStr); |
| | | if (data.optJSONObject("tbk_dg_material_optional_response") != null |
| | | && data.optJSONObject("tbk_dg_material_optional_response").optJSONObject("result_list") != null) { |
| | |
| | | * @param token |
| | | * @return |
| | | */ |
| | | public static Long tokenConvertAuctionId(String token) throws TaoBaoTokenParseException { |
| | | public static TokenConvertResult tokenConvert(String token) throws TaoBaoTokenParseException { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.tbk.tpwd.convert"); |
| | | map.put("password_content", token); |
| | |
| | | System.out.println(json.toString()); |
| | | |
| | | try { |
| | | return json.optJSONObject("tbk_tpwd_convert_response").optJSONObject("data").optLong("num_iid"); |
| | | JSONObject data = json.optJSONObject("tbk_tpwd_convert_response").optJSONObject("data"); |
| | | Gson gson = new Gson(); |
| | | |
| | | return gson.fromJson(data.toString(), TokenConvertResult.class); |
| | | } catch (Exception e) { |
| | | |
| | | return null; |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | public static Date getTaoBaoSystemTime() { |
| | | Map<String, String> map = new HashMap<>(); |
| | | public static Date getTaoBaoSystemTime() { Map<String, String> map = new HashMap<>(); |
| | | map.put("method", "taobao.time.get"); |
| | | try { |
| | | JSONObject json = TaoKeBaseUtil.baseRequest(map, false); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | public BigDecimal coupon_start_fee;// 券起始金额 |
| | | } |
| | | |
| | | public static class TokenConvertResult { |
| | | private Long num_iid;// 商品Id |
| | | private String click_url;//商品淘客转链 |
| | | private String seller_id;//店铺卖家ID |
| | | private String origin_url;//入参淘口令对应原始链接 |
| | | private String origin_pid;//入参淘口令推广链接中的pid,如果不属于当前调用的推广者则展示“0” |
| | | |
| | | public Long getNum_iid() { |
| | | return num_iid; |
| | | } |
| | | |
| | | public void setNum_iid(Long num_iid) { |
| | | this.num_iid = num_iid; |
| | | } |
| | | |
| | | public String getClick_url() { |
| | | return click_url; |
| | | } |
| | | |
| | | public void setClick_url(String click_url) { |
| | | this.click_url = click_url; |
| | | } |
| | | |
| | | public String getSeller_id() { |
| | | return seller_id; |
| | | } |
| | | |
| | | public void setSeller_id(String seller_id) { |
| | | this.seller_id = seller_id; |
| | | } |
| | | |
| | | public String getOrigin_url() { |
| | | return origin_url; |
| | | } |
| | | |
| | | public void setOrigin_url(String origin_url) { |
| | | this.origin_url = origin_url; |
| | | } |
| | | |
| | | public String getOrigin_pid() { |
| | | return origin_pid; |
| | | } |
| | | |
| | | public void setOrigin_pid(String origin_pid) { |
| | | this.origin_pid = origin_pid; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |