From 51a4ff5d777028d52a19c314a99f796334cb7b51 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 23 十一月 2019 18:30:01 +0800
Subject: [PATCH] 配置文件修改

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java |   56 ++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 48 insertions(+), 8 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java
index 27c7547..56a045e 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/IntegralControllerV2.java
@@ -58,6 +58,7 @@
 import com.yeshi.fanli.util.Constant;
 import com.yeshi.fanli.util.StringUtil;
 import com.yeshi.fanli.util.TimeUtil;
+import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
 import com.yeshi.fanli.vo.integral.DailySignVO;
 import com.yeshi.fanli.vo.integral.ExchangeTipVO;
 import com.yeshi.fanli.vo.integral.IntegralDetailVO;
@@ -312,6 +313,7 @@
 	 *            // 鏈鍙杋d
 	 * @param out
 	 */
+	@RequestSerializableByKey(key = "'receiveGoldCoin-'+#uid")
 	@RequestMapping(value = "receiveGoldCoin", method = RequestMethod.POST)
 	public void receiveGoldCoin(AcceptData acceptData, Long uid, Integer type, String ids, String gids,
 			PrintWriter out) {
@@ -390,6 +392,28 @@
 		out.print(JsonUtil.loadTrueResult(data));
 	}
 
+	@RequestMapping(value = "getExchangeDetail")
+	public void getExchangeDetail(AcceptData acceptData, Long id, String callback, PrintWriter out) {
+		if (id == null || id <= 0) {
+			out.print(JsonUtil.loadFalseResult(1, "鍏戞崲ID鏈夎"));
+			return;
+		}
+		IntegralExchange exchange = integralExchangeService.selectByPrimaryKey(id);
+		if (exchange != null) {
+			GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
+			Gson gson = gsonBuilder.create();
+			if (StringUtil.isNullOrEmpty(callback))
+				out.print(JsonUtil.loadTrueResult(gson.toJson(exchange)));
+			else
+				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(gson.toJson(exchange))));
+		} else {
+			if (StringUtil.isNullOrEmpty(callback))
+				out.print(JsonUtil.loadFalseResult("鏈壘鍒�"));
+			else
+				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("鏈壘鍒�")));
+		}
+	}
+
 	/**
 	 * 鍏戞崲閲戝竵妫�楠�
 	 * 
@@ -398,8 +422,8 @@
 	 * @param id
 	 * @param out
 	 */
-	@RequestMapping(value = "verifyExchange", method = RequestMethod.POST)
-	public void verifyExchange(AcceptData acceptData, Long uid, Long id, PrintWriter out) {
+	@RequestMapping(value = "verifyExchange")
+	public void verifyExchange(AcceptData acceptData, Long uid, Long id, String callback, PrintWriter out) {
 		try {
 			ExchangeTipVO exchange = integralExchangeService.verifyExchange(uid, id);
 
@@ -407,9 +431,17 @@
 			Gson gson = gsonBuilder.create();
 			JSONObject data = new JSONObject();
 			data.put("result", gson.toJson(exchange));
-			out.print(JsonUtil.loadTrueResult(data));
+			if (StringUtil.isNullOrEmpty(callback)) {
+				out.print(JsonUtil.loadTrueResult(data));
+			} else {
+				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
+			}
 		} catch (IntegralExchangeException e) {
-			out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
+			if (StringUtil.isNullOrEmpty(callback)) {
+				out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
+			} else {
+				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(1, e.getMsg())));
+			}
 		}
 	}
 
@@ -421,8 +453,9 @@
 	 * @param id
 	 * @param out
 	 */
-	@RequestMapping(value = "exchange", method = RequestMethod.POST)
-	public void exchange(AcceptData acceptData, Long uid, Long id, PrintWriter out) {
+	@RequestSerializableByKey(key = "'integralexchange-'+#uid")
+	@RequestMapping(value = "exchange")
+	public void exchange(AcceptData acceptData, Long uid, Long id, String callback, PrintWriter out) {
 		try {
 			IntegralExchange exchange = integralExchangeService.exchange(uid, id);
 
@@ -434,9 +467,15 @@
 			JSONObject data = new JSONObject();
 			data.put("result", gson.toJson(exchange));
 			data.put("goldCoin", extraVO.getGoldCoin() + "鏋�");
-			out.print(JsonUtil.loadTrueResult(data));
+			if (StringUtil.isNullOrEmpty(callback))
+				out.print(JsonUtil.loadTrueResult(data));
+			else
+				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
 		} catch (IntegralExchangeException e) {
-			out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
+			if (StringUtil.isNullOrEmpty(callback))
+				out.print(JsonUtil.loadFalseResult(1, e.getMsg()));
+			else
+				out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult(1, e.getMsg())));
 		}
 	}
 
@@ -472,6 +511,7 @@
 	 * @param id
 	 * @param out
 	 */
+	@RequestSerializableByKey(key = "'exchangeInviteCode-'+#uid")
 	@RequestMapping(value = "exchangeInviteCode", method = RequestMethod.POST)
 	public void exchangeInviteCode(AcceptData acceptData, Long uid, Long id, PrintWriter out) {
 		try {

--
Gitblit v1.8.0