From b59fef5c00b15fdfdfa9d4be26e5bf6b41c75458 Mon Sep 17 00:00:00 2001
From: admin <2780501319@qq.com>
Date: 星期日, 23 二月 2020 00:16:52 +0800
Subject: [PATCH] 2.0.7相关服务端功能添加

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java |  141 ++++++++++++++++++++++++++++++-----------------
 1 files changed, 90 insertions(+), 51 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
index c1d14e7..e125c23 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
@@ -516,10 +516,11 @@
 		data.put("words", configService.get(ConfigKeyEnum.articleHotWords.getKey()));
 		out.print(JsonUtil.loadTrueResult(data));
 	}
-	//鍙戝湀娴嬭瘯
-	@RequestMapping(value = "evaluate", method = RequestMethod.POST)
-	public void evaluate(AcceptData acceptData, PrintWriter out) {
-		out.print(configService.get("test"));
+
+	// //鍙戝湀娴嬭瘯
+	public void evaluateTest(AcceptData acceptData, PrintWriter out) {
+		JSONObject data = JSONObject.fromObject(configService.get("test"));
+		out.print(data.toString());
 	}
 
 	/**
@@ -531,6 +532,11 @@
 	 */
 	@RequestMapping(value = "evaluate", method = RequestMethod.POST)
 	public void evaluate(AcceptData acceptData, Integer page, PrintWriter out) {
+		if ("1".equalsIgnoreCase(configService.get("test-open"))) {
+			evaluateTest(acceptData, out);
+			return;
+		}
+
 		long cid = 1;
 		long subId = 1;
 		List<DynamicInfo> listd = dynamicInfoService.queryV2(2, 74, (page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE,
@@ -541,7 +547,10 @@
 
 		List<GoodsEvaluate> list = new ArrayList<>();
 
+		int p = 0;
 		for (DynamicInfo info : listd) {
+			p++;
+
 			GoodsEvaluate goodsEvaluate = new GoodsEvaluate();
 			goodsEvaluate.setId(info.getId());
 			ActivityUser user = info.getUser();
@@ -555,6 +564,7 @@
 
 			List<ImgInfo> imgList = new ArrayList<>();
 			int i = 0;
+
 			for (GoodsPicture goodsPicture : imgs) {
 				ImgInfo imgInfo = new ImgInfo();
 				GoodsDetailVO goodsVO = goodsPicture.getGoodsVO();
@@ -578,22 +588,45 @@
 
 				imgInfo.setLarge(false);
 				imgInfo.setUrl(goodsPicture.getUrl());
-			    imgInfo.setUrlHD(goodsPicture.getUrl());
+				imgInfo.setUrlHD(goodsPicture.getUrl());
 
-//				if (i == 0) {
-//					imgInfo.setUrl(goodsPicture.getUrl());
-//					imgInfo.setType(ImgEnum.video);
-//					imgInfo.setLarge(true);
-//					imgInfo.setVideoUrl(
-//							"http://pgcvideo.cdn.xiaodutv.com/754825344_367171606_2020010816001720200108174342.mp4?Cache-Control=max-age%3D8640000&responseExpires=Fri%2C+17+Apr+2020+18%3A11%3A55+GMT&xcode=0b0f3962eddaf66837d4af61a22c57bae3a5055540c75232&time=1579077845&_=1578992502888");
-//				} else {
-//					imgInfo.setType(ImgEnum.img);
-//					imgInfo.setLarge(true);
-//					imgInfo.setUrl(goodsPicture.getUrl());
-//				}
-//				i++;
+				// if (i == 0) {
+				// imgInfo.setUrl(goodsPicture.getUrl());
+				// imgInfo.setType(ImgEnum.video);
+				// imgInfo.setLarge(true);
+				// imgInfo.setVideoUrl(
+				// "http://pgcvideo.cdn.xiaodutv.com/754825344_367171606_2020010816001720200108174342.mp4?Cache-Control=max-age%3D8640000&responseExpires=Fri%2C+17+Apr+2020+18%3A11%3A55+GMT&xcode=0b0f3962eddaf66837d4af61a22c57bae3a5055540c75232&time=1579077845&_=1578992502888");
+				// } else {
+				// imgInfo.setType(ImgEnum.img);
+				// imgInfo.setLarge(true);
+				// imgInfo.setUrl(goodsPicture.getUrl());
+				// }
+				// i++;
 
 				imgList.add(imgInfo);
+			}
+
+			if (p == 1) {
+				ImgInfo imgInfo = new ImgInfo();
+				imgInfo.setLarge(true);
+				imgInfo.setType(ImgEnum.img);
+				imgInfo.setUrl(
+						"http://ec-1255749512.file.myqcloud.com/img/invite/new/10ea86eb8db94f7cbb5e68864480d5fe.jpg");
+				imgInfo.setH(1334);
+				imgInfo.setW(750);
+				imgList.add(0, imgInfo);
+
+				imgInfo = new ImgInfo();
+				imgInfo.setType(ImgEnum.video);
+				imgInfo.setLarge(true);
+				imgInfo.setUrl(
+						"http://ec-1255749512.file.myqcloud.com/img/invite/new/10ea86eb8db94f7cbb5e68864480d5fe.jpg");
+				imgInfo.setH(315);
+				imgInfo.setW(560);
+				imgInfo.setUrl("https://zzya.beva.cn/img/Fr56bczo_F8NvroeG54jLH5ey0aC.jpg");
+				imgInfo.setVideoUrl("http://img.flqapp.com/resource/video.mp4");
+				imgList.add(0, imgInfo);
+
 			}
 
 			goodsEvaluate.setImgList(imgList);
@@ -603,18 +636,18 @@
 			commentInfo.setContent("馃槅7.9鍏凁焿�1鍙効绔ョ墮鍒�!!瀹夊Ξ璐濇媺鍗¢�氱増鍎跨鐗欌瓡PBT鏉愯川锛屾瘺鍒风粏鑵绘煍猸曞瑙傚崱閫氫汉鐗╅�犲瀷璁捐");
 			commentInfo.setType(CommentInfoEnum.goodsCoupon);
 
-//			ClientTextStyleVO text1 = new ClientTextStyleVO();
-//			text1.setContent("鐚秴");
-//			text1.setColor("#1D9B31");
-//			
-//			ClientTextStyleVO text2 = new ClientTextStyleVO();
-//			text2.setContent("婊�150鍑�15");
-//			text2.setColor("#E5005C");
-//			List<ClientTextStyleVO> tagList = new ArrayList<>();  
-//			tagList.add(text1);
-//			tagList.add(text2);
-//			commentInfo.setTagList(tagList);
-//			commentInfo.setTagDesc("闄ょ敓椴滃強閮ㄥ垎閰掓按闄ょ敓椴滃強闄ょ敓椴滃強");
+			// ClientTextStyleVO text1 = new ClientTextStyleVO();
+			// text1.setContent("鐚秴");
+			// text1.setColor("#1D9B31");
+			//
+			// ClientTextStyleVO text2 = new ClientTextStyleVO();
+			// text2.setContent("婊�150鍑�15");
+			// text2.setColor("#E5005C");
+			// List<ClientTextStyleVO> tagList = new ArrayList<>();
+			// tagList.add(text1);
+			// tagList.add(text2);
+			// commentInfo.setTagList(tagList);
+			// commentInfo.setTagDesc("闄ょ敓椴滃強閮ㄥ垎閰掓按闄ょ敓椴滃強闄ょ敓椴滃強");
 
 			CommentInfo commentInfo2 = new CommentInfo();
 			commentInfo2.setContent("馃槅7.9鍏凁焿�1鍙効绔ョ墮鍒�!!瀹夊Ξ璐濇媺鍗¢�氱増鍎跨鐗欌瓡PBT鏉愯川锛屾瘺鍒风粏鑵绘煍猸曞瑙傚崱閫氫汉鐗╅�犲瀷璁捐");
@@ -642,10 +675,12 @@
 			list.add(goodsEvaluate);
 		}
 
-//		List<GoodsEvaluate> list = goodsEvaluateService.queryValidEvaluateCache((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE);
-//		if (list == null) {
-//			list = new ArrayList<>();
-//		}
+		// List<GoodsEvaluate> list =
+		// goodsEvaluateService.queryValidEvaluateCache((page - 1) *
+		// Constant.PAGE_SIZE, Constant.PAGE_SIZE);
+		// if (list == null) {
+		// list = new ArrayList<>();
+		// }
 
 		GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
 		gsonBuilder.registerTypeAdapter(CommentInfoEnum.class, new JsonSerializer<CommentInfoEnum>() {
@@ -729,17 +764,18 @@
 	}
 
 	@RequestMapping(value = "evaluateShare", method = RequestMethod.POST)
-	public void evaluateShare(AcceptData acceptData, Long uid, String id, Integer type, Long goodsId, Integer goodsType, PrintWriter out) {
+	public void evaluateShare(AcceptData acceptData, Long uid, String id, Integer type, Long goodsId, Integer goodsType,
+			PrintWriter out) {
 		if (uid == null) {
 			out.print(JsonUtil.loadFalseResult("鐢ㄦ埛鏈櫥褰�"));
 			return;
 		}
-		
+
 		if (StringUtil.isNullOrEmpty(id) || type == null) {
 			out.print(JsonUtil.loadFalseResult("浼犻�掑弬鏁颁笉鑳戒负绌�"));
 			return;
 		}
-		
+
 		if (type == 1 && (goodsId == null || goodsType == null)) {
 			out.print(JsonUtil.loadFalseResult("鍟嗗搧鍙傛暟涓嶈兘涓虹┖"));
 			return;
@@ -778,12 +814,12 @@
 			out.print(JsonUtil.loadFalseResult("璇ュ浘鐗囧唴瀹瑰凡涓嶅瓨鍦�"));
 			return;
 		}
-		
+
 		int total = 0;
 		for (GoodsPicture goodsPicture : imgs) {
 			GoodsDetailVO goodsVO = goodsPicture.getGoodsVO();
 			if (goodsVO != null) {
-				total ++;
+				total++;
 			}
 		}
 
@@ -794,9 +830,10 @@
 				list.add(goodsPicture.getUrl());
 				continue;
 			}
-			
+
 			if (type == 1) {
-				if (goodsVO.getGoodsId().longValue() == goodsId.longValue() && goodsVO.getGoodsType() == goodsType.intValue()) {
+				if (goodsVO.getGoodsId().longValue() == goodsId.longValue()
+						&& goodsVO.getGoodsType() == goodsType.intValue()) {
 					String jumpLink = getJumpLink(goodsVO, user);
 					if (!StringUtil.isNullOrEmpty(jumpLink)) {
 						list.add(jumpLink);
@@ -824,7 +861,7 @@
 			out.print(JsonUtil.loadFalseResult("璇ヤ俊鎭凡涓嬫灦"));
 			return;
 		}
-		
+
 		JSONObject data = new JSONObject();
 		data.put("count", shareCount);
 		data.put("list", list);
@@ -843,10 +880,10 @@
 			}
 		} else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_JD) {
 			JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(goodsVO.getGoodsId());
-			if (jdGoods == null ) {
+			if (jdGoods == null) {
 				return null;
 			}
-			
+
 			String couponUrl = null;
 			JDCouponInfo couponInfo = JDUtil.getShowCouponInfo(jdGoods);
 			if (couponInfo != null) {
@@ -856,7 +893,8 @@
 			jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "",
 					user.getId() + "");
 		} else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_PDD) {
-			jumpLink = PinDuoDuoApiUtil.getPromotionUrl(goodsVO.getGoodsId(), PinDuoDuoApiUtil.PID_SHARE + "", user.getId() + "");
+			jumpLink = PinDuoDuoApiUtil.getPromotionUrl(goodsVO.getGoodsId(), PinDuoDuoApiUtil.PID_SHARE + "",
+					user.getId() + "");
 		}
 		FileUploadResult uploadResult = qrCodeService.drawGoodsPoster(jumpLink, user.getPortrait(), goodsVO);
 		if (uploadResult != null) {
@@ -864,13 +902,14 @@
 		}
 		return null;
 	}
-	
-	
+
 	/**
-	 *  璇勮澶嶅埗
+	 * 璇勮澶嶅埗
+	 * 
 	 * @param acceptData
 	 * @param id
-	 * @param cid 璇勮id
+	 * @param cid
+	 *            璇勮id
 	 * @param out
 	 */
 	@RequestMapping(value = "evaluateComment", method = RequestMethod.POST)
@@ -879,7 +918,7 @@
 			out.print(JsonUtil.loadFalseResult("id涓嶈兘涓虹┖"));
 			return;
 		}
-		
+
 		DynamicInfo dynamicInfo = dynamicInfoService.getById(id);
 		if (dynamicInfo == null) {
 			out.print(JsonUtil.loadFalseResult("璇ュ唴瀹瑰凡涓嶅瓨鍦�"));
@@ -896,7 +935,7 @@
 			out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
 			return;
 		}
-		
+
 		UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid);
 		String relationId = null;
 		if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null
@@ -907,7 +946,7 @@
 			out.print(JsonUtil.loadFalseResult(2, "娣樺疂鏈巿鏉冿紝璇峰墠寰�\"鎴戠殑\"缁戝畾娣樺疂璐﹀彿"));
 			return;
 		}
-		
+
 		JSONObject data = new JSONObject();
 		data.put("text", "瀹夊Ξ璐濇媺鍗¢�氱増鍎挎媺鍗¢�氱増鎷夊崱閫氱増鎷夊崱閫氱増鎷夊崱閫氱増鎷夊崱閫氱増鎷夊崱閫氱増鎷夊崱閫氱増");
 		out.print(JsonUtil.loadTrueResult(data));

--
Gitblit v1.8.0