Skip to content

Commit 61a6073

Browse files
committed
1.修改检查更新工具类
1 parent 8e427d9 commit 61a6073

6 files changed

Lines changed: 86 additions & 162 deletions

File tree

debugTools/x-RedisTool/src/main/java/com/xwintop/xJavaFxTool/RedisToolMain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.xwintop.xJavaFxTool;
22

3-
import com.xwintop.xJavaFxTool.utils.VersionChecker;
3+
import com.xwintop.xcore.util.VersionChecker;
44
import com.xwintop.xcore.util.javafx.JavaFxSystemUtil;
55
import javafx.application.Application;
66
import javafx.event.EventHandler;

xJavaFxTool/build.gradle

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -22,79 +22,79 @@ apply plugin: 'jpro-gradle-plugin'
2222
dependencies {
2323
api project(':xcore')
2424
implementation "com.sandec.jpro:jpro-webapi:2024.1.0"
25-
// api project(":littleTools:x-EncryptAndDecrypt")
26-
// api project(":littleTools:x-ZHConverter")
27-
// api project(":littleTools:x-ImageTool")
28-
// api project(":littleTools:x-IconTool")
29-
// api project(":littleTools:x-PdfConvertTool")
30-
// api project(":littleTools:x-QRCodeBuilder")
31-
// api project(":littleTools:x-FileCopy")
32-
// api project(":littleTools:x-FileMergeTool")
33-
// api project(":littleTools:x-TimeTool")
34-
// api project(":littleTools:x-CharacterConverter")
35-
// api project(":littleTools:x-BookManageSystem")
36-
// api project(":littleTools:x-CoordinateTransformTool")
37-
// api project(":littleTools:x-ElementaryArithmeticProblemTool")
38-
// api project(":littleTools:x-CronExpBuilder")
39-
// api project(":littleTools:x-EmailTool")
40-
// api project(":littleTools:x-ExcelSplitTool")
41-
// api project(":littleTools:x-FileBuildTool")
42-
// api project(":littleTools:x-FileCompressTool")
43-
// api project(":littleTools:x-FileRenameTool")
44-
// api project(":littleTools:x-FileSearchTool")
45-
// api project(":littleTools:x-HdfsTool")
46-
// api project(":littleTools:x-ImageAnalysisTool")
47-
// api project(":littleTools:x-JavaService")
48-
// api project(":littleTools:x-LinuxPathToWindowsPath")
49-
// api project(":littleTools:x-Mp3ConvertTool")
50-
// api project(":littleTools:x-RelationshipCalculator")
51-
// api project(":littleTools:x-SealBuilderTool")
52-
// api project(":littleTools:x-SedentaryReminderTool")
53-
// api project(":littleTools:x-SmsTool")
54-
// api project(":debugTools:x-CmdTool")
55-
// api project(":debugTools:x-ScanPortTool")
56-
// api project(":debugTools:x-SwitchHostsTool")
57-
// api project(":debugTools:x-SocketTool")
58-
// api project(":debugTools:x-ActiveMqTool")
59-
// api project(":debugTools:x-ExpressionParserTool")
60-
// api project(":debugTools:x-FtpClientTool")
61-
// api project(":debugTools:x-FtpServer")
62-
// api project(":debugTools:x-HbaseTool")
63-
// api project(":debugTools:x-HttpTool")
64-
// api project(":debugTools:x-KafkaTool")
25+
api project(":littleTools:x-EncryptAndDecrypt")
26+
api project(":littleTools:x-ZHConverter")
27+
api project(":littleTools:x-ImageTool")
28+
api project(":littleTools:x-IconTool")
29+
api project(":littleTools:x-PdfConvertTool")
30+
api project(":littleTools:x-QRCodeBuilder")
31+
api project(":littleTools:x-FileCopy")
32+
api project(":littleTools:x-FileMergeTool")
33+
api project(":littleTools:x-TimeTool")
34+
api project(":littleTools:x-CharacterConverter")
35+
api project(":littleTools:x-BookManageSystem")
36+
api project(":littleTools:x-CoordinateTransformTool")
37+
api project(":littleTools:x-ElementaryArithmeticProblemTool")
38+
api project(":littleTools:x-CronExpBuilder")
39+
api project(":littleTools:x-EmailTool")
40+
api project(":littleTools:x-ExcelSplitTool")
41+
api project(":littleTools:x-FileBuildTool")
42+
api project(":littleTools:x-FileCompressTool")
43+
api project(":littleTools:x-FileRenameTool")
44+
api project(":littleTools:x-FileSearchTool")
45+
api project(":littleTools:x-HdfsTool")
46+
api project(":littleTools:x-ImageAnalysisTool")
47+
api project(":littleTools:x-JavaService")
48+
api project(":littleTools:x-LinuxPathToWindowsPath")
49+
api project(":littleTools:x-Mp3ConvertTool")
50+
api project(":littleTools:x-RelationshipCalculator")
51+
api project(":littleTools:x-SealBuilderTool")
52+
api project(":littleTools:x-SedentaryReminderTool")
53+
api project(":littleTools:x-SmsTool")
54+
api project(":debugTools:x-CmdTool")
55+
api project(":debugTools:x-ScanPortTool")
56+
api project(":debugTools:x-SwitchHostsTool")
57+
api project(":debugTools:x-SocketTool")
58+
api project(":debugTools:x-ActiveMqTool")
59+
api project(":debugTools:x-ExpressionParserTool")
60+
api project(":debugTools:x-FtpClientTool")
61+
api project(":debugTools:x-FtpServer")
62+
api project(":debugTools:x-HbaseTool")
63+
api project(":debugTools:x-HttpTool")
64+
api project(":debugTools:x-KafkaTool")
6565
// api project(":debugTools:x-KeyTool")
66-
// api project(":debugTools:x-RedisTool")
67-
// api project(":debugTools:x-ScriptEngineTool")
68-
// api project(":debugTools:x-ZookeeperTool")
69-
// api project(":codeTools:x-RegexTester")
70-
// api project(":codeTools:x-RandomGeneratorTool")
71-
// api project(":codeTools:x-IdCardGenerator")
72-
// api project(":codeTools:x-CharsetDetectTool")
73-
// api project(":codeTools:x-ColorCodeConverterTool")
74-
// api project(":codeTools:x-EscapeCharacter")
75-
// api project(":codeTools:x-FileUnicodeTransformationTool")
76-
// api project(":codeTools:x-WebSourcesTool")
77-
// api project(":developTools:x-AsciiPicTool")
78-
// api project(":developTools:x-JsonConvertTool")
79-
// api project(":developTools:x-ClipboardHistoryTool")
80-
// api project(":developTools:x-DirectoryTreeTool")
81-
// api project(":developTools:x-LuytenTool")
82-
// api project(":developTools:x-PathWatchTool")
83-
// api project(":assistTools:x-TextToSpeechTool")
84-
// api project(":assistTools:x-DecompilerWxApkgTool")
85-
// api project(":assistTools:x-IdiomDataTool")
86-
// api project(":assistTools:x-WechatJumpGameTool")
87-
// api project(":games:x-X2048")
88-
// api project(":games:x-BullsAndCowsGame")
89-
// api project(":games:x-Sudoku")
90-
// api project(":games:x-ChineseChess")
91-
// api project(":games:x-SnakeJavaFx")
92-
// api project(":games:x-pet")
93-
// api project(":javaFxTools:x-JavaFxXmlToObjectCode")
94-
// api project(":javaFxTools:x-ShowSystemInfo")
95-
// api project(":webTools:x-ShortURL")
96-
// api project(":netWorkTools:x-WebCronExpBuilder")
97-
// api project(":netWorkTools:x-WebJsonEditor")
66+
api project(":debugTools:x-RedisTool")
67+
api project(":debugTools:x-ScriptEngineTool")
68+
api project(":debugTools:x-ZookeeperTool")
69+
api project(":codeTools:x-RegexTester")
70+
api project(":codeTools:x-RandomGeneratorTool")
71+
api project(":codeTools:x-IdCardGenerator")
72+
api project(":codeTools:x-CharsetDetectTool")
73+
api project(":codeTools:x-ColorCodeConverterTool")
74+
api project(":codeTools:x-EscapeCharacter")
75+
api project(":codeTools:x-FileUnicodeTransformationTool")
76+
api project(":codeTools:x-WebSourcesTool")
77+
api project(":developTools:x-AsciiPicTool")
78+
api project(":developTools:x-JsonConvertTool")
79+
api project(":developTools:x-ClipboardHistoryTool")
80+
api project(":developTools:x-DirectoryTreeTool")
81+
api project(":developTools:x-LuytenTool")
82+
api project(":developTools:x-PathWatchTool")
83+
api project(":assistTools:x-TextToSpeechTool")
84+
api project(":assistTools:x-DecompilerWxApkgTool")
85+
api project(":assistTools:x-IdiomDataTool")
86+
api project(":assistTools:x-WechatJumpGameTool")
87+
api project(":games:x-X2048")
88+
api project(":games:x-BullsAndCowsGame")
89+
api project(":games:x-Sudoku")
90+
api project(":games:x-ChineseChess")
91+
api project(":games:x-SnakeJavaFx")
92+
api project(":games:x-pet")
93+
api project(":javaFxTools:x-JavaFxXmlToObjectCode")
94+
api project(":javaFxTools:x-ShowSystemInfo")
95+
api project(":webTools:x-ShortURL")
96+
api project(":netWorkTools:x-WebCronExpBuilder")
97+
api project(":netWorkTools:x-WebJsonEditor")
9898
}
9999

