From bd331a582851cffcce54316e677e23760de4f384 Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期一, 24 六月 2019 11:36:49 +0800
Subject: [PATCH] 冲突文件

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java
index 6730a0b..525eec0 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/ShareController.java
@@ -557,14 +557,9 @@
 			out.print(JsonUtil.loadFalseResult(4, "鍟嗗搧宸蹭笅鏋�"));
 			return;
 		}
-
-		String from = null;
-		if (tljId != null) {
-			from = "taolijin";
-		}
 		
 		if (StringUtil.isNullOrEmpty(template))
-			template = getShareTemplate(uid, hasCoupon, from);
+			template = getShareTemplate(uid, hasCoupon, tljId);
 
 		// 鏍¢獙鍒告ā鏉挎槸鍚︽纭�
 		if (hasCoupon) {
@@ -631,7 +626,7 @@
 								: goodsLink.getCouponLink());
 		}
 		String content = shareGoodsTextTemplateService.createContentByTemplate(template, uid, goods, token, shortLink,
-				hasCoupon, from);
+				hasCoupon, tljId);
 		JSONObject data = new JSONObject();
 		data.put("content", content);
 		out.print(JsonUtil.loadTrueResult(data));
@@ -724,9 +719,9 @@
 		out.print(JsonUtil.loadTrueResult(""));
 	}
 
-	private String getShareTemplate(Long uid, boolean hasCoupon, String from) {
+	private String getShareTemplate(Long uid, boolean hasCoupon, Long tljId) {
 		if (hasCoupon) {
-			if (!StringUtil.isNullOrEmpty(from) && "taolijin".equals(from)) {
+			if (tljId != null) {
 				String template = shareGoodsTextTemplateService.getTaoLiJinTemplate(uid);
 				if (StringUtil.isNullOrEmpty(template))
 					template = configTaoLiJinService.getValueByKey("goods_share_text");
@@ -756,13 +751,19 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "getShareTextTemplate", method = RequestMethod.POST)
-	public void getShareTextTemplate(AcceptData acceptData, Long uid, String from, Boolean hasCoupon, PrintWriter out) {
+	public void getShareTextTemplate(AcceptData acceptData, Long uid, Long tljId, Boolean hasCoupon, PrintWriter out) {
 		if (uid == null) {
 			out.print(JsonUtil.loadFalseResult(1, "鐢ㄦ埛鏈櫥褰�"));
 			return;
 		}
+		
+		if (hasCoupon == null) {
+			out.print(JsonUtil.loadFalseResult(1, "鏄惁鏈夊埜瀛楁涓虹┖"));
+			return;
+		}
+		
 		JSONObject data = new JSONObject();
-		data.put("template", getShareTemplate(uid, hasCoupon, from));
+		data.put("template", getShareTemplate(uid, hasCoupon, tljId));
 		out.print(JsonUtil.loadTrueResult(data));
 	}
 
@@ -773,8 +774,8 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "getShareTextTemplateRules", method = RequestMethod.POST)
-	public void getShareTextTemplateRules(AcceptData acceptData, String from, PrintWriter out) {
-		if (!StringUtil.isNullOrEmpty(from) && "taolijin".equals(from)) {
+	public void getShareTextTemplateRules(AcceptData acceptData, Long tljId, PrintWriter out) {
+		if (tljId != null) {
 			out.print(JsonUtil.loadTrueResult( configTaoLiJinService.getValueByKey("share_goods_rules")));
 		} else {
 			out.print(JsonUtil.loadTrueResult(configService.get("share_goods_template_rules")));

--
Gitblit v1.8.0