| | |
| | | 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;
|
| | |
|
| | |
| | | no.setType(ap.getType());
|
| | | no.setUpdateTime(ap.getUpdateTime());
|
| | | no.setCanClose(false);
|
| | | no.setContent("尊敬的用户,为更加准确高效的为你返利、省钱,请升级到返利券最新版本");
|
| | | no.setContent(String.format("尊敬的用户,为更加准确高效的为你返利、省钱,请升级到%s最新版本",Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion())));
|
| | | Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
|
| | | out.print(JsonUtil.loadTrueResult(gson.toJson(no)));
|
| | | return;
|
| | |
| | | public void updateApp(AcceptData acceptData, PrintWriter out) {
|
| | | Map<String, String> params = new HashMap<>();
|
| | | if ("android".equalsIgnoreCase(acceptData.getPlatform())) {// android更新
|
| | | acceptData.setVersion("10");
|
| | | // acceptData.setVersion("10");
|
| | | params.put("method", "update");
|
| | | params.put("Platform", "Android");
|
| | | params.put("Version", acceptData.getVersion());
|
| | |
| | | params.put("platform", "Android");
|
| | | params.put("key", "a3f390d88e4c41f2747bfa2f1b5f87db");
|
| | | 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);
|
| | | }
|
| | | } else {// IOS更新
|
| | | params.put("method", "update");
|
| | | params.put("Platform", "IOS");
|