| | |
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, fanLiRate, shareRate);
|
| | | CouponInfoVO couponInfo = goodsDetail.getCouponInfo();
|
| | | if (couponInfo != null) {
|
| | | String url = PinDuoDuoApiUtil.convert(id, PinDuoDuoApiUtil.PID_COUPON + "", null);
|
| | | String url = PinDuoDuoApiUtil.getPromotionUrl(id, PinDuoDuoApiUtil.PID_COUPON + "", null);
|
| | | couponInfo.setLink(url);
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | String jumpLink = PinDuoDuoApiUtil.convert(id, PinDuoDuoApiUtil.PID_FANLI + "", uid + "");
|
| | | String jumpLink = PinDuoDuoApiUtil.getPromotionUrl(id, PinDuoDuoApiUtil.PID_FANLI + "", uid + "");
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("native", true);
|
| | | data.put("jumpLink", jumpLink);
|
| | |
| | | // Constant.systemCommonConfig.getShareGoodsPagePathPDD(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
|
| | | // goodsId + "");
|
| | |
|
| | | String jumpLink = PinDuoDuoApiUtil.convert(goodsId, PinDuoDuoApiUtil.PID_SHARE + "", uid + "");
|
| | | String jumpLink = PinDuoDuoApiUtil.getPromotionUrl(goodsId, PinDuoDuoApiUtil.PID_SHARE + "", uid + "");
|
| | |
|
| | | ShareInfoVO shareInfo = new ShareInfoVO();
|
| | | shareInfo.setClickUrl(jumpLink);
|
| | |
| | | // goodsId + "");
|
| | | // String shortLink = HttpUtil.getShortLink(url);
|
| | |
|
| | | String shortLink = PinDuoDuoApiUtil.convert(goodsId, PinDuoDuoApiUtil.PID_SHARE + "", uid + "");
|
| | | String shortLink = PinDuoDuoApiUtil.getPromotionUrl(goodsId, PinDuoDuoApiUtil.PID_SHARE + "", uid + "");
|
| | |
|
| | | // 创建口令
|
| | | String token = PinDuoDuoApiUtil.createGenerate(goodsId);
|
| | |
| | | hasCoupon = false;
|
| | | }
|
| | |
|
| | | String jumpLink = PinDuoDuoApiUtil.convert(id, PinDuoDuoApiUtil.PID_SHARE + "", uid);
|
| | | String jumpLink = PinDuoDuoApiUtil.getPromotionUrl(id, PinDuoDuoApiUtil.PID_SHARE + "", uid);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("imgs", imageList);
|
New file |
| | |
| | | package com.yeshi.fanli.dto.pdd;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | import com.google.gson.annotations.SerializedName;
|
| | |
|
| | | /**
|
| | | * 推广链接
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class PDDPromotionUrl implements Serializable {
|
| | | |
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | // 唤起微信app推广短链接
|
| | | @SerializedName("we_app_web_view_short_url")
|
| | | private String shortUrlWinXin;
|
| | | // 唤起微信app推广链接
|
| | | @SerializedName("we_app_web_view_url")
|
| | | private String urlWinXin;
|
| | | // 唤醒拼多多app的推广短链接
|
| | | @SerializedName("mobile_short_url")
|
| | | private String shortUrlAPP;
|
| | | // 唤醒拼多多app的推广长链接
|
| | | @SerializedName("mobile_url")
|
| | | private String urlAPP;
|
| | | // 推广短链接
|
| | | @SerializedName("short_url")
|
| | | private String shortUrl;
|
| | | // 推广长链接
|
| | | @SerializedName("url")
|
| | | private String url;
|
| | | // 微博推广短链接
|
| | | @SerializedName("weibo_app_web_view_short_url")
|
| | | private String shortUrlWeiBo;
|
| | | // 微博推广链接
|
| | | @SerializedName("weibo_app_web_view_url")
|
| | | private String urlWeiBo;
|
| | |
|
| | | public String getShortUrlWinXin() {
|
| | | return shortUrlWinXin;
|
| | | }
|
| | |
|
| | | public void setShortUrlWinXin(String shortUrlWinXin) {
|
| | | this.shortUrlWinXin = shortUrlWinXin;
|
| | | }
|
| | |
|
| | | public String getUrlWinXin() {
|
| | | return urlWinXin;
|
| | | }
|
| | |
|
| | | public void setUrlWinXin(String urlWinXin) {
|
| | | this.urlWinXin = urlWinXin;
|
| | | }
|
| | |
|
| | | public String getShortUrlAPP() {
|
| | | return shortUrlAPP;
|
| | | }
|
| | |
|
| | | public void setShortUrlAPP(String shortUrlAPP) {
|
| | | this.shortUrlAPP = shortUrlAPP;
|
| | | }
|
| | |
|
| | | public String getUrlAPP() {
|
| | | return urlAPP;
|
| | | }
|
| | |
|
| | | public void setUrlAPP(String urlAPP) {
|
| | | this.urlAPP = urlAPP;
|
| | | }
|
| | |
|
| | | public String getShortUrl() {
|
| | | return shortUrl;
|
| | | }
|
| | |
|
| | | public void setShortUrl(String shortUrl) {
|
| | | this.shortUrl = shortUrl;
|
| | | }
|
| | |
|
| | | public String getUrl() {
|
| | | return url;
|
| | | }
|
| | |
|
| | | public void setUrl(String url) {
|
| | | this.url = url;
|
| | | }
|
| | |
|
| | | public String getShortUrlWeiBo() {
|
| | | return shortUrlWeiBo;
|
| | | }
|
| | |
|
| | | public void setShortUrlWeiBo(String shortUrlWeiBo) {
|
| | | this.shortUrlWeiBo = shortUrlWeiBo;
|
| | | }
|
| | |
|
| | | public String getUrlWeiBo() {
|
| | | return urlWeiBo;
|
| | | }
|
| | |
|
| | | public void setUrlWeiBo(String urlWeiBo) {
|
| | | this.urlWeiBo = urlWeiBo;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
|
| | | import com.yeshi.fanli.dto.pdd.PDDOrderResult;
|
| | | import com.yeshi.fanli.dto.pdd.PDDPromotionUrl;
|
| | | import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
|
| | | import com.yeshi.fanli.entity.pdd.PDDOrder;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | | * @param customParams
|
| | | * @return
|
| | | */
|
| | | public static String convert(Long goodsId, String pid, String customParams) {
|
| | | public static PDDPromotionUrl convert(Long goodsId, String pid, String customParams) {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("type", "pdd.ddk.goods.promotion.url.generate");
|
| | | map.put("p_id", pid);
|
| | |
| | | return null;
|
| | | }
|
| | | JSONArray resultArray = json.optJSONArray("goods_promotion_url_list");
|
| | | if (resultArray != null && resultArray.size() > 0)
|
| | | return resultArray.optJSONObject(0).optString("short_url");
|
| | | if (resultArray != null && resultArray.size() > 0) {
|
| | | Type type = new TypeToken<PDDPromotionUrl>() {}.getType();
|
| | | Gson gson = new GsonBuilder().disableHtmlEscaping().create();
|
| | | return gson.fromJson(resultArray.optJSONObject(0).toString(), type);
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 商品转链
|
| | | * |
| | | * @param goodsId
|
| | | * @param pid
|
| | | * @param customParams
|
| | | * @return
|
| | | */
|
| | | public static String getPromotionUrl(Long goodsId, String pid, String customParams) {
|
| | | PDDPromotionUrl promotion = convert(goodsId, pid, customParams);
|
| | | if (promotion != null) {
|
| | | return promotion.getUrl();
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | public static void createPid() {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("type", "pdd.ddk.goods.pid.generate");
|