100100
group = 'com.xwintop'

xJavaFxTool/src/main/java/com/xwintop/xJavaFxTool/XJavaFxToolApplication.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
import com.xwintop.xJavaFxTool.utils.Config;
1616
import com.xwintop.xJavaFxTool.utils.Config.Keys;
1717
import com.xwintop.xJavaFxTool.utils.StageUtils;
18-
import com.xwintop.xJavaFxTool.utils.VersionChecker;
1918
import com.xwintop.xJavaFxTool.utils.XJavaFxSystemUtil;
2019
import com.xwintop.xcore.javafx.FxApp;
2120
import com.xwintop.xcore.javafx.dialog.FxAlerts;
21+
import com.xwintop.xcore.util.VersionChecker;
2222
import javafx.application.Application;
2323
import javafx.application.Platform;
2424
import javafx.event.Event;
@@ -70,7 +70,7 @@ public void start(Stage primaryStage) throws Exception {
7070
loadClassicUI(primaryStage);
7171

7272
StageUtils.loadPrimaryStageBound(primaryStage);
73-
primaryStage.setOnShown(windowEvent -> VersionChecker.checkNewVersion());
73+
primaryStage.setOnShown(windowEvent -> VersionChecker.checkerVersion("https://gitee.com/api/v5/repos/xwintop/xJavaFxTool/releases/latest", "https://gitee.com/xwintop/xJavaFxTool/releases", Config.xJavaFxToolVersions.substring(1)));
7474
primaryStage.show();
7575
}
7676

