| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public String getRecommendText(boolean coupon, String title, String sales, String couponAmount, String description) {
|
| | | String template = configService.get(ConfigKeyEnum.quickShareGoodsText.getKey());
|
| | | String recommendText = template.replace("[商品标题]", title);
|
| | | if (!coupon) {
|
| | | recommendText = recommendText.replace("推荐理由:[推荐语]", "");
|
| | | recommendText = recommendText.replace("优惠券:[券面额]元", "");
|
| | | } else {
|
| | | recommendText = recommendText.replace("[券面额]", couponAmount);
|
| | | if (!StringUtil.isNullOrEmpty(description)) {
|
| | | recommendText = recommendText.replace("[推荐语]", description);
|
| | | } else {
|
| | | recommendText = recommendText.replace("推荐理由:[推荐语]", "");
|
| | | }
|
| | | }
|
| | | |
| | | if (StringUtil.isNullOrEmpty(sales)|| sales.equals("0")) {
|
| | | recommendText = recommendText.replace("销量:[销量]", "");
|
| | | } else {
|
| | | recommendText = recommendText.replace("[销量]", sales.replace("万", "w"));
|
| | | }
|
| | | return recommendText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public String getCommentTextByTaoToken(boolean coupon, String taoToken, String zkPrice, String quanPrice) {
|
| | | String quickCommentText = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey());
|
| | | String commentText = quickCommentText.replace("[原价]", zkPrice);
|
| | | commentText = commentText.replace("[淘口令]", TaoBaoUtil.filterTaoToken(taoToken));
|
| | | if (!coupon) {
|
| | | commentText = commentText.replace("领券抢购", "抢购");
|
| | | commentText = commentText.replace("【券后价】[券后价]元", "");
|
| | | } else {
|
| | | commentText = commentText.replace("[券后价]", quanPrice);
|
| | | }
|
| | | return commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
|
| | | }
|
| | | |
| | | @Override
|
| | | public String getCommentTextByLink(boolean coupon, String link, String zkPrice, String quanPrice, ConfigKeyEnum keyEnum) {
|
| | | String quickCommentText = configService.get(keyEnum.getKey());
|
| | | String commentText = quickCommentText.replace("[原价]", zkPrice);
|
| | | commentText = commentText.replace("[链接]", link);
|
| | | if (!coupon) {
|
| | | commentText = commentText.replace("领券抢购", "抢购");
|
| | | commentText = commentText.replace("【券后价】[券后价]元", "");
|
| | | } else {
|
| | | commentText = commentText.replace("[券后价]", quanPrice);
|
| | | }
|
| | | |
| | | return commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
|
| | | }
|
| | | }
|