| | |
| | | import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.factory.MonitorFactory;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.jd.JDUtil;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil;
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | String url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
|
| | | Constant.systemCommonConfig.getShareGoodsPagePathJD(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
|
| | | goodsId + "");
|
| | | // String url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
|
| | | // Constant.systemCommonConfig.getShareGoodsPagePathJD(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
|
| | | // goodsId + "");
|
| | |
|
| | | // 券短连接
|
| | | String shortLink = HttpUtil.getShortLink(url);
|
| | | if (!StringUtil.isNullOrEmpty(shortLink)) {
|
| | | url = shortLink;
|
| | | String couponUrl = null;
|
| | | JDCouponInfo couponInfo = jdGoods.getCouponInfo();
|
| | | if (couponInfo != null) {
|
| | | couponUrl = couponInfo.getLink();
|
| | | }
|
| | | String materialId = "https://item.jd.com/" + goodsId + ".html";
|
| | | String jumpLink = JDApiUtil.convertShortLink(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "", uid+ "");
|
| | | |
| | |
|
| | | ShareInfoVO shareInfo = new ShareInfoVO();
|
| | | shareInfo.setClickUrl(url);
|
| | | shareInfo.setClickUrl(jumpLink);
|
| | | shareInfo.setRule(configService.get("share_rule_link_jd"));
|
| | | shareInfo.setPictUrl(jdGoods.getPicUrl());
|
| | |
|
| | | String shareText = "";
|
| | | boolean hasCoupon = false;
|
| | | |
| | | // 分享模板
|
| | | JDCouponInfo couponInfo = jdGoods.getCouponInfo();
|
| | | ShareGoodsTextTemplate textTemplate = shareGoodsTextTemplateService.getShareGoodsTextTemplate(uid);
|
| | | if (couponInfo == null) { // 无券模板
|
| | | if (textTemplate != null)
|
| | |
| | | if (StringUtil.isNullOrEmpty(shareText))
|
| | | shareText = configService.get("goods_share_text_coupon_jd");
|
| | | }
|
| | | shareText = shareGoodsTextTemplateService.createContentByTemplateJD(shareText, uid, jdGoods, shortLink, hasCoupon);
|
| | | shareText = shareGoodsTextTemplateService.createContentByTemplateJD(shareText, uid, jdGoods, jumpLink, hasCoupon);
|
| | | shareInfo.setShareText(shareText);
|
| | |
|
| | | String descText = shareText.replace(jdGoods.getSkuName(), "").trim();
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | String url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
|
| | | Constant.systemCommonConfig.getShareGoodsPagePathPDD(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
|
| | | goodsId + "");
|
| | | // String url = String.format("http://%s%s?uid=%s&id=%s", configService.getH5Host(),
|
| | | // Constant.systemCommonConfig.getShareGoodsPagePathPDD(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
|
| | | // goodsId + "");
|
| | |
|
| | | String shortLink = HttpUtil.getShortLink(url);
|
| | | if (!StringUtil.isNullOrEmpty(shortLink)) {
|
| | | url = shortLink;
|
| | | }
|
| | | String jumpLink = PinDuoDuoApiUtil.convert(goodsId, PinDuoDuoApiUtil.PID_SHARE + "", uid + "");
|
| | |
|
| | | ShareInfoVO shareInfo = new ShareInfoVO();
|
| | | shareInfo.setClickUrl(url);
|
| | | shareInfo.setClickUrl(jumpLink);
|
| | | shareInfo.setRule(configService.get("share_rule_link_pdd"));
|
| | | shareInfo.setPictUrl(goods.getGoodsImageUrl());
|
| | |
|
| | |
| | | String token = PinDuoDuoApiUtil.createGenerate(goodsId);
|
| | |
|
| | | // 生成分享内容
|
| | | String shareText = shareGoodsTextTemplateService.createContentByTemplatePDD(template, uid, goods, shortLink,
|
| | | String shareText = shareGoodsTextTemplateService.createContentByTemplatePDD(template, uid, goods, jumpLink,
|
| | | hasCoupon, token);
|
| | | shareInfo.setShareText(shareText);
|
| | |
|