xJavaFxTool/src/main/java/com/xwintop/xJavaFxTool/controller/IndexController.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
import com.xwintop.xJavaFxTool.services.IndexService;
1515
import com.xwintop.xJavaFxTool.services.index.SystemSettingService;
1616
import com.xwintop.xJavaFxTool.utils.Config;
17-
import com.xwintop.xJavaFxTool.utils.VersionChecker;
1817
import com.xwintop.xJavaFxTool.view.IndexView;
1918
import com.xwintop.xcore.javafx.FxApp;
2019
import com.xwintop.xcore.javafx.dialog.FxAlerts;
2120
import com.xwintop.xcore.javafx.dialog.FxDialog;
2221
import com.xwintop.xcore.util.ConfigureUtil;
22+
import com.xwintop.xcore.util.VersionChecker;
2323
import com.xwintop.xcore.util.javafx.AlertUtil;
2424
import com.xwintop.xcore.util.javafx.JavaFxSystemUtil;
2525
import javafx.application.Platform;
@@ -246,9 +246,7 @@ private void SettingAction() {
246246

247247
@FXML
248248
private void checkerVersionAction() {
249-
if (!VersionChecker.checkNewVersion()) {
250-
FxAlerts.info("提示", "已经是新版本");
251-
}
249+
VersionChecker.checkerVersion("https://gitee.com/api/v5/repos/xwintop/xJavaFxTool/releases/latest","https://gitee.com/xwintop/xJavaFxTool/releases",Config.xJavaFxToolVersions.substring(1));
252250
}
253251

254252
@FXML

xJavaFxTool/src/main/java/com/xwintop/xJavaFxTool/utils/VersionChecker.java

Lines changed: 0 additions & 73 deletions
This file was deleted.

debugTools/x-RedisTool/src/main/java/com/xwintop/xJavaFxTool/utils/VersionChecker.java renamed to xcore/src/main/java/com/xwintop/xcore/util/VersionChecker.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package com.xwintop.xJavaFxTool.utils;
1+
package com.xwintop.xcore.util;
22

33
import cn.hutool.http.HttpUtil;
44
import com.alibaba.fastjson2.JSON;
55
import com.alibaba.fastjson2.JSONObject;
6-
import com.xwintop.xcore.util.javafx.AlertUtil;
6+
import com.xwintop.xcore.javafx.dialog.FxAlerts;
77
import com.xwintop.xcore.util.javafx.JavaFxSystemUtil;
88
import javafx.application.Platform;
99
import lombok.extern.slf4j.Slf4j;
@@ -14,23 +14,22 @@
1414

1515
/**
1616
* @ClassName: VersionChecker
17-
* @Description: 版本检查工具类
17+
* @Description: 新版本检查
1818
* @author: xufeng
19-
* @date: 2021/1/31 22:25
19+
* @date: 2022/3/28 14:59
2020
*/
2121

2222
@Slf4j
2323
public class VersionChecker {
24-
2524
public static void checkerVersion(String checkUrl, String downloadUrl, String version) {
2625
VersionChecker.hasNewVersion(checkUrl, version, (latestVersion, features) -> {
2726
String title = "发现新版本";
2827
final String content = new StringBuilder()
29-
.append("最新版本: ").append(latestVersion).append("\r\n")
30-
.append("当前版本: v").append(version).append("\r\n")
31-
.append("新特性: \r\n").append(features)
32-
.toString();
33-
if (AlertUtil.showConfirmAlert(content)) {
28+
.append("最新版本: ").append(latestVersion).append("\r\n")
29+
.append("当前版本: v").append(version).append("\r\n")
30+
.append("新特性: \r\n").append(features)
31+
.toString();
32+
if (FxAlerts.confirmOkCancel(title + latestVersion, content)) {
3433
try {
3534
JavaFxSystemUtil.openBrowseURLThrowsException(downloadUrl);
3635
} catch (IOException e) {

0 commit comments

Comments
 (0)