diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index fbcab775..b1ec13e7 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1 +1 @@
-custom: http://doc.ruoyi.vip/ruoyi-vue/other/donate.html
+custom: http://doc.ruoyi.vip/tcctlo-vue/other/donate.html
diff --git a/bin/run.bat b/bin/run.bat
index 99c49921..94e43525 100644
--- a/bin/run.bat
+++ b/bin/run.bat
@@ -4,11 +4,11 @@ echo [
echo.
cd %~dp0
-cd ../ruoyi-admin/target
+cd ../tcctlo-admin/target
set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
-java -jar %JAVA_OPTS% ruoyi-admin.jar
+java -jar %JAVA_OPTS% tcctlo-admin.jar
cd bin
pause
\ No newline at end of file
diff --git a/doc/若依环境使用手册.docx b/doc/╚⌠╥└╗╖╛│╩╣╙├╩╓▓ß.docx
similarity index 100%
rename from doc/若依环境使用手册.docx
rename to doc/╚⌠╥└╗╖╛│╩╣╙├╩╓▓ß.docx
diff --git a/pom.xml b/pom.xml
index 21f8ea0f..f01cf5fa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,16 +4,16 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
- com.ruoyi
- ruoyi
+ com.tcctlo
+ tcctlo
3.8.9
- ruoyi
+ tcctlo
http://www.ruoyi.vip
- 若依管理系统
+ 律所OA办公系统
- 3.8.9
+ 3.8.9
UTF-8
UTF-8
1.8
@@ -185,49 +185,57 @@
- com.ruoyi
- ruoyi-quartz
- ${ruoyi.version}
+ com.tcctlo
+ tcctlo-quartz
+ ${tcctlo.version}
- com.ruoyi
- ruoyi-generator
- ${ruoyi.version}
+ com.tcctlo
+ tcctlo-generator
+ ${tcctlo.version}
- com.ruoyi
- ruoyi-framework
- ${ruoyi.version}
+ com.tcctlo
+ tcctlo-framework
+ ${tcctlo.version}
- com.ruoyi
- ruoyi-system
- ${ruoyi.version}
+ com.tcctlo
+ tcctlo-system
+ ${tcctlo.version}
- com.ruoyi
- ruoyi-common
- ${ruoyi.version}
+ com.tcctlo
+ tcctlo-common
+ ${tcctlo.version}
+
+
+
+
+ com.tcctlo.law
+ tcctlo-law-office
+ ${tcctlo.version}
- ruoyi-admin
- ruoyi-framework
- ruoyi-system
- ruoyi-quartz
- ruoyi-generator
- ruoyi-common
+ tcctlo-admin
+ tcctlo-framework
+ tcctlo-system
+ tcctlo-quartz
+ tcctlo-generator
+ tcctlo-common
+ tcctlo-law-office
pom
diff --git a/ry.bat b/ry.bat
index 69abee7b..28bb06b3 100644
--- a/ry.bat
+++ b/ry.bat
@@ -1,7 +1,7 @@
@echo off
rem jarƽĿ¼
-set AppName=ruoyi-admin.jar
+set AppName=tcctlo-admin.jar
rem JVM
set JVM_OPTS="-Dname=%AppName% -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
diff --git a/ry.sh b/ry.sh
index d6a9cf33..11b73d05 100644
--- a/ry.sh
+++ b/ry.sh
@@ -1,6 +1,6 @@
#!/bin/sh
# ./ry.sh start 启动 stop 停止 restart 重启 status 状态
-AppName=ruoyi-admin.jar
+AppName=tcctlo-admin.jar
# JVM参数
JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC"
diff --git a/ruoyi-admin/pom.xml b/tcctlo-admin/pom.xml
similarity index 80%
rename from ruoyi-admin/pom.xml
rename to tcctlo-admin/pom.xml
index 34a40e84..f1056acf 100644
--- a/ruoyi-admin/pom.xml
+++ b/tcctlo-admin/pom.xml
@@ -1,96 +1,103 @@
-
-
-
- ruoyi
- com.ruoyi
- 3.8.9
-
- 4.0.0
- jar
- ruoyi-admin
-
-
- web服务入口
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-devtools
- true
-
-
-
-
- io.springfox
- springfox-boot-starter
-
-
-
-
- io.swagger
- swagger-models
- 1.6.2
-
-
-
-
- mysql
- mysql-connector-java
-
-
-
-
- com.ruoyi
- ruoyi-framework
-
-
-
-
- com.ruoyi
- ruoyi-quartz
-
-
-
-
- com.ruoyi
- ruoyi-generator
-
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
- 2.5.15
-
- true
-
-
-
-
- repackage
-
-
-
-
-
- org.apache.maven.plugins
- maven-war-plugin
- 3.1.0
-
- false
- ${project.artifactId}
-
-
-
- ${project.artifactId}
-
-
+
+
+
+ tcctlo
+ com.tcctlo
+ 3.8.9
+
+ 4.0.0
+ jar
+ tcctlo-admin
+
+
+ web服务入口
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-devtools
+ true
+
+
+
+
+ io.springfox
+ springfox-boot-starter
+
+
+
+
+ io.swagger
+ swagger-models
+ 1.6.2
+
+
+
+
+ mysql
+ mysql-connector-java
+
+
+
+
+ com.tcctlo
+ tcctlo-framework
+
+
+
+
+ com.tcctlo
+ tcctlo-quartz
+
+
+
+
+ com.tcctlo
+ tcctlo-generator
+
+
+
+
+ com.tcctlo.law
+ tcctlo-law-office
+ ${tcctlo.version}
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ 2.5.15
+
+ true
+
+
+
+
+ repackage
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+ 3.1.0
+
+ false
+ ${project.artifactId}
+
+
+
+ ${project.artifactId}
+
+
\ No newline at end of file
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java b/tcctlo-admin/src/main/java/com/tcctlo/RuoYiServletInitializer.java
similarity index 80%
rename from ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java
rename to tcctlo-admin/src/main/java/com/tcctlo/RuoYiServletInitializer.java
index 9d82a237..48dea597 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java
+++ b/tcctlo-admin/src/main/java/com/tcctlo/RuoYiServletInitializer.java
@@ -1,18 +1,18 @@
-package com.ruoyi;
-
-import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
-
-/**
- * web容器中进行部署
- *
- * @author ruoyi
- */
-public class RuoYiServletInitializer extends SpringBootServletInitializer
-{
- @Override
- protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
- {
- return application.sources(RuoYiApplication.class);
- }
-}
+package com.tcctlo;
+
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+
+/**
+ * web容器中进行部署
+ *
+ * @author ruoyi
+ */
+public class RuoYiServletInitializer extends SpringBootServletInitializer
+{
+ @Override
+ protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
+ {
+ return application.sources(TCCTLawOfficeApplication.class);
+ }
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/tcctlo-admin/src/main/java/com/tcctlo/TCCTLawOfficeApplication.java
similarity index 83%
rename from ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
rename to tcctlo-admin/src/main/java/com/tcctlo/TCCTLawOfficeApplication.java
index e3c56ee5..c57e43a8 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
+++ b/tcctlo-admin/src/main/java/com/tcctlo/TCCTLawOfficeApplication.java
@@ -1,30 +1,32 @@
-package com.ruoyi;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-
-/**
- * 启动程序
- *
- * @author ruoyi
- */
-@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
-public class RuoYiApplication
-{
- public static void main(String[] args)
- {
- // System.setProperty("spring.devtools.restart.enabled", "false");
- SpringApplication.run(RuoYiApplication.class, args);
- System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
- " .-------. ____ __ \n" +
- " | _ _ \\ \\ \\ / / \n" +
- " | ( ' ) | \\ _. / ' \n" +
- " |(_ o _) / _( )_ .' \n" +
- " | (_,_).' __ ___(_ o _)' \n" +
- " | |\\ \\ | || |(_,_)' \n" +
- " | | \\ `' /| `-' / \n" +
- " | | \\ / \\ / \n" +
- " ''-' `'-' `-..-' ");
- }
-}
+package com.tcctlo;
+
+import org.dromara.x.file.storage.spring.EnableFileStorage;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+
+/**
+ * 启动程序
+ *
+ * @author ruoyi
+ */
+@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
+@EnableFileStorage
+public class TCCTLawOfficeApplication
+{
+ public static void main(String[] args)
+ {
+ // System.setProperty("spring.devtools.restart.enabled", "false");
+ SpringApplication.run(TCCTLawOfficeApplication.class, args);
+ System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
+ " .-------. ____ __ \n" +
+ " | _ _ \\ \\ \\ / / \n" +
+ " | ( ' ) | \\ _. / ' \n" +
+ " |(_ o _) / _( )_ .' \n" +
+ " | (_,_).' __ ___(_ o _)' \n" +
+ " | |\\ \\ | || |(_,_)' \n" +
+ " | | \\ `' /| `-' / \n" +
+ " | | \\ / \\ / \n" +
+ " ''-' `'-' `-..-' ");
+ }
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java b/tcctlo-admin/src/main/java/com/tcctlo/web/controller/common/CaptchaController.java
similarity index 83%
rename from ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java
rename to tcctlo-admin/src/main/java/com/tcctlo/web/controller/common/CaptchaController.java
index e1a397e6..02913cfd 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java
+++ b/tcctlo-admin/src/main/java/com/tcctlo/web/controller/common/CaptchaController.java
@@ -1,94 +1,94 @@
-package com.ruoyi.web.controller.common;
-
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-import java.util.concurrent.TimeUnit;
-import javax.annotation.Resource;
-import javax.imageio.ImageIO;
-import javax.servlet.http.HttpServletResponse;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.FastByteArrayOutputStream;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.google.code.kaptcha.Producer;
-import com.ruoyi.common.config.RuoYiConfig;
-import com.ruoyi.common.constant.CacheConstants;
-import com.ruoyi.common.constant.Constants;
-import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.core.redis.RedisCache;
-import com.ruoyi.common.utils.sign.Base64;
-import com.ruoyi.common.utils.uuid.IdUtils;
-import com.ruoyi.system.service.ISysConfigService;
-
-/**
- * 验证码操作处理
- *
- * @author ruoyi
- */
-@RestController
-public class CaptchaController
-{
- @Resource(name = "captchaProducer")
- private Producer captchaProducer;
-
- @Resource(name = "captchaProducerMath")
- private Producer captchaProducerMath;
-
- @Autowired
- private RedisCache redisCache;
-
- @Autowired
- private ISysConfigService configService;
- /**
- * 生成验证码
- */
- @GetMapping("/captchaImage")
- public AjaxResult getCode(HttpServletResponse response) throws IOException
- {
- AjaxResult ajax = AjaxResult.success();
- boolean captchaEnabled = configService.selectCaptchaEnabled();
- ajax.put("captchaEnabled", captchaEnabled);
- if (!captchaEnabled)
- {
- return ajax;
- }
-
- // 保存验证码信息
- String uuid = IdUtils.simpleUUID();
- String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
-
- String capStr = null, code = null;
- BufferedImage image = null;
-
- // 生成验证码
- String captchaType = RuoYiConfig.getCaptchaType();
- if ("math".equals(captchaType))
- {
- String capText = captchaProducerMath.createText();
- capStr = capText.substring(0, capText.lastIndexOf("@"));
- code = capText.substring(capText.lastIndexOf("@") + 1);
- image = captchaProducerMath.createImage(capStr);
- }
- else if ("char".equals(captchaType))
- {
- capStr = code = captchaProducer.createText();
- image = captchaProducer.createImage(capStr);
- }
-
- redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
- // 转换流信息写出
- FastByteArrayOutputStream os = new FastByteArrayOutputStream();
- try
- {
- ImageIO.write(image, "jpg", os);
- }
- catch (IOException e)
- {
- return AjaxResult.error(e.getMessage());
- }
-
- ajax.put("uuid", uuid);
- ajax.put("img", Base64.encode(os.toByteArray()));
- return ajax;
- }
-}
+package com.tcctlo.web.controller.common;
+
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Resource;
+import javax.imageio.ImageIO;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.FastByteArrayOutputStream;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.google.code.kaptcha.Producer;
+import com.tcctlo.common.config.RuoYiConfig;
+import com.tcctlo.common.constant.CacheConstants;
+import com.tcctlo.common.constant.Constants;
+import com.tcctlo.common.core.domain.AjaxResult;
+import com.tcctlo.common.core.redis.RedisCache;
+import com.tcctlo.common.utils.sign.Base64;
+import com.tcctlo.common.utils.uuid.IdUtils;
+import com.tcctlo.system.service.ISysConfigService;
+
+/**
+ * 验证码操作处理
+ *
+ * @author ruoyi
+ */
+@RestController
+public class CaptchaController
+{
+ @Resource(name = "captchaProducer")
+ private Producer captchaProducer;
+
+ @Resource(name = "captchaProducerMath")
+ private Producer captchaProducerMath;
+
+ @Autowired
+ private RedisCache redisCache;
+
+ @Autowired
+ private ISysConfigService configService;
+ /**
+ * 生成验证码
+ */
+ @GetMapping("/captchaImage")
+ public AjaxResult getCode(HttpServletResponse response) throws IOException
+ {
+ AjaxResult ajax = AjaxResult.success();
+ boolean captchaEnabled = configService.selectCaptchaEnabled();
+ ajax.put("captchaEnabled", captchaEnabled);
+ if (!captchaEnabled)
+ {
+ return ajax;
+ }
+
+ // 保存验证码信息
+ String uuid = IdUtils.simpleUUID();
+ String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
+
+ String capStr = null, code = null;
+ BufferedImage image = null;
+
+ // 生成验证码
+ String captchaType = RuoYiConfig.getCaptchaType();
+ if ("math".equals(captchaType))
+ {
+ String capText = captchaProducerMath.createText();
+ capStr = capText.substring(0, capText.lastIndexOf("@"));
+ code = capText.substring(capText.lastIndexOf("@") + 1);
+ image = captchaProducerMath.createImage(capStr);
+ }
+ else if ("char".equals(captchaType))
+ {
+ capStr = code = captchaProducer.createText();
+ image = captchaProducer.createImage(capStr);
+ }
+
+ redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
+ // 转换流信息写出
+ FastByteArrayOutputStream os = new FastByteArrayOutputStream();
+ try
+ {
+ ImageIO.write(image, "jpg", os);
+ }
+ catch (IOException e)
+ {
+ return AjaxResult.error(e.getMessage());
+ }
+
+ ajax.put("uuid", uuid);
+ ajax.put("img", Base64.encode(os.toByteArray()));
+ return ajax;
+ }
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java b/tcctlo-admin/src/main/java/com/tcctlo/web/controller/common/CommonController.java
similarity index 78%
rename from ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
rename to tcctlo-admin/src/main/java/com/tcctlo/web/controller/common/CommonController.java
index d51d61d0..d47bcfab 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
+++ b/tcctlo-admin/src/main/java/com/tcctlo/web/controller/common/CommonController.java
@@ -1,163 +1,179 @@
-package com.ruoyi.web.controller.common;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
-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.RestController;
-import org.springframework.web.multipart.MultipartFile;
-import com.ruoyi.common.config.RuoYiConfig;
-import com.ruoyi.common.constant.Constants;
-import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.common.utils.file.FileUploadUtils;
-import com.ruoyi.common.utils.file.FileUtils;
-import com.ruoyi.framework.config.ServerConfig;
-
-/**
- * 通用请求处理
- *
- * @author ruoyi
- */
-@RestController
-@RequestMapping("/common")
-public class CommonController
-{
- private static final Logger log = LoggerFactory.getLogger(CommonController.class);
-
- @Autowired
- private ServerConfig serverConfig;
-
- private static final String FILE_DELIMETER = ",";
-
- /**
- * 通用下载请求
- *
- * @param fileName 文件名称
- * @param delete 是否删除
- */
- @GetMapping("/download")
- public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
- {
- try
- {
- if (!FileUtils.checkAllowDownload(fileName))
- {
- throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
- }
- String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
- String filePath = RuoYiConfig.getDownloadPath() + fileName;
-
- response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
- FileUtils.setAttachmentResponseHeader(response, realFileName);
- FileUtils.writeBytes(filePath, response.getOutputStream());
- if (delete)
- {
- FileUtils.deleteFile(filePath);
- }
- }
- catch (Exception e)
- {
- log.error("下载文件失败", e);
- }
- }
-
- /**
- * 通用上传请求(单个)
- */
- @PostMapping("/upload")
- public AjaxResult uploadFile(MultipartFile file) throws Exception
- {
- try
- {
- // 上传文件路径
- String filePath = RuoYiConfig.getUploadPath();
- // 上传并返回新文件名称
- String fileName = FileUploadUtils.upload(filePath, file);
- String url = serverConfig.getUrl() + fileName;
- AjaxResult ajax = AjaxResult.success();
- ajax.put("url", url);
- ajax.put("fileName", fileName);
- ajax.put("newFileName", FileUtils.getName(fileName));
- ajax.put("originalFilename", file.getOriginalFilename());
- return ajax;
- }
- catch (Exception e)
- {
- return AjaxResult.error(e.getMessage());
- }
- }
-
- /**
- * 通用上传请求(多个)
- */
- @PostMapping("/uploads")
- public AjaxResult uploadFiles(List files) throws Exception
- {
- try
- {
- // 上传文件路径
- String filePath = RuoYiConfig.getUploadPath();
- List urls = new ArrayList();
- List fileNames = new ArrayList();
- List newFileNames = new ArrayList();
- List originalFilenames = new ArrayList();
- for (MultipartFile file : files)
- {
- // 上传并返回新文件名称
- String fileName = FileUploadUtils.upload(filePath, file);
- String url = serverConfig.getUrl() + fileName;
- urls.add(url);
- fileNames.add(fileName);
- newFileNames.add(FileUtils.getName(fileName));
- originalFilenames.add(file.getOriginalFilename());
- }
- AjaxResult ajax = AjaxResult.success();
- ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
- ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
- ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
- ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
- return ajax;
- }
- catch (Exception e)
- {
- return AjaxResult.error(e.getMessage());
- }
- }
-
- /**
- * 本地资源通用下载
- */
- @GetMapping("/download/resource")
- public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
- throws Exception
- {
- try
- {
- if (!FileUtils.checkAllowDownload(resource))
- {
- throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
- }
- // 本地资源路径
- String localPath = RuoYiConfig.getProfile();
- // 数据库资源地址
- String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
- // 下载名称
- String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
- response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
- FileUtils.setAttachmentResponseHeader(response, downloadName);
- FileUtils.writeBytes(downloadPath, response.getOutputStream());
- }
- catch (Exception e)
- {
- log.error("下载文件失败", e);
- }
- }
-}
+package com.tcctlo.web.controller.common;
+
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.List;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.dromara.x.file.storage.core.FileInfo;
+import org.dromara.x.file.storage.core.FileStorageService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+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.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import com.tcctlo.common.config.RuoYiConfig;
+import com.tcctlo.common.constant.Constants;
+import com.tcctlo.common.core.domain.AjaxResult;
+import com.tcctlo.common.utils.StringUtils;
+import com.tcctlo.common.utils.file.FileUploadUtils;
+import com.tcctlo.common.utils.file.FileUtils;
+import com.tcctlo.framework.config.ServerConfig;
+
+/**
+ * 通用请求处理
+ *
+ * @author ruoyi
+ */
+@RestController
+@RequestMapping("/common")
+public class CommonController
+{
+ private static final Logger log = LoggerFactory.getLogger(CommonController.class);
+
+ @Autowired
+ private ServerConfig serverConfig;
+
+ @Autowired
+ private FileStorageService fileStorageService;//注入实列
+
+ private static final String FILE_DELIMETER = ",";
+
+ /**
+ * 通用下载请求
+ *
+ * @param fileName 文件名称
+ * @param delete 是否删除
+ */
+ @GetMapping("/download")
+ public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
+ {
+ try
+ {
+ if (!FileUtils.checkAllowDownload(fileName))
+ {
+ throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
+ }
+ String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
+ String filePath = RuoYiConfig.getDownloadPath() + fileName;
+
+ response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
+ FileUtils.setAttachmentResponseHeader(response, realFileName);
+ FileUtils.writeBytes(filePath, response.getOutputStream());
+ if (delete)
+ {
+ FileUtils.deleteFile(filePath);
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("下载文件失败", e);
+ }
+ }
+
+ /**
+ * 通用上传请求(单个)
+ */
+ @PostMapping("/upload")
+ public AjaxResult uploadFile(MultipartFile file) throws Exception
+ {
+ try
+ {
+ /*// 上传文件路径
+ String filePath = RuoYiConfig.getUploadPath();
+ // 上传并返回新文件名称
+ String fileName = FileUploadUtils.upload(filePath, file);
+ String url = serverConfig.getUrl() + fileName;*/
+
+ //指定OSS保存文件路径 格式:
+ String objectName = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd")) + "/";
+
+ //上传图片,返回文件信息
+ FileInfo fileInfo = fileStorageService.of(file)
+ .setPath(objectName) //保存到相对路径下,为了方便管理,不需要可以不写
+ .upload(); //将文件上传到对应地方
+ AjaxResult ajax = AjaxResult.success();
+ ajax.put("url", fileInfo.getUrl());
+ ajax.put("fileName", fileInfo.getUrl()); //此处的值需要改为url,因为前端的访问地址会做一个判断,如果以http开头就直接显示此图片
+ ajax.put("newFileName", FileUtils.getName(fileInfo.getUrl()));
+ ajax.put("originalFilename", file.getOriginalFilename());
+ return ajax;
+ }
+ catch (Exception e)
+ {
+ return AjaxResult.error(e.getMessage());
+ }
+ }
+
+ /**
+ * 通用上传请求(多个)
+ */
+ @PostMapping("/uploads")
+ public AjaxResult uploadFiles(List files) throws Exception
+ {
+ try
+ {
+ // 上传文件路径
+ String filePath = RuoYiConfig.getUploadPath();
+ List urls = new ArrayList();
+ List fileNames = new ArrayList();
+ List newFileNames = new ArrayList();
+ List originalFilenames = new ArrayList();
+ for (MultipartFile file : files)
+ {
+ // 上传并返回新文件名称
+ String fileName = FileUploadUtils.upload(filePath, file);
+ String url = serverConfig.getUrl() + fileName;
+ urls.add(url);
+ fileNames.add(fileName);
+ newFileNames.add(FileUtils.getName(fileName));
+ originalFilenames.add(file.getOriginalFilename());
+ }
+ AjaxResult ajax = AjaxResult.success();
+ ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
+ ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
+ ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
+ ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
+ return ajax;
+ }
+ catch (Exception e)
+ {
+ return AjaxResult.error(e.getMessage());
+ }
+ }
+
+ /**
+ * 本地资源通用下载
+ */
+ @GetMapping("/download/resource")
+ public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
+ throws Exception
+ {
+ try
+ {
+ if (!FileUtils.checkAllowDownload(resource))
+ {
+ throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
+ }
+ // 本地资源路径
+ String localPath = RuoYiConfig.getProfile();
+ // 数据库资源地址
+ String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX);
+ // 下载名称
+ String downloadName = StringUtils.substringAfterLast(downloadPath, "/");
+ response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
+ FileUtils.setAttachmentResponseHeader(response, downloadName);
+ FileUtils.writeBytes(downloadPath, response.getOutputStream());
+ }
+ catch (Exception e)
+ {
+ log.error("下载文件失败", e);
+ }
+ }
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java b/tcctlo-admin/src/main/java/com/tcctlo/web/controller/monitor/CacheController.java
similarity index 92%
rename from ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java
rename to tcctlo-admin/src/main/java/com/tcctlo/web/controller/monitor/CacheController.java
index 504c0fde..220fba07 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/CacheController.java
+++ b/tcctlo-admin/src/main/java/com/tcctlo/web/controller/monitor/CacheController.java
@@ -1,121 +1,121 @@
-package com.ruoyi.web.controller.monitor;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.TreeSet;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisCallback;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.ruoyi.common.constant.CacheConstants;
-import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.system.domain.SysCache;
-
-/**
- * 缓存监控
- *
- * @author ruoyi
- */
-@RestController
-@RequestMapping("/monitor/cache")
-public class CacheController
-{
- @Autowired
- private RedisTemplate redisTemplate;
-
- private final static List caches = new ArrayList();
- {
- caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "用户信息"));
- caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "配置信息"));
- caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "数据字典"));
- caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "验证码"));
- caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "防重提交"));
- caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "限流处理"));
- caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "密码错误次数"));
- }
-
- @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
- @GetMapping()
- public AjaxResult getInfo() throws Exception
- {
- Properties info = (Properties) redisTemplate.execute((RedisCallback