diff --git a/README.md b/README.md
index 9174536..ba903c9 100644
--- a/README.md
+++ b/README.md
@@ -5,13 +5,12 @@
2. 文件下载、文件上传、在线日志
#### 软件架构
-1. Jdk 17
+1. Jdk 21
2. Maven 3.6.3
-3. SpringBoot 3.1.1
-4. SpringBoot Starter Thymeleaf 3.1.1
-5. SpringBoot Starter WebSocket 3.1.1
-6. RocksDB 8.3.2
-7. Hutool Json 5.8.21
+3. SpringBoot 3.5.3
+4. SpringBoot Starter Thymeleaf 3.5.3
+5. SpringBoot Starter WebSocket 3.5.3
+7. Hutool 5.8.25
7. AXUI 2.1.1
diff --git a/pom.xml b/pom.xml
index 006bc36..31841aa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,9 +10,9 @@
cn.somkit
fmt
- 1.3.0
+ 2.0.0
fmt
- fmt
+ File Manage System for by SpringBoot
21
diff --git a/src/main/java/cn/somkit/fmt/action/LoggingAction.java b/src/main/java/cn/somkit/fmt/action/LoggingAction.java
index bea8a45..68d173f 100644
--- a/src/main/java/cn/somkit/fmt/action/LoggingAction.java
+++ b/src/main/java/cn/somkit/fmt/action/LoggingAction.java
@@ -1,21 +1,12 @@
package cn.somkit.fmt.action;
import cn.metona.cache.Cache;
-import cn.somkit.fmt.entity.LoggerMessage;
-import cn.somkit.fmt.utils.LoggerQueue;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
-
-import java.io.IOException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.atomic.AtomicBoolean;
@Controller
@RequestMapping("/logging")
diff --git a/src/main/java/cn/somkit/fmt/action/SystemAction.java b/src/main/java/cn/somkit/fmt/action/SystemAction.java
deleted file mode 100644
index 2a17172..0000000
--- a/src/main/java/cn/somkit/fmt/action/SystemAction.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package cn.somkit.fmt.action;
-
-import cn.somkit.fmt.annotation.ApiOperate;
-import cn.somkit.fmt.config.FmtConfig;
-import cn.somkit.fmt.utils.ParamUtils;
-import cn.somkit.fmt.utils.PathUtils;
-import cn.somkit.fmt.utils.RocksDBUtils;
-import org.rocksdb.RocksDBException;
-import org.springframework.stereotype.Controller;
-import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.ModelAndView;
-
-import java.util.HashMap;
-import java.util.Map;
-
-@Controller
-@RequestMapping("/system")
-public class SystemAction {
-
- @GetMapping("/index")
- public ModelAndView index() throws Exception{
- Map map = new HashMap<>();
- map.put("Upload_File_Path", ParamUtils.getUploadPath());
- map.put("Temp_File_Path", ParamUtils.getTempFilePath());
- map.put("Log_File_Path", ParamUtils.getLogFilePath());
- map.put("Max_Read_Length", ParamUtils.getMaxReadLength());
- map.put("Read_Interval", ParamUtils.getReadInterval());
- ModelAndView mv = new ModelAndView();
- mv.setViewName("system");
- mv.addObject(FmtConfig.System_Cf_Name, map);
- return mv;
- }
-
- @PostMapping("/save")
- @ResponseBody
- @ApiOperate(description = "保存系统设置")
- public Map save(@RequestParam Map map) throws Exception {
- if(map != null && !map.isEmpty()){
- map.keySet().forEach(key -> {
- try {
- if(StringUtils.hasText(map.get(key))){
- String value = map.get(key).startsWith("./") ? PathUtils.resolve(map.get(key)) : map.get(key);
- RocksDBUtils.put(FmtConfig.System_Cf_Name, key, value);
- }
- } catch (RocksDBException e) {
- throw new RuntimeException(e);
- }
- });
- }
- return Map.of("code", 200, "message", "保存成功");
- }
-}
diff --git a/src/main/java/cn/somkit/fmt/config/FmtConfig.java b/src/main/java/cn/somkit/fmt/config/FmtConfig.java
deleted file mode 100644
index 54c8778..0000000
--- a/src/main/java/cn/somkit/fmt/config/FmtConfig.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package cn.somkit.fmt.config;
-
-import cn.somkit.fmt.utils.PathUtils;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-import org.springframework.util.StringUtils;
-
-/**
- * 系统参数配置
- */
-@Component
-public class FmtConfig {
-
- public static String System_Cf_Name = "system";
-
- public static String Upload_File_Path = "./data/files";
-
- public static String Temp_File_Path = "./data/files/temp";
-
- @Value("${somkit.upload.path}")
- public void setUpload_File_Path(String upload_file_path) {
- if(StringUtils.hasText(upload_file_path)){
- //如果使用相对路径,转换为绝对路径
- if(upload_file_path.startsWith("./")){
- upload_file_path = PathUtils.resolve(upload_file_path);
- }
- Upload_File_Path = upload_file_path;
- }
- }
-
- @Value("${somkit.upload.temp-path}")
- public void setTemp_File_Path(String temp_file_path) {
- if(StringUtils.hasText(temp_file_path)){
- //如果使用相对路径,转换为绝对路径
- if(temp_file_path.startsWith("./")){
- temp_file_path = PathUtils.resolve(temp_file_path);
- }
- Temp_File_Path = temp_file_path;
- }
- }
-}
diff --git a/src/main/java/cn/somkit/fmt/utils/ParamUtils.java b/src/main/java/cn/somkit/fmt/utils/ParamUtils.java
deleted file mode 100644
index 1837c74..0000000
--- a/src/main/java/cn/somkit/fmt/utils/ParamUtils.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package cn.somkit.fmt.utils;
-
-import cn.somkit.fmt.config.FmtConfig;
-import cn.somkit.fmt.config.LogSocketConfig;
-import org.springframework.util.StringUtils;
-
-public class ParamUtils {
-
- public static String getUploadPath() throws Exception {
- String path = RocksDBUtils.get(FmtConfig.System_Cf_Name, "Upload_File_Path");
- if(StringUtils.hasText(path)){
- return path;
- } else {
- path = FmtConfig.Upload_File_Path;
- RocksDBUtils.put(FmtConfig.System_Cf_Name, "Upload_File_Path", path);
- return path;
- }
- }
-
- public static String getTempFilePath() throws Exception {
- String path = RocksDBUtils.get(FmtConfig.System_Cf_Name, "Temp_File_Path");
- if(StringUtils.hasText(path)){
- return path;
- } else {
- path = FmtConfig.Temp_File_Path;
- RocksDBUtils.put(FmtConfig.System_Cf_Name, "Temp_File_Path", path);
- return path;
- }
- }
-
- public static String getLogFilePath() throws Exception {
- String path = RocksDBUtils.get(FmtConfig.System_Cf_Name, "Log_File_Path");
- if(StringUtils.hasText(path)){
- return path;
- } else {
- path = LogSocketConfig.Log_File_Path;
- RocksDBUtils.put(FmtConfig.System_Cf_Name, "Log_File_Path", path);
- return path;
- }
- }
-
- public static String getMaxReadLength() throws Exception {
- String path = RocksDBUtils.get(FmtConfig.System_Cf_Name, "Max_Read_Length");
- if(StringUtils.hasText(path)){
- return path;
- } else {
- path = LogSocketConfig.Max_Read_Length;
- RocksDBUtils.put(FmtConfig.System_Cf_Name, "Max_Read_Length", path);
- return path;
- }
- }
-
- public static String getReadInterval() throws Exception {
- String path = RocksDBUtils.get(FmtConfig.System_Cf_Name, "Read_Interval");
- if(StringUtils.hasText(path)){
- return path;
- } else {
- path = LogSocketConfig.Read_Interval;
- RocksDBUtils.put(FmtConfig.System_Cf_Name, "Read_Interval", path);
- return path;
- }
- }
-}
diff --git a/src/main/java/cn/somkit/fmt/utils/PathUtils.java b/src/main/java/cn/somkit/fmt/utils/PathUtils.java
deleted file mode 100644
index 0840794..0000000
--- a/src/main/java/cn/somkit/fmt/utils/PathUtils.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package cn.somkit.fmt.utils;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-/**
- * 路径工具类
- */
-public class PathUtils {
-
- /**
- * 解析相对路径为绝对路径
- * @param relativePath 相对路径
- * @return 绝对路径
- */
- public static String resolve(String relativePath) {
- if(relativePath.startsWith("./")){
- relativePath = relativePath.replace("./", "");
- }
- // 获取当前工作目录的Path对象
- Path currentWorkingDirectory = Paths.get("").toAbsolutePath();
- // 使用相对路径创建Path对象
- Path relativePathObject = Paths.get(relativePath);
- // 解析相对路径,补全为绝对路径
- Path absolutePath = currentWorkingDirectory.resolve(relativePathObject);
- return absolutePath.toString();
- }
-
- /**
- * 创建文件夹
- * @param directoryPath 文件夹路径
- */
- public static void directory(String directoryPath){
- // 使用Paths.get()方法创建Path对象
- Path dirPath = Paths.get(directoryPath);
- // 检查文件夹是否存在
- if (Files.notExists(dirPath)) {
- try {
- // 如果不存在,则创建文件夹及其所有必需的父目录
- Files.createDirectories(dirPath);
- System.out.println("Directory created: " + dirPath);
- } catch (IOException e) {
- // 如果创建过程中出现异常,打印错误信息
- System.err.println("Failed to create directory: " + dirPath);
- e.printStackTrace();
- }
- } else {
- System.out.println("Directory already exists: " + dirPath);
- }
- }
-}
diff --git a/src/main/resources/bin/startup.bat b/src/main/resources/bin/startup.bat
index 769b709..575a2d0 100644
--- a/src/main/resources/bin/startup.bat
+++ b/src/main/resources/bin/startup.bat
@@ -1,5 +1,5 @@
chcp 65001
-SET JAR=D:/fmt/fmt-1.3.0.jar
+SET JAR=D:/fmt/fmt-2.0.0.jar
SET JAR_CONFIG=D:/fmt/config/
SET JAR_LIB=D:/fmt/lib/
java -Dfile.encoding=utf-8 -jar %JAR% --spring.config.location=%JAR_CONFIG% --spring.lib.location=%JAR_LIB%
\ No newline at end of file
diff --git a/src/main/resources/bin/startup.sh b/src/main/resources/bin/startup.sh
index 6410dd5..7e4f46e 100644
--- a/src/main/resources/bin/startup.sh
+++ b/src/main/resources/bin/startup.sh
@@ -1,8 +1,8 @@
#!/bin/bash
-JAR=/home/deploy/fmt/fmt-1.3.0.jar
+JAR=/home/deploy/fmt/fmt-2.0.0.jar
JAR_CONFIG=/home/deploy/fmt/config/
JAR_LIB=/home/deploy/fmt/lib/
-JAVA_HOME=/usr/local/jdk-17.0.7
+JAVA_HOME=/usr/local/jdk-21
JAVA=$JAVA_HOME/bin/java
nohup $JAVA -jar $JAR --spring.config.location=$JAR_CONFIG --spring.lib.location=$JAR_LIB -Djava.ext.dirs=$JAVA_HOME/lib &
tail -f nohup.out
\ No newline at end of file
diff --git a/src/main/resources/templates/download.html b/src/main/resources/templates/download.html
index 180062b..85499a8 100644
--- a/src/main/resources/templates/download.html
+++ b/src/main/resources/templates/download.html
@@ -43,10 +43,6 @@
在线日志
-
diff --git a/src/main/resources/templates/system.html b/src/main/resources/templates/system.html
deleted file mode 100644
index 874affa..0000000
--- a/src/main/resources/templates/system.html
+++ /dev/null
@@ -1,150 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- 系统设置
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/resources/templates/upload.html b/src/main/resources/templates/upload.html
index 0254c11..c68583c 100644
--- a/src/main/resources/templates/upload.html
+++ b/src/main/resources/templates/upload.html
@@ -36,10 +36,6 @@
在线日志
-
diff --git a/版本记录/readme.md b/版本记录/readme.md
index 458ab33..c18ccec 100644
--- a/版本记录/readme.md
+++ b/版本记录/readme.md
@@ -17,11 +17,13 @@
上传文件格式新增支持js、css、html、vsdx、dmp、7z、ppt、pptx
AxUI的axAjax方法,timeout默认值改为6000000
```
-> v1.3.0
+> v2.0.0
```
- 修改RocksDB文件目录配置,使其支持使用相对路径
- 修改上传文件目录配置,使其支持使用相对路径
- 新增临时文件存放地址配置,支持相对路径
- 新增系统设置页面,支持在线配置上传文件地址、日志文件地址等参数
+ SpringBoot从3.1.1升级到3.5.3
+ JDK从17升级到21并开启虚拟线程
+ 删除RocksDB相关配置,不再使用该缓存方案
修改文件下载方式,使用StreamingResponseBody,支持大文件下载
+ 引入metona-cache-spring-boot-starter,使用此缓存方案
+ 重构在线日志页面及实现方式,不再使用读取日志文件方式,自定义日志拦截器实时获取日志
+ 不再生成自定义日志文件,日志打印从INFO改为DEBUG,打印更详细的内容
```
\ No newline at end of file