From eac0221c3906b7c1dbf902cb47298466c3b8f474 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 17 十二月 2019 16:27:12 +0800
Subject: [PATCH] 专题版本控制bug修改
---
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/HelpController.java | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 52 insertions(+), 4 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/HelpController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/HelpController.java
index d82691e..df4d4ca 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/HelpController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/HelpController.java
@@ -1,6 +1,9 @@
package com.yeshi.fanli.controller.client.v1;
import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
+import java.util.Map;
import javax.annotation.Resource;
@@ -12,9 +15,11 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.help.AppPageNotification;
import com.yeshi.fanli.service.inter.help.AppPageNotificationService;
+import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.VersionUtil;
+import org.yeshi.utils.HttpUtil;
import org.yeshi.utils.JsonUtil;
@Controller
@@ -38,13 +43,20 @@
return;
}
- AppPageNotification ap = appPageNotificationService.getAppPageNotificationByTypeCache(type);
+ AppPageNotification ap = appPageNotificationService.getValidNotificationByTypeCache(type);
if ("home".equalsIgnoreCase(type)
&& VersionUtil.smallerThan_1_5_1(acceptData.getPlatform(), acceptData.getVersion()) && ap != null) {
- ap.setCanClose(false);
- ap.setContent("灏婃暚鐨勭敤鎴凤紝涓烘洿鍔犲噯纭珮鏁堢殑涓轰綘杩斿埄銆佺渷閽憋紝璇峰崌绾у埌杩斿埄鍒告渶鏂扮増鏈�");
+ AppPageNotification no = new AppPageNotification();
+ no.setContentUrl("");
+ no.setMd5("111111111111111111");
+ no.setPageName(ap.getPageName());
+ no.setShow(true);
+ no.setType(ap.getType());
+ no.setUpdateTime(ap.getUpdateTime());
+ no.setCanClose(false);
+ no.setContent(String.format("灏婃暚鐨勭敤鎴凤紝涓烘洿鍔犲噯纭珮鏁堢殑涓轰綘杩斿埄銆佺渷閽憋紝璇峰崌绾у埌%s鏈�鏂扮増鏈�",Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion())));
Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
- out.print(JsonUtil.loadTrueResult(gson.toJson(ap)));
+ out.print(JsonUtil.loadTrueResult(gson.toJson(no)));
return;
}
@@ -57,4 +69,40 @@
}
}
+ @RequestMapping(value = "updateApp")
+ public void updateApp(AcceptData acceptData, PrintWriter out) {
+ Map<String, String> params = new HashMap<>();
+ if ("android".equalsIgnoreCase(acceptData.getPlatform())) {// android鏇存柊
+// acceptData.setVersion("10");
+ params.put("method", "update");
+ params.put("Platform", "Android");
+ params.put("Version", acceptData.getVersion());
+ params.put("device ", acceptData.getDevice());
+ params.put("time", System.currentTimeMillis() + "");
+ params.put("Package", acceptData.getPackages());
+ params.put("device", acceptData.getDevice());
+ params.put("platform", "Android");
+ params.put("key", "a3f390d88e4c41f2747bfa2f1b5f87db");
+ params.put("versionCode", acceptData.getVersion() + "");
+ } else {// IOS鏇存柊
+ params.put("method", "update");
+ params.put("Platform", "IOS");
+ params.put("Version", acceptData.getVersion());
+ params.put("device ", acceptData.getDevice());
+ params.put("time", System.currentTimeMillis() + "");
+ params.put("Package", acceptData.getPackages());
+ params.put("device", acceptData.getDevice());
+ params.put("platform", "IOS");
+ params.put("key", "32bb90e8976aab5298d5da10fe66f21d");
+ params.put("versionCode", acceptData.getVersion() + "");
+ }
+ String url = "http://update.yeshitv.com:8090/update/update";
+ String result = HttpUtil.post(url, params, null);
+ try {
+ out.print(new String(result.getBytes("ISO-8859-1"), "UTF-8"));
+ } catch (UnsupportedEncodingException e) {
+ out.print(result);
+ }
+ }
+
}
--
Gitblit v1.8.0