From 64a8f7a3be0a5584fe2164a2474b189c79cfab5c Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 28 十二月 2019 18:15:39 +0800
Subject: [PATCH] 小程序接口初步建立

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v1/InviteGetMoneyController.java |   31 +++++++++++++++----------------
 1 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/InviteGetMoneyController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/InviteGetMoneyController.java
index 5cb24be..235d4ff 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/InviteGetMoneyController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/InviteGetMoneyController.java
@@ -7,11 +7,11 @@
 import java.util.List;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
-import org.yeshi.utils.HttpUtil;
 import org.yeshi.utils.JsonUtil;
 
 import com.yeshi.fanli.dto.money.InviteGetMoney;
@@ -19,7 +19,6 @@
 import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
 import com.yeshi.fanli.entity.bus.user.ThreeSale;
 import com.yeshi.fanli.entity.bus.user.UserInfo;
-import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
 import com.yeshi.fanli.entity.system.BusinessSystem;
 import com.yeshi.fanli.entity.system.SystemClientParams;
 import com.yeshi.fanli.exception.NotExistObjectException;
@@ -127,7 +126,7 @@
 		data.put("activityRules", valueBr);
 		data.put("inviteList", String.format("http://%s/%s/client/share/friends_new.html",
 				Constant.systemCommonConfig.getProjectHost(), Constant.systemCommonConfig.getProjectName()));
-		List<SwiperPicture> pictureList = swiperPictureService.getByBannerCard("invite_top_banner");
+		List<SwiperPicture> pictureList = swiperPictureService.getByBannerCardAndVersion("invite_top_banner",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
 		if (pictureList != null && pictureList.size() > 0) {
 			SwiperPicture picture = pictureList.get(0);
 			com.alibaba.fastjson.JSONObject pictureJson = new com.alibaba.fastjson.JSONObject();
@@ -141,7 +140,7 @@
 
 		boolean hasCode = false;
 		if (uid != null && uid.trim().length() > 0) {
-			String inviteCode = userInfoExtraService.getUserInviteCode(Long.parseLong(uid));
+			String inviteCode = userInfoExtraService.getInviteCodeByUid(Long.parseLong(uid));
 			if (inviteCode != null && inviteCode.trim().length() > 0) {
 				hasCode = true; // 宸叉湁閭�璇风爜
 			}
@@ -171,23 +170,24 @@
 	 * @throws NotExistObjectException
 	 * @throws IOException
 	 */
+	@RequestSerializableByKey(key = "'listInviteFriendImg-'+#uid")
 	@RequestMapping(value = "/listInviteFriendImg", method = RequestMethod.POST)
-	public void listInviteFriendImg(AcceptData acceptData, Long uid, PrintWriter out)
+	public void listInviteFriendImg(AcceptData acceptData, Long uid, PrintWriter out, HttpServletRequest request)
 			throws NotExistObjectException, IOException {
 		JSONObject data = new JSONObject();
 		if (uid != null && !uid.equals("0")) {
-			List<String> imgList = spreadUserImgService.getUserSpreadImg(uid);
+			List<String> imgList = spreadUserImgService.getUserSpreadImg(uid, request);
 			data.put("imgUrlList", JsonUtil.getSimpleGsonWithDate().toJson(imgList));
 		}
 
 		// 閭�璇烽摼鎺�
-		String shortLink = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/"
-				+ Constant.systemCommonConfig.getProjectName() + "/client/threeShareNew?uid=" + uid);
-		data.put("inviteLink", shortLink);
+//		String shortLink = HttpUtil.getShortLink("http://" + Constant.wxGZConfig.getLoginHost() + "/"
+//				+ Constant.systemCommonConfig.getProjectName() + "/client/threeShareNew?uid=" + uid);
+		data.put("inviteLink", "http://a.app.qq.com/o/simple.jsp?pkgname=com.yeshi.ec.rebate");
 
-		UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
-		if (userInfoExtra != null) {
-			data.put("inviteCode", userInfoExtra.getInviteCode());
+		String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
+		if (!StringUtil.isNullOrEmpty(inviteCode)) {
+			data.put("inviteCode", inviteCode);
 		}
 
 		// 閭�璇疯鍒�
@@ -247,7 +247,6 @@
 	@RequestMapping(value = "activationInvite")
 	public void activationInvite(AcceptData acceptData, String callback, Long uid, String inviteCode, PrintWriter out) {
 		try {
-
 			if (uid == null || inviteCode == null) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("浼犻�掑弬鏁颁笉姝g‘"));
 				return;
@@ -311,15 +310,15 @@
 				return;
 			}
 
-			UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
-			if (userInfoExtra == null || userInfoExtra.getInviteCode() == null) {
+			String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
+			if (StringUtil.isNullOrEmpty(inviteCode)) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("閭�璇风爜涓嶅瓨鍦�"));
 				return;
 			}
 			String tip = configService.get("invite_activation_success_tip");
 
 			JSONObject data = new JSONObject();
-			data.put("inviteCode", userInfoExtra.getInviteCode());
+			data.put("inviteCode", inviteCode);
 			data.put("tip", tip);
 
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));

--
Gitblit v1.8.0