| | |
| | | textTemplate.setUid(uid);
|
| | | shareGoodsTextTemplateMapper.insertSelective(textTemplate);
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods, boolean hasCoupon) {
|
| | | String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
|
| | | Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
|
| | | goods.getAuctionId() + "");
|
| | | String shortLink = HttpUtil.getShortLink(url);
|
| | | if (!hasCoupon) {
|
| | | String token = goods.getCouponLinkTaoToken();
|
| | | if (StringUtil.isNullOrEmpty(token))
|
| | | token = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(), goods.getAuctionUrl());
|
| | | public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods, String token,
|
| | | String shortLink, boolean hasCoupon) {
|
| | |
|
| | | if (!hasCoupon) {
|
| | | return template.replace("{标题}", goods.getTitle()).replace("{商品原价}", goods.getZkPrice().toString())
|
| | | .replace("{月销量}", TaoBaoUtil.getSaleCount(goods.getBiz30day())).replace("{短链}", shortLink)
|
| | | .replace("{淘口令}", "").replace("{店铺类型}", goods.getUserType() == 1 ? "天猫价"
|
| | | : "淘宝价");
|
| | | } else {
|
| | | String token = goods.getCouponLinkTaoToken();
|
| | | if (StringUtil.isNullOrEmpty(token))
|
| | | token = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(), goods.getCouponLink());
|
| | |
|
| | | return template.replace("{标题}", goods.getTitle()).replace("{商品原价}", goods.getZkPrice().toString())
|
| | | .replace("{月销量}", TaoBaoUtil.getSaleCount(goods.getBiz30day())).replace("{领券短链}", shortLink)
|
| | | .replace("{淘口令}", token).replace("{优惠券面额}", goods.getCouponAmount().toString())
|