Commit df0a2f14 by 王祖波

增加查看商品文案

parent 3eec5c28
...@@ -10,7 +10,7 @@ package com.gic.haoban.manage.api.enums.content; ...@@ -10,7 +10,7 @@ package com.gic.haoban.manage.api.enums.content;
public enum MaterialInteractRecordEventType { public enum MaterialInteractRecordEventType {
VISIT_MATERIAL(1, "浏览了你%s分享的%s"), VISIT_MATERIAL(1, "浏览了你%s分享的%s"),
VISIT_PRODUCT(2, "浏览了你%s分享的%s,并查看了关联商品"), VISIT_PRODUCT(2, "浏览了你%s分享的%s,并查看了%s商品"),
ORDER(3, "浏览了你%s分享的%s,并购买了商品"), ORDER(3, "浏览了你%s分享的%s,并购买了商品"),
ADD_SHOPPING_CART(4, "浏览你%s分享的%s,并加入了购物车"); ADD_SHOPPING_CART(4, "浏览你%s分享的%s,并加入了购物车");
......
...@@ -9,16 +9,21 @@ package com.gic.haoban.manage.api.enums.content; ...@@ -9,16 +9,21 @@ package com.gic.haoban.manage.api.enums.content;
**/ **/
public enum ShareBizType { public enum ShareBizType {
MATERIAL(1, "素材"), MATERIAL(1, "素材","关联"),
GOODS(2, "商品"), GOODS(2, "商品",""),
MULTIPLE_GOODS(3, "多商品页面"); MULTIPLE_GOODS(3, "多商品页面","页面中的");
ShareBizType(Integer code, String desc) { ShareBizType(Integer code, String desc,String goodsText) {
this.code = code; this.code = code;
this.desc = desc; this.desc = desc;
this.goodsText = goodsText;
} }
private Integer code; private Integer code;
private String desc; private String desc;
/**
* @see MaterialInteractRecordEventType VISIT_PRODUCT 第三个变量
*/
private String goodsText;
public Integer getCode() { public Integer getCode() {
return code; return code;
...@@ -28,6 +33,10 @@ public enum ShareBizType { ...@@ -28,6 +33,10 @@ public enum ShareBizType {
return desc; return desc;
} }
public String getGoodsText() {
return goodsText;
}
public static String getDescWithCode(Integer code) { public static String getDescWithCode(Integer code) {
for (ShareBizType value : values()) { for (ShareBizType value : values()) {
if (value.code.equals(code)) { if (value.code.equals(code)) {
...@@ -36,4 +45,13 @@ public enum ShareBizType { ...@@ -36,4 +45,13 @@ public enum ShareBizType {
} }
return ""; return "";
} }
public static String getGoodsTextWithCode(Integer code) {
for (ShareBizType value : values()) {
if (value.code.equals(code)) {
return value.goodsText;
}
}
return "";
}
} }
...@@ -72,7 +72,7 @@ public class InteractRecordBuilder { ...@@ -72,7 +72,7 @@ public class InteractRecordBuilder {
if (instance != null) { if (instance != null) {
String shareSourceMessage = shareSource != null && StringUtils.isNotBlank(ShareCustomerSourceType.getDesc(shareSource)) ? String shareSourceMessage = shareSource != null && StringUtils.isNotBlank(ShareCustomerSourceType.getDesc(shareSource)) ?
"使用" + ShareCustomerSourceType.getDesc(shareSource) : ""; "使用" + ShareCustomerSourceType.getDesc(shareSource) : "";
String text = String.format(instance.getDesc(), shareSourceMessage,ShareBizType.getDescWithCode(bizType)); String text = String.format(instance.getDesc(), shareSourceMessage, ShareBizType.getDescWithCode(bizType), ShareBizType.getGoodsTextWithCode(bizType));
if (MaterialInteractRecordEventType.VISIT_PRODUCT.getCode().equals(eventType) && ShareBizType.GOODS.getCode().equals(bizType)) { if (MaterialInteractRecordEventType.VISIT_PRODUCT.getCode().equals(eventType) && ShareBizType.GOODS.getCode().equals(bizType)) {
text = "浏览了你分享的商品"; text = "浏览了你分享的商品";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment