admin
2020-11-28 dc5be7d38446f70e6ff86df311119c32b41fe7f8
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java
@@ -349,7 +349,7 @@
     * @return
     * @throws TaobaoGoodsDownException
     */
    public static TaoBaoGoodsBrief searchGoodsDetail(Long id, String specialId,String relationId) throws TaobaoGoodsDownException {
    public static TaoBaoGoodsBrief searchGoodsDetail(Long id, String specialId, String relationId) throws TaobaoGoodsDownException {
        TaoBaoGoodsBrief goods = getSimpleGoodsInfo(id);
        if (goods == null)
            return null;
@@ -405,7 +405,7 @@
    }
    public static TaoBaoGoodsBrief searchGoodsDetail(Long id) throws TaobaoGoodsDownException {
        return searchGoodsDetail(id, null,null);
        return searchGoodsDetail(id, null, null);
    }
    /**
@@ -459,6 +459,8 @@
        if (newGoods != null) {
            goods.setTkRate(newGoods.getTkRate());
            goods.setAuctionUrl(newGoods.getAuctionUrl());
            goods.setCouponLink(newGoods.getCouponLink());
            if (!StringUtil.isNullOrEmpty(newGoods.getCouponInfo())) {
                List<BigDecimal> couponInfo = TaoBaoCouponUtil.getCouponInfo(newGoods.getCouponInfo());
                if (couponInfo != null && couponInfo.size() > 1) {
@@ -1060,6 +1062,34 @@
        return null;
    }
    public static String getTKToken(String logo, String text, String url, boolean simpleToken) {
        if (simpleToken) {
            return getSimpleTKToken(logo, text, url);
        } else {
            return getTKToken(logo, text, url);
        }
    }
    public static String getSimpleTKToken(String logo, String text, String url) {
        if (text == null)
            return null;
        if (text.length() < 5)
            text = "好货:" + text;
        Map<String, String> map = new HashMap<>();
        map.put("method", "taobao.tbk.tpwd.create");
        map.put("url", url);
        map.put("text", text);
        map.put("logo", logo);
        String resultStr = TaoKeBaseUtil.baseRequestForThreeTimes(map, true);
        JSONObject data = JSONObject.fromObject(resultStr);
        if (data.optJSONObject("tbk_tpwd_create_response").optJSONObject("data") != null)
            return data.optJSONObject("tbk_tpwd_create_response").optJSONObject("data").optString("password_simple");
        return null;
    }
    /**
     * 获取券详细信息
     *