|
|
@ -1,7 +1,12 @@ |
|
|
|
package com.fr.design.update.push; |
|
|
|
package com.fr.design.update.push; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.general.CloudCenter; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
|
|
|
import com.fr.general.http.HttpToolbox; |
|
|
|
|
|
|
|
import com.fr.json.JSON; |
|
|
|
|
|
|
|
import com.fr.json.JSONFactory; |
|
|
|
import com.fr.json.JSONObject; |
|
|
|
import com.fr.json.JSONObject; |
|
|
|
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
|
|
|
import java.security.InvalidParameterException; |
|
|
|
import java.security.InvalidParameterException; |
|
|
@ -14,6 +19,8 @@ class DesignerUpdateInfo { |
|
|
|
private static final String KEY_CONTENT = "content"; |
|
|
|
private static final String KEY_CONTENT = "content"; |
|
|
|
private static final String KEY_BACKGROUND_URL = "background"; |
|
|
|
private static final String KEY_BACKGROUND_URL = "background"; |
|
|
|
private static final String KEY_MORE_INFO_URL = "more"; |
|
|
|
private static final String KEY_MORE_INFO_URL = "more"; |
|
|
|
|
|
|
|
private static final String SPLIT_CHAR = "-"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final String currentVersion; // 当前版本
|
|
|
|
private final String currentVersion; // 当前版本
|
|
|
|
private final String latestVersion; // 最新版本
|
|
|
|
private final String latestVersion; // 最新版本
|
|
|
@ -58,6 +65,26 @@ class DesignerUpdateInfo { |
|
|
|
return latestVersion; |
|
|
|
return latestVersion; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String getLatestFullVersion() { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
String url = CloudCenter.getInstance().acquireUrlByKind("jar10.new.update"); |
|
|
|
|
|
|
|
if (StringUtils.isBlank(url)) { |
|
|
|
|
|
|
|
return StringUtils.EMPTY; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String res = HttpToolbox.get(url); |
|
|
|
|
|
|
|
if (StringUtils.isBlank(res)) { |
|
|
|
|
|
|
|
return StringUtils.EMPTY; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
JSONObject jsonObject = JSONFactory.createJSON(JSON.OBJECT, res); |
|
|
|
|
|
|
|
String version = jsonObject.getString("version"); |
|
|
|
|
|
|
|
String build = jsonObject.getString("build"); |
|
|
|
|
|
|
|
return version + SPLIT_CHAR + build; |
|
|
|
|
|
|
|
} catch (Throwable e) { |
|
|
|
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return StringUtils.EMPTY; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String getLastIgnoredVersion() { |
|
|
|
String getLastIgnoredVersion() { |
|
|
|
return lastIgnoredVersion; |
|
|
|
return lastIgnoredVersion; |
|
|
|
} |
|
|
|
} |
|
|
|