diff --git a/ruoyi/.gitignore b/.gitignore
similarity index 100%
rename from ruoyi/.gitignore
rename to .gitignore
diff --git a/ruoyi/bin/clean.bat b/bin/clean.bat
similarity index 100%
rename from ruoyi/bin/clean.bat
rename to bin/clean.bat
diff --git a/ruoyi/bin/package.bat b/bin/package.bat
similarity index 100%
rename from ruoyi/bin/package.bat
rename to bin/package.bat
diff --git a/bin/run.bat b/bin/run.bat
new file mode 100644
index 0000000..e5fb6a6
--- /dev/null
+++ b/bin/run.bat
@@ -0,0 +1,14 @@
+@echo off
+echo.
+echo [信息] 运行Web工程。
+echo.
+
+cd %~dp0
+cd ../ruoyi-admin/target
+
+set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
+
+java -jar %JAVA_OPTS% ruoyi-admin.jar
+
+cd bin
+pause
\ No newline at end of file
diff --git a/doc/鑻ヤ緷鐜浣跨敤鎵嬪唽.docx b/doc/鑻ヤ緷鐜浣跨敤鎵嬪唽.docx
new file mode 100644
index 0000000..9e4daef
Binary files /dev/null and b/doc/鑻ヤ緷鐜浣跨敤鎵嬪唽.docx differ
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..cb9ecfb
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,234 @@
+
+
+ 4.0.0
+
+ com.ruoyi
+ ruoyi
+ 3.0.0
+
+ ruoyi
+ http://www.ruoyi.vip
+ 鑻ヤ緷绠$悊绯荤粺
+
+
+ 3.0.0
+ UTF-8
+ UTF-8
+ 1.8
+ 1.3.2
+ 1.1.14
+ 1.19
+ 2.9.2
+ 1.2.5
+ 1.2.70
+ 3.9.1
+ 2.5
+ 1.3.3
+ 3.17
+ 1.7
+ 0.9.0
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-dependencies
+ 2.1.1.RELEASE
+ pom
+ import
+
+
+
+
+ com.alibaba
+ druid-spring-boot-starter
+ ${druid.version}
+
+
+
+
+ eu.bitwalker
+ UserAgentUtils
+ ${bitwalker.version}
+
+
+
+
+ com.github.pagehelper
+ pagehelper-spring-boot-starter
+ ${pagehelper.boot.version}
+
+
+
+
+ com.github.oshi
+ oshi-core
+ ${oshi.version}
+
+
+
+
+ io.springfox
+ springfox-swagger2
+ ${swagger.version}
+
+
+ io.swagger
+ swagger-annotations
+
+
+ io.swagger
+ swagger-models
+
+
+
+
+
+
+ io.springfox
+ springfox-swagger-ui
+ ${swagger.version}
+
+
+
+
+ commons-io
+ commons-io
+ ${commons.io.version}
+
+
+
+
+ commons-fileupload
+ commons-fileupload
+ ${commons.fileupload.version}
+
+
+
+
+ org.apache.poi
+ poi-ooxml
+ ${poi.version}
+
+
+
+
+ org.apache.velocity
+ velocity
+ ${velocity.version}
+
+
+
+
+ com.alibaba
+ fastjson
+ ${fastjson.version}
+
+
+
+
+ io.jsonwebtoken
+ jjwt
+ ${jwt.version}
+
+
+
+
+ com.ruoyi
+ ruoyi-quartz
+ ${ruoyi.version}
+
+
+
+
+ com.ruoyi
+ ruoyi-generator
+ ${ruoyi.version}
+
+
+
+
+ com.ruoyi
+ ruoyi-framework
+ ${ruoyi.version}
+
+
+
+
+ com.ruoyi
+ ruoyi-system
+ ${ruoyi.version}
+
+
+
+
+ com.ruoyi
+ ruoyi-common
+ ${ruoyi.version}
+
+
+
+
+
+
+ ruoyi-admin
+ ruoyi-framework
+ ruoyi-system
+ ruoyi-quartz
+ ruoyi-generator
+ ruoyi-common
+
+ pom
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.1
+
+
+ ${java.version}
+ ${project.build.sourceEncoding}
+
+
+
+
+
+
+
+ public
+ aliyun nexus
+ http://maven.aliyun.com/nexus/content/groups/public/
+
+ true
+
+
+
+
+
+
+ public
+ aliyun nexus
+ http://maven.aliyun.com/nexus/content/groups/public/
+
+ true
+
+
+ false
+
+
+
+
+
\ No newline at end of file
diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml
new file mode 100644
index 0000000..1ed741f
--- /dev/null
+++ b/ruoyi-admin/pom.xml
@@ -0,0 +1,108 @@
+
+
+
+ ruoyi
+ com.ruoyi
+ 3.0.0
+
+ 4.0.0
+ jar
+ ruoyi-admin
+
+
+ web鏈嶅姟鍏ュ彛
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-devtools
+ true
+
+
+
+
+ io.springfox
+ springfox-swagger2
+
+
+
+
+ io.swagger
+ swagger-annotations
+ 1.5.21
+
+
+
+ io.swagger
+ swagger-models
+ 1.5.21
+
+
+
+
+ io.springfox
+ springfox-swagger-ui
+
+
+
+
+ mysql
+ mysql-connector-java
+
+
+
+
+ com.ruoyi
+ ruoyi-framework
+
+
+
+
+ com.ruoyi
+ ruoyi-quartz
+
+
+
+
+ com.ruoyi
+ ruoyi-generator
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ 2.1.1.RELEASE
+
+ true
+
+
+
+
+ repackage
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+ 3.0.0
+
+ false
+ ${project.artifactId}
+
+
+
+ ${project.artifactId}
+
+
+
\ No newline at end of file
diff --git a/ruoyi/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/RuoYiApplication.java
rename to ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
diff --git a/ruoyi/src/main/java/com/ruoyi/RuoYiServletInitializer.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/RuoYiServletInitializer.java
rename to ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java
diff --git a/ruoyi/src/main/java/com/ruoyi/project/common/CaptchaController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java
similarity index 87%
rename from ruoyi/src/main/java/com/ruoyi/project/common/CaptchaController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java
index 9a3af20..a4ee00f 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/common/CaptchaController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.common;
+package com.ruoyi.web.controller.common;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -8,11 +8,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.constant.Constants;
-import com.ruoyi.common.utils.IdUtils;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.VerifyCodeUtils;
import com.ruoyi.common.utils.sign.Base64;
-import com.ruoyi.framework.redis.RedisCache;
-import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.common.utils.uuid.IdUtils;
/**
* 楠岃瘉鐮佹搷浣滃鐞
diff --git a/ruoyi/src/main/java/com/ruoyi/project/common/CommonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
similarity index 93%
rename from ruoyi/src/main/java/com/ruoyi/project/common/CommonController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
index b59fb29..9cba04d 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/common/CommonController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.common;
+package com.ruoyi.web.controller.common;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -9,13 +9,13 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
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.RuoYiConfig;
import com.ruoyi.framework.config.ServerConfig;
-import com.ruoyi.framework.web.domain.AjaxResult;
/**
* 閫氱敤璇锋眰澶勭悊
diff --git a/ruoyi/src/main/java/com/ruoyi/project/monitor/controller/ServerController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java
similarity index 79%
rename from ruoyi/src/main/java/com/ruoyi/project/monitor/controller/ServerController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java
index a692226..2f0c86e 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/monitor/controller/ServerController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/ServerController.java
@@ -1,11 +1,11 @@
-package com.ruoyi.project.monitor.controller;
+package com.ruoyi.web.controller.monitor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.framework.web.domain.Server;
/**
diff --git a/ruoyi/src/main/java/com/ruoyi/project/monitor/controller/SysLogininforController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java
similarity index 80%
rename from ruoyi/src/main/java/com/ruoyi/project/monitor/controller/SysLogininforController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java
index ecda076..560c4b5 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/monitor/controller/SysLogininforController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysLogininforController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.monitor.controller;
+package com.ruoyi.web.controller.monitor;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@@ -8,14 +8,14 @@ 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.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.page.TableDataInfo;
-import com.ruoyi.project.monitor.domain.SysLogininfor;
-import com.ruoyi.project.monitor.service.ISysLogininforService;
+import com.ruoyi.system.domain.SysLogininfor;
+import com.ruoyi.system.service.ISysLogininforService;
/**
* 绯荤粺璁块棶璁板綍
diff --git a/ruoyi/src/main/java/com/ruoyi/project/monitor/controller/SysOperlogController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java
similarity index 79%
rename from ruoyi/src/main/java/com/ruoyi/project/monitor/controller/SysOperlogController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java
index d0d5c34..1942856 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/monitor/controller/SysOperlogController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysOperlogController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.monitor.controller;
+package com.ruoyi.web.controller.monitor;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@@ -8,14 +8,14 @@ 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.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.page.TableDataInfo;
-import com.ruoyi.project.monitor.domain.SysOperLog;
-import com.ruoyi.project.monitor.service.ISysOperLogService;
+import com.ruoyi.system.domain.SysOperLog;
+import com.ruoyi.system.service.ISysOperLogService;
/**
* 鎿嶄綔鏃ュ織璁板綍
diff --git a/ruoyi/src/main/java/com/ruoyi/project/monitor/controller/SysUserOnlineController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java
similarity index 82%
rename from ruoyi/src/main/java/com/ruoyi/project/monitor/controller/SysUserOnlineController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java
index 5a73019..7f73813 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/monitor/controller/SysUserOnlineController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitor/SysUserOnlineController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.monitor.controller;
+package com.ruoyi.web.controller.monitor;
import java.util.ArrayList;
import java.util.Collection;
@@ -11,17 +11,17 @@ 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.annotation.Log;
import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.redis.RedisCache;
-import com.ruoyi.framework.security.LoginUser;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.page.TableDataInfo;
-import com.ruoyi.project.monitor.domain.SysUserOnline;
-import com.ruoyi.project.system.service.ISysUserOnlineService;
+import com.ruoyi.system.domain.SysUserOnline;
+import com.ruoyi.system.service.ISysUserOnlineService;
/**
* 鍦ㄧ嚎鐢ㄦ埛鐩戞帶
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
similarity index 88%
rename from ruoyi/src/main/java/com/ruoyi/project/system/controller/SysConfigController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
index 9a832cb..41b8209 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysConfigController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.system.controller;
+package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@@ -12,16 +12,17 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.page.TableDataInfo;
-import com.ruoyi.project.system.domain.SysConfig;
-import com.ruoyi.project.system.service.ISysConfigService;
+import com.ruoyi.system.domain.SysConfig;
+import com.ruoyi.system.service.ISysConfigService;
/**
* 鍙傛暟閰嶇疆 淇℃伅鎿嶄綔澶勭悊
@@ -82,6 +83,7 @@ public class SysConfigController extends BaseController
@PreAuthorize("@ss.hasPermi('system:config:add')")
@Log(title = "鍙傛暟绠$悊", businessType = BusinessType.INSERT)
@PostMapping
+ @RepeatSubmit
public AjaxResult add(@Validated @RequestBody SysConfig config)
{
if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDeptController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
similarity index 90%
rename from ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDeptController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
index e549a43..60bd1a5 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDeptController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.system.controller;
+package com.ruoyi.web.controller.system;
import java.util.Iterator;
import java.util.List;
@@ -14,15 +14,15 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysDept;
+import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.project.system.domain.SysDept;
-import com.ruoyi.project.system.service.ISysDeptService;
+import com.ruoyi.system.service.ISysDeptService;
/**
* 閮ㄩ棬淇℃伅
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDictDataController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java
similarity index 85%
rename from ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDictDataController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java
index 8b3b394..58cf43d 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDictDataController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.system.controller;
+package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@@ -12,16 +12,16 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysDictData;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.page.TableDataInfo;
-import com.ruoyi.project.system.domain.SysDictData;
-import com.ruoyi.project.system.service.ISysDictDataService;
-import com.ruoyi.project.system.service.ISysDictTypeService;
+import com.ruoyi.system.service.ISysDictDataService;
+import com.ruoyi.system.service.ISysDictTypeService;
/**
* 鏁版嵁瀛楀吀淇℃伅
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java
similarity index 88%
rename from ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java
index 816d543..efde2d4 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDictTypeController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.system.controller;
+package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@@ -12,16 +12,16 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysDictType;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.page.TableDataInfo;
-import com.ruoyi.project.system.domain.SysDictType;
-import com.ruoyi.project.system.service.ISysDictTypeService;
+import com.ruoyi.system.service.ISysDictTypeService;
/**
* 鏁版嵁瀛楀吀淇℃伅
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
similarity index 79%
rename from ruoyi/src/main/java/com/ruoyi/project/system/controller/SysLoginController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
index 73aaa71..4ade9f6 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysLoginController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.system.controller;
+package com.ruoyi.web.controller.system;
import java.util.List;
import java.util.Set;
@@ -8,16 +8,16 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysMenu;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.domain.model.LoginBody;
+import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.ServletUtils;
-import com.ruoyi.framework.security.LoginBody;
-import com.ruoyi.framework.security.LoginUser;
-import com.ruoyi.framework.security.service.SysLoginService;
-import com.ruoyi.framework.security.service.SysPermissionService;
-import com.ruoyi.framework.security.service.TokenService;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.project.system.domain.SysMenu;
-import com.ruoyi.project.system.domain.SysUser;
-import com.ruoyi.project.system.service.ISysMenuService;
+import com.ruoyi.framework.web.service.SysLoginService;
+import com.ruoyi.framework.web.service.SysPermissionService;
+import com.ruoyi.framework.web.service.TokenService;
+import com.ruoyi.system.service.ISysMenuService;
/**
* 鐧诲綍楠岃瘉
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysMenuController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java
similarity index 89%
rename from ruoyi/src/main/java/com/ruoyi/project/system/controller/SysMenuController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java
index a958f62..8bdfe91 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysMenuController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.system.controller;
+package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@@ -12,19 +12,19 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysMenu;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.security.LoginUser;
-import com.ruoyi.framework.security.service.TokenService;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.project.system.domain.SysMenu;
-import com.ruoyi.project.system.service.ISysMenuService;
+import com.ruoyi.framework.web.service.TokenService;
+import com.ruoyi.system.service.ISysMenuService;
/**
* 鑿滃崟淇℃伅
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysNoticeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java
similarity index 83%
rename from ruoyi/src/main/java/com/ruoyi/project/system/controller/SysNoticeController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java
index 9f00392..029ee38 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysNoticeController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.system.controller;
+package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@@ -12,14 +12,14 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.page.TableDataInfo;
-import com.ruoyi.project.system.domain.SysNotice;
-import com.ruoyi.project.system.service.ISysNoticeService;
+import com.ruoyi.system.domain.SysNotice;
+import com.ruoyi.system.service.ISysNoticeService;
/**
* 鍏憡 淇℃伅鎿嶄綔澶勭悊
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysPostController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java
similarity index 88%
rename from ruoyi/src/main/java/com/ruoyi/project/system/controller/SysPostController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java
index 0c30ef7..67d76ee 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysPostController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.system.controller;
+package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@@ -12,16 +12,16 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.page.TableDataInfo;
-import com.ruoyi.project.system.domain.SysPost;
-import com.ruoyi.project.system.service.ISysPostService;
+import com.ruoyi.system.domain.SysPost;
+import com.ruoyi.system.service.ISysPostService;
/**
* 宀椾綅淇℃伅鎿嶄綔澶勭悊
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysProfileController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
similarity index 87%
rename from ruoyi/src/main/java/com/ruoyi/project/system/controller/SysProfileController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
index 8b0b38e..bfedddf 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysProfileController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysProfileController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.system.controller;
+package com.ruoyi.web.controller.system;
import java.io.IOException;
import org.springframework.beans.factory.annotation.Autowired;
@@ -10,18 +10,18 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.config.RuoYiConfig;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.config.RuoYiConfig;
-import com.ruoyi.framework.security.LoginUser;
-import com.ruoyi.framework.security.service.TokenService;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.project.system.domain.SysUser;
-import com.ruoyi.project.system.service.ISysUserService;
+import com.ruoyi.framework.web.service.TokenService;
+import com.ruoyi.system.service.ISysUserService;
/**
* 涓汉淇℃伅 涓氬姟澶勭悊
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysRoleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
similarity index 89%
rename from ruoyi/src/main/java/com/ruoyi/project/system/controller/SysRoleController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
index 62ab858..927a6c2 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysRoleController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.system.controller;
+package com.ruoyi.web.controller.system;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@@ -12,16 +12,16 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysRole;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.page.TableDataInfo;
-import com.ruoyi.project.system.domain.SysRole;
-import com.ruoyi.project.system.service.ISysRoleService;
+import com.ruoyi.system.service.ISysRoleService;
/**
* 瑙掕壊淇℃伅
@@ -151,4 +151,4 @@ public class SysRoleController extends BaseController
{
return AjaxResult.success(roleService.selectRoleAll());
}
-}
\ No newline at end of file
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
similarity index 88%
rename from ruoyi/src/main/java/com/ruoyi/project/system/controller/SysUserController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
index 5c68570..946df4d 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysUserController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.system.controller;
+package com.ruoyi.web.controller.system;
import java.util.List;
import java.util.stream.Collectors;
@@ -14,23 +14,23 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
+import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysRole;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.security.LoginUser;
-import com.ruoyi.framework.security.service.TokenService;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.page.TableDataInfo;
-import com.ruoyi.project.system.domain.SysRole;
-import com.ruoyi.project.system.domain.SysUser;
-import com.ruoyi.project.system.service.ISysPostService;
-import com.ruoyi.project.system.service.ISysRoleService;
-import com.ruoyi.project.system.service.ISysUserService;
+import com.ruoyi.framework.web.service.TokenService;
+import com.ruoyi.system.service.ISysPostService;
+import com.ruoyi.system.service.ISysRoleService;
+import com.ruoyi.system.service.ISysUserService;
/**
* 鐢ㄦ埛淇℃伅
@@ -198,4 +198,4 @@ public class SysUserController extends BaseController
user.setUpdateBy(SecurityUtils.getUsername());
return toAjax(userService.updateUserStatus(user));
}
-}
\ No newline at end of file
+}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java
new file mode 100644
index 0000000..e901fed
--- /dev/null
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java
@@ -0,0 +1,24 @@
+package com.ruoyi.web.controller.tool;
+
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import com.ruoyi.common.core.controller.BaseController;
+
+/**
+ * swagger 鎺ュ彛
+ *
+ * @author ruoyi
+ */
+@Controller
+@RequestMapping("/tool/swagger")
+public class SwaggerController extends BaseController
+{
+ @PreAuthorize("@ss.hasPermi('tool:swagger:view')")
+ @GetMapping()
+ public String index()
+ {
+ return redirect("/swagger-ui.html");
+ }
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/tool/swagger/TestController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java
similarity index 93%
rename from ruoyi/src/main/java/com/ruoyi/project/tool/swagger/TestController.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java
index 17f4c31..2ae0c54 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/tool/swagger/TestController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.tool.swagger;
+package com.ruoyi.web.controller.tool;
import java.util.ArrayList;
import java.util.LinkedHashMap;
@@ -11,9 +11,9 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiModel;
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java b/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java
similarity index 95%
rename from ruoyi/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java
rename to ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java
index 9692685..86acc3f 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java
@@ -1,4 +1,4 @@
-package com.ruoyi.framework.config;
+package com.ruoyi.web.core.config;
import java.util.ArrayList;
import java.util.List;
@@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import com.ruoyi.common.config.RuoYiConfig;
import io.swagger.annotations.ApiOperation;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
diff --git a/ruoyi/src/main/resources/META-INF/spring-devtools.properties b/ruoyi-admin/src/main/resources/META-INF/spring-devtools.properties
similarity index 100%
rename from ruoyi/src/main/resources/META-INF/spring-devtools.properties
rename to ruoyi-admin/src/main/resources/META-INF/spring-devtools.properties
diff --git a/ruoyi/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml
similarity index 100%
rename from ruoyi/src/main/resources/application-druid.yml
rename to ruoyi-admin/src/main/resources/application-druid.yml
diff --git a/ruoyi/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml
similarity index 80%
rename from ruoyi/src/main/resources/application.yml
rename to ruoyi-admin/src/main/resources/application.yml
index cf23b8e..c87725a 100644
--- a/ruoyi/src/main/resources/application.yml
+++ b/ruoyi-admin/src/main/resources/application.yml
@@ -3,7 +3,7 @@ ruoyi:
# 鍚嶇О
name: RuoYi
# 鐗堟湰
- version: 2.3.0
+ version: 3.0.0
# 鐗堟潈骞翠唤
copyrightYear: 2019
# 瀹炰緥婕旂ず寮鍏
@@ -87,9 +87,9 @@ token:
# MyBatis閰嶇疆
mybatis:
# 鎼滅储鎸囧畾鍖呭埆鍚
- typeAliasesPackage: com.ruoyi.project.**.domain
+ typeAliasesPackage: com.ruoyi.**.domain
# 閰嶇疆mapper鐨勬壂鎻忥紝鎵惧埌鎵鏈夌殑mapper.xml鏄犲皠鏂囦欢
- mapperLocations: classpath*:mybatis/**/*Mapper.xml
+ mapperLocations: classpath*:mapper/**/*Mapper.xml
# 鍔犺浇鍏ㄥ眬鐨勯厤缃枃浠
configLocation: classpath:mybatis/mybatis-config.xml
@@ -115,14 +115,3 @@ xss:
excludes: /system/notice/*
# 鍖归厤閾炬帴
urlPatterns: /system/*,/monitor/*,/tool/*
-
-# 浠g爜鐢熸垚
-gen:
- # 浣滆
- author: ruoyi
- # 榛樿鐢熸垚鍖呰矾寰 system 闇鏀规垚鑷繁鐨勬ā鍧楀悕绉 濡 system monitor tool
- packageName: com.ruoyi.project.system
- # 鑷姩鍘婚櫎琛ㄥ墠缂锛岄粯璁ゆ槸true
- autoRemovePre: false
- # 琛ㄥ墠缂锛堢敓鎴愮被鍚嶄笉浼氬寘鍚〃鍓嶇紑锛屽涓敤閫楀彿鍒嗛殧锛
- tablePrefix: sys_
\ No newline at end of file
diff --git a/ruoyi/src/main/resources/banner.txt b/ruoyi-admin/src/main/resources/banner.txt
similarity index 100%
rename from ruoyi/src/main/resources/banner.txt
rename to ruoyi-admin/src/main/resources/banner.txt
diff --git a/ruoyi/src/main/resources/i18n/messages.properties b/ruoyi-admin/src/main/resources/i18n/messages.properties
similarity index 100%
rename from ruoyi/src/main/resources/i18n/messages.properties
rename to ruoyi-admin/src/main/resources/i18n/messages.properties
diff --git a/ruoyi/src/main/resources/logback.xml b/ruoyi-admin/src/main/resources/logback.xml
similarity index 100%
rename from ruoyi/src/main/resources/logback.xml
rename to ruoyi-admin/src/main/resources/logback.xml
diff --git a/ruoyi/src/main/resources/mybatis/mybatis-config.xml b/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml
similarity index 100%
rename from ruoyi/src/main/resources/mybatis/mybatis-config.xml
rename to ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml
diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml
new file mode 100644
index 0000000..e4c677a
--- /dev/null
+++ b/ruoyi-common/pom.xml
@@ -0,0 +1,124 @@
+
+
+
+ ruoyi
+ com.ruoyi
+ 3.0.0
+
+ 4.0.0
+
+ ruoyi-common
+
+
+ common閫氱敤宸ュ叿
+
+
+
+
+
+
+ org.springframework
+ spring-context-support
+
+
+
+
+ org.springframework
+ spring-web
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-security
+
+
+
+
+ com.github.pagehelper
+ pagehelper-spring-boot-starter
+
+
+
+
+ javax.validation
+ validation-api
+
+
+
+
+ org.apache.commons
+ commons-lang3
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+
+
+ com.alibaba
+ fastjson
+
+
+
+
+ commons-io
+ commons-io
+
+
+
+
+ commons-fileupload
+ commons-fileupload
+
+
+
+
+ org.apache.poi
+ poi-ooxml
+
+
+
+
+ org.yaml
+ snakeyaml
+
+
+
+
+ io.jsonwebtoken
+ jjwt
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-data-redis
+
+
+
+
+ org.apache.commons
+ commons-pool2
+
+
+
+
+ eu.bitwalker
+ UserAgentUtils
+
+
+
+
+ javax.servlet
+ javax.servlet-api
+
+
+
+
+
\ No newline at end of file
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/DataScope.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java
similarity index 86%
rename from ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/DataScope.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java
index 5e4cc9c..fe5a01f 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/DataScope.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java
@@ -1,4 +1,4 @@
-package com.ruoyi.framework.aspectj.lang.annotation;
+package com.ruoyi.common.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/DataSource.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java
similarity index 82%
rename from ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/DataSource.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java
index 15a1d82..6b41ee7 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/DataSource.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java
@@ -1,4 +1,4 @@
-package com.ruoyi.framework.aspectj.lang.annotation;
+package com.ruoyi.common.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
@@ -6,7 +6,7 @@ import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
+import com.ruoyi.common.enums.DataSourceType;
/**
* 鑷畾涔夊鏁版嵁婧愬垏鎹㈡敞瑙
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excel.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java
similarity index 93%
rename from ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excel.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java
index de25b1c..3519791 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excel.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java
@@ -1,118 +1,118 @@
-package com.ruoyi.framework.aspectj.lang.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * 鑷畾涔夊鍑篍xcel鏁版嵁娉ㄨВ
- *
- * @author ruoyi
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.FIELD)
-public @interface Excel
-{
- /**
- * 瀵煎嚭鏃跺湪excel涓帓搴
- */
- public int sort() default Integer.MAX_VALUE;
-
- /**
- * 瀵煎嚭鍒癊xcel涓殑鍚嶅瓧.
- */
- public String name() default "";
-
- /**
- * 鏃ユ湡鏍煎紡, 濡: yyyy-MM-dd
- */
- public String dateFormat() default "";
-
- /**
- * 璇诲彇鍐呭杞〃杈惧紡 (濡: 0=鐢,1=濂,2=鏈煡)
- */
- public String readConverterExp() default "";
-
- /**
- * 瀵煎嚭绫诲瀷锛0鏁板瓧 1瀛楃涓诧級
- */
- public ColumnType cellType() default ColumnType.STRING;
-
- /**
- * 瀵煎嚭鏃跺湪excel涓瘡涓垪鐨勯珮搴 鍗曚綅涓哄瓧绗
- */
- public double height() default 14;
-
- /**
- * 瀵煎嚭鏃跺湪excel涓瘡涓垪鐨勫 鍗曚綅涓哄瓧绗
- */
- public double width() default 16;
-
- /**
- * 鏂囧瓧鍚庣紑,濡% 90 鍙樻垚90%
- */
- public String suffix() default "";
-
- /**
- * 褰撳间负绌烘椂,瀛楁鐨勯粯璁ゅ
- */
- public String defaultValue() default "";
-
- /**
- * 鎻愮ず淇℃伅
- */
- public String prompt() default "";
-
- /**
- * 璁剧疆鍙兘閫夋嫨涓嶈兘杈撳叆鐨勫垪鍐呭.
- */
- public String[] combo() default {};
-
- /**
- * 鏄惁瀵煎嚭鏁版嵁,搴斿闇姹:鏈夋椂鎴戜滑闇瑕佸鍑轰竴浠芥ā鏉,杩欐槸鏍囬闇瑕佷絾鍐呭闇瑕佺敤鎴锋墜宸ュ~鍐.
- */
- public boolean isExport() default true;
-
- /**
- * 鍙︿竴涓被涓殑灞炴у悕绉,鏀寔澶氱骇鑾峰彇,浠ュ皬鏁扮偣闅斿紑
- */
- public String targetAttr() default "";
-
- /**
- * 瀛楁绫诲瀷锛0锛氬鍑哄鍏ワ紱1锛氫粎瀵煎嚭锛2锛氫粎瀵煎叆锛
- */
- Type type() default Type.ALL;
-
- public enum Type
- {
- ALL(0), EXPORT(1), IMPORT(2);
- private final int value;
-
- Type(int value)
- {
- this.value = value;
- }
-
- public int value()
- {
- return this.value;
- }
- }
-
- public enum ColumnType
- {
- NUMERIC(0), STRING(1);
- private final int value;
-
- ColumnType(int value)
- {
- this.value = value;
- }
-
- public int value()
- {
- return this.value;
- }
- }
-}
\ No newline at end of file
+package com.ruoyi.common.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 鑷畾涔夊鍑篍xcel鏁版嵁娉ㄨВ
+ *
+ * @author ruoyi
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.FIELD)
+public @interface Excel
+{
+ /**
+ * 瀵煎嚭鏃跺湪excel涓帓搴
+ */
+ public int sort() default Integer.MAX_VALUE;
+
+ /**
+ * 瀵煎嚭鍒癊xcel涓殑鍚嶅瓧.
+ */
+ public String name() default "";
+
+ /**
+ * 鏃ユ湡鏍煎紡, 濡: yyyy-MM-dd
+ */
+ public String dateFormat() default "";
+
+ /**
+ * 璇诲彇鍐呭杞〃杈惧紡 (濡: 0=鐢,1=濂,2=鏈煡)
+ */
+ public String readConverterExp() default "";
+
+ /**
+ * 瀵煎嚭绫诲瀷锛0鏁板瓧 1瀛楃涓诧級
+ */
+ public ColumnType cellType() default ColumnType.STRING;
+
+ /**
+ * 瀵煎嚭鏃跺湪excel涓瘡涓垪鐨勯珮搴 鍗曚綅涓哄瓧绗
+ */
+ public double height() default 14;
+
+ /**
+ * 瀵煎嚭鏃跺湪excel涓瘡涓垪鐨勫 鍗曚綅涓哄瓧绗
+ */
+ public double width() default 16;
+
+ /**
+ * 鏂囧瓧鍚庣紑,濡% 90 鍙樻垚90%
+ */
+ public String suffix() default "";
+
+ /**
+ * 褰撳间负绌烘椂,瀛楁鐨勯粯璁ゅ
+ */
+ public String defaultValue() default "";
+
+ /**
+ * 鎻愮ず淇℃伅
+ */
+ public String prompt() default "";
+
+ /**
+ * 璁剧疆鍙兘閫夋嫨涓嶈兘杈撳叆鐨勫垪鍐呭.
+ */
+ public String[] combo() default {};
+
+ /**
+ * 鏄惁瀵煎嚭鏁版嵁,搴斿闇姹:鏈夋椂鎴戜滑闇瑕佸鍑轰竴浠芥ā鏉,杩欐槸鏍囬闇瑕佷絾鍐呭闇瑕佺敤鎴锋墜宸ュ~鍐.
+ */
+ public boolean isExport() default true;
+
+ /**
+ * 鍙︿竴涓被涓殑灞炴у悕绉,鏀寔澶氱骇鑾峰彇,浠ュ皬鏁扮偣闅斿紑
+ */
+ public String targetAttr() default "";
+
+ /**
+ * 瀛楁绫诲瀷锛0锛氬鍑哄鍏ワ紱1锛氫粎瀵煎嚭锛2锛氫粎瀵煎叆锛
+ */
+ Type type() default Type.ALL;
+
+ public enum Type
+ {
+ ALL(0), EXPORT(1), IMPORT(2);
+ private final int value;
+
+ Type(int value)
+ {
+ this.value = value;
+ }
+
+ public int value()
+ {
+ return this.value;
+ }
+ }
+
+ public enum ColumnType
+ {
+ NUMERIC(0), STRING(1);
+ private final int value;
+
+ ColumnType(int value)
+ {
+ this.value = value;
+ }
+
+ public int value()
+ {
+ return this.value;
+ }
+ }
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excels.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excels.java
similarity index 84%
rename from ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excels.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excels.java
index ff22802..940763f 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Excels.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excels.java
@@ -1,18 +1,18 @@
-package com.ruoyi.framework.aspectj.lang.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Excel娉ㄨВ闆
- *
- * @author ruoyi
- */
-@Target(ElementType.FIELD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Excels
-{
- Excel[] value();
-}
\ No newline at end of file
+package com.ruoyi.common.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Excel娉ㄨВ闆
+ *
+ * @author ruoyi
+ */
+@Target(ElementType.FIELD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Excels
+{
+ Excel[] value();
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Log.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java
similarity index 78%
rename from ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Log.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java
index 548eace..3458c88 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Log.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java
@@ -1,12 +1,12 @@
-package com.ruoyi.framework.aspectj.lang.annotation;
+package com.ruoyi.common.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.framework.aspectj.lang.enums.OperatorType;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.enums.OperatorType;
/**
* 鑷畾涔夋搷浣滄棩蹇楄褰曟敞瑙
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/interceptor/annotation/RepeatSubmit.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java
similarity index 87%
rename from ruoyi/src/main/java/com/ruoyi/framework/interceptor/annotation/RepeatSubmit.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java
index 0fbd73b..628eef1 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/interceptor/annotation/RepeatSubmit.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java
@@ -1,23 +1,23 @@
-package com.ruoyi.framework.interceptor.annotation;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * 鑷畾涔夋敞瑙i槻姝㈣〃鍗曢噸澶嶆彁浜
- *
- * @author ruoyi
- *
- */
-@Inherited
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface RepeatSubmit
-{
-
-}
\ No newline at end of file
+package com.ruoyi.common.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 鑷畾涔夋敞瑙i槻姝㈣〃鍗曢噸澶嶆彁浜
+ *
+ * @author ruoyi
+ *
+ */
+@Inherited
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface RepeatSubmit
+{
+
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/config/RuoYiConfig.java b/ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java
similarity index 93%
rename from ruoyi/src/main/java/com/ruoyi/framework/config/RuoYiConfig.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java
index 1f6e20a..c64ce71 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/config/RuoYiConfig.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java
@@ -1,4 +1,4 @@
-package com.ruoyi.framework.config;
+package com.ruoyi.common.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@@ -113,4 +113,4 @@ public class RuoYiConfig
{
return getProfile() + "/upload";
}
-}
\ No newline at end of file
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/common/constant/Constants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
similarity index 91%
rename from ruoyi/src/main/java/com/ruoyi/common/constant/Constants.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
index fe8afc0..9ee2707 100644
--- a/ruoyi/src/main/java/com/ruoyi/common/constant/Constants.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
@@ -1,7 +1,5 @@
package com.ruoyi.common.constant;
-import io.jsonwebtoken.Claims;
-
/**
* 閫氱敤甯搁噺淇℃伅
*
@@ -92,7 +90,7 @@ public class Constants
/**
* 鐢ㄦ埛鍚嶇О
*/
- public static final String JWT_USERNAME = Claims.SUBJECT;
+ public static final String JWT_USERNAME = "sub";
/**
* 鐢ㄦ埛澶村儚
diff --git a/ruoyi/src/main/java/com/ruoyi/common/constant/GenConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/constant/GenConstants.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/constant/HttpStatus.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/constant/HttpStatus.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java
similarity index 95%
rename from ruoyi/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java
index 62ad815..8318b8f 100644
--- a/ruoyi/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java
@@ -1,50 +1,50 @@
-package com.ruoyi.common.constant;
-
-/**
- * 浠诲姟璋冨害閫氱敤甯搁噺
- *
- * @author ruoyi
- */
-public class ScheduleConstants
-{
- public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME";
-
- /** 鎵ц鐩爣key */
- public static final String TASK_PROPERTIES = "TASK_PROPERTIES";
-
- /** 榛樿 */
- public static final String MISFIRE_DEFAULT = "0";
-
- /** 绔嬪嵆瑙﹀彂鎵ц */
- public static final String MISFIRE_IGNORE_MISFIRES = "1";
-
- /** 瑙﹀彂涓娆℃墽琛 */
- public static final String MISFIRE_FIRE_AND_PROCEED = "2";
-
- /** 涓嶈Е鍙戠珛鍗虫墽琛 */
- public static final String MISFIRE_DO_NOTHING = "3";
-
- public enum Status
- {
- /**
- * 姝e父
- */
- NORMAL("0"),
- /**
- * 鏆傚仠
- */
- PAUSE("1");
-
- private String value;
-
- private Status(String value)
- {
- this.value = value;
- }
-
- public String getValue()
- {
- return value;
- }
- }
-}
+package com.ruoyi.common.constant;
+
+/**
+ * 浠诲姟璋冨害閫氱敤甯搁噺
+ *
+ * @author ruoyi
+ */
+public class ScheduleConstants
+{
+ public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME";
+
+ /** 鎵ц鐩爣key */
+ public static final String TASK_PROPERTIES = "TASK_PROPERTIES";
+
+ /** 榛樿 */
+ public static final String MISFIRE_DEFAULT = "0";
+
+ /** 绔嬪嵆瑙﹀彂鎵ц */
+ public static final String MISFIRE_IGNORE_MISFIRES = "1";
+
+ /** 瑙﹀彂涓娆℃墽琛 */
+ public static final String MISFIRE_FIRE_AND_PROCEED = "2";
+
+ /** 涓嶈Е鍙戠珛鍗虫墽琛 */
+ public static final String MISFIRE_DO_NOTHING = "3";
+
+ public enum Status
+ {
+ /**
+ * 姝e父
+ */
+ NORMAL("0"),
+ /**
+ * 鏆傚仠
+ */
+ PAUSE("1");
+
+ private String value;
+
+ private Status(String value)
+ {
+ this.value = value;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+ }
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/common/constant/UserConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/constant/UserConstants.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/web/controller/BaseController.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java
similarity index 82%
rename from ruoyi/src/main/java/com/ruoyi/framework/web/controller/BaseController.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java
index cb9b7d0..ab78abd 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/web/controller/BaseController.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java
@@ -1,4 +1,4 @@
-package com.ruoyi.framework.web.controller;
+package com.ruoyi.common.core.controller;
import java.beans.PropertyEditorSupport;
import java.util.Date;
@@ -10,13 +10,13 @@ import org.springframework.web.bind.annotation.InitBinder;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.constant.HttpStatus;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.PageDomain;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.sql.SqlUtil;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.framework.web.page.PageDomain;
-import com.ruoyi.framework.web.page.TableDataInfo;
-import com.ruoyi.framework.web.page.TableSupport;
/**
* web灞傞氱敤鏁版嵁澶勭悊
@@ -83,4 +83,12 @@ public class BaseController
{
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
}
+
+ /**
+ * 椤甸潰璺宠浆
+ */
+ public String redirect(String url)
+ {
+ return StringUtils.format("redirect:{}", url);
+ }
}
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/web/domain/AjaxResult.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java
similarity index 94%
rename from ruoyi/src/main/java/com/ruoyi/framework/web/domain/AjaxResult.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java
index 5c551bd..b26e066 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/web/domain/AjaxResult.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java
@@ -1,4 +1,4 @@
-package com.ruoyi.framework.web.domain;
+package com.ruoyi.common.core.domain;
import java.util.HashMap;
import com.ruoyi.common.constant.HttpStatus;
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java
similarity index 93%
rename from ruoyi/src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java
index 08f4f90..a8c51a7 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java
@@ -1,4 +1,4 @@
-package com.ruoyi.framework.web.domain;
+package com.ruoyi.common.core.domain;
import java.io.Serializable;
import java.util.Date;
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/web/domain/TreeEntity.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java
similarity index 91%
rename from ruoyi/src/main/java/com/ruoyi/framework/web/domain/TreeEntity.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java
index af86437..171f04c 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/web/domain/TreeEntity.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java
@@ -1,4 +1,4 @@
-package com.ruoyi.framework.web.domain;
+package com.ruoyi.common.core.domain;
import java.util.ArrayList;
import java.util.List;
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/web/domain/TreeSelect.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java
similarity index 86%
rename from ruoyi/src/main/java/com/ruoyi/framework/web/domain/TreeSelect.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java
index 2ace4e9..4a59e40 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/web/domain/TreeSelect.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java
@@ -1,11 +1,11 @@
-package com.ruoyi.framework.web.domain;
+package com.ruoyi.common.core.domain;
import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;
import com.fasterxml.jackson.annotation.JsonInclude;
-import com.ruoyi.project.system.domain.SysDept;
-import com.ruoyi.project.system.domain.SysMenu;
+import com.ruoyi.common.core.domain.entity.SysDept;
+import com.ruoyi.common.core.domain.entity.SysMenu;
/**
* Treeselect鏍戠粨鏋勫疄浣撶被
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/domain/SysDept.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java
similarity index 93%
rename from ruoyi/src/main/java/com/ruoyi/project/system/domain/SysDept.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java
index ba12f15..423ef68 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/domain/SysDept.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.system.domain;
+package com.ruoyi.common.core.domain.entity;
import java.util.ArrayList;
import java.util.List;
@@ -7,7 +7,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
-import com.ruoyi.framework.web.domain.BaseEntity;
+import com.ruoyi.common.core.domain.BaseEntity;
/**
* 閮ㄩ棬琛 sys_dept
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/domain/SysDictData.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java
similarity index 91%
rename from ruoyi/src/main/java/com/ruoyi/project/system/domain/SysDictData.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java
index 8f7ec61..4fa5f0b 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/domain/SysDictData.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java
@@ -1,13 +1,13 @@
-package com.ruoyi.project.system.domain;
+package com.ruoyi.common.core.domain.entity;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.constant.UserConstants;
-import com.ruoyi.framework.aspectj.lang.annotation.Excel;
-import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
-import com.ruoyi.framework.web.domain.BaseEntity;
+import com.ruoyi.common.core.domain.BaseEntity;
/**
* 瀛楀吀鏁版嵁琛 sys_dict_data
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/domain/SysDictType.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java
similarity index 87%
rename from ruoyi/src/main/java/com/ruoyi/project/system/domain/SysDictType.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java
index a800f69..6683c91 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/domain/SysDictType.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java
@@ -1,12 +1,12 @@
-package com.ruoyi.project.system.domain;
+package com.ruoyi.common.core.domain.entity;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
-import com.ruoyi.framework.aspectj.lang.annotation.Excel;
-import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
-import com.ruoyi.framework.web.domain.BaseEntity;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.annotation.Excel.ColumnType;
+import com.ruoyi.common.core.domain.BaseEntity;
/**
* 瀛楀吀绫诲瀷琛 sys_dict_type
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/domain/SysMenu.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java
similarity index 93%
rename from ruoyi/src/main/java/com/ruoyi/project/system/domain/SysMenu.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java
index 24990c0..b8ad1f3 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/domain/SysMenu.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.system.domain;
+package com.ruoyi.common.core.domain.entity;
import java.util.ArrayList;
import java.util.List;
@@ -6,7 +6,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
-import com.ruoyi.framework.web.domain.BaseEntity;
+import com.ruoyi.common.core.domain.BaseEntity;
/**
* 鑿滃崟鏉冮檺琛 sys_menu
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/domain/SysRole.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java
similarity index 91%
rename from ruoyi/src/main/java/com/ruoyi/project/system/domain/SysRole.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java
index 677c2e4..9330f8e 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/domain/SysRole.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java
@@ -1,12 +1,12 @@
-package com.ruoyi.project.system.domain;
+package com.ruoyi.common.core.domain.entity;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
-import com.ruoyi.framework.aspectj.lang.annotation.Excel;
-import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
-import com.ruoyi.framework.web.domain.BaseEntity;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.annotation.Excel.ColumnType;
+import com.ruoyi.common.core.domain.BaseEntity;
/**
* 瑙掕壊琛 sys_role
diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/domain/SysUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
similarity index 91%
rename from ruoyi/src/main/java/com/ruoyi/project/system/domain/SysUser.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
index f63f598..f7e68e7 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/domain/SysUser.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
@@ -1,4 +1,4 @@
-package com.ruoyi.project.system.domain;
+package com.ruoyi.common.core.domain.entity;
import java.util.Date;
import java.util.List;
@@ -9,11 +9,11 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
-import com.ruoyi.framework.aspectj.lang.annotation.Excel;
-import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
-import com.ruoyi.framework.aspectj.lang.annotation.Excel.Type;
-import com.ruoyi.framework.aspectj.lang.annotation.Excels;
-import com.ruoyi.framework.web.domain.BaseEntity;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.annotation.Excel.ColumnType;
+import com.ruoyi.common.annotation.Excel.Type;
+import com.ruoyi.common.annotation.Excels;
+import com.ruoyi.common.core.domain.BaseEntity;
/**
* 鐢ㄦ埛瀵硅薄 sys_user
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/security/LoginBody.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java
similarity index 89%
rename from ruoyi/src/main/java/com/ruoyi/framework/security/LoginBody.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java
index 5986053..a1f8b83 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/security/LoginBody.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java
@@ -1,4 +1,4 @@
-package com.ruoyi.framework.security;
+package com.ruoyi.common.core.domain.model;
/**
* 鐢ㄦ埛鐧诲綍瀵硅薄
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/security/LoginUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java
similarity index 91%
rename from ruoyi/src/main/java/com/ruoyi/framework/security/LoginUser.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java
index 6b2ff09..a8b1126 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/security/LoginUser.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java
@@ -1,11 +1,11 @@
-package com.ruoyi.framework.security;
+package com.ruoyi.common.core.domain.model;
import java.util.Collection;
import java.util.Set;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.common.core.domain.entity.SysUser;
/**
* 鐧诲綍鐢ㄦ埛韬唤鏉冮檺
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/web/page/PageDomain.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java
similarity index 91%
rename from ruoyi/src/main/java/com/ruoyi/framework/web/page/PageDomain.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java
index 7e50472..e6dd98e 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/web/page/PageDomain.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java
@@ -1,4 +1,4 @@
-package com.ruoyi.framework.web.page;
+package com.ruoyi.common.core.page;
import com.ruoyi.common.utils.StringUtils;
@@ -11,10 +11,13 @@ public class PageDomain
{
/** 褰撳墠璁板綍璧峰绱㈠紩 */
private Integer pageNum;
+
/** 姣忛〉鏄剧ず璁板綍鏁 */
private Integer pageSize;
+
/** 鎺掑簭鍒 */
private String orderByColumn;
+
/** 鎺掑簭鐨勬柟鍚 "desc" 鎴栬 "asc". */
private String isAsc;
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/web/page/TableDataInfo.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java
similarity index 91%
rename from ruoyi/src/main/java/com/ruoyi/framework/web/page/TableDataInfo.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java
index e8b24ff..a3487b8 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/web/page/TableDataInfo.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java
@@ -1,4 +1,4 @@
-package com.ruoyi.framework.web.page;
+package com.ruoyi.common.core.page;
import java.io.Serializable;
import java.util.List;
@@ -82,4 +82,4 @@ public class TableDataInfo implements Serializable
{
this.msg = msg;
}
-}
\ No newline at end of file
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/web/page/TableSupport.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java
similarity index 92%
rename from ruoyi/src/main/java/com/ruoyi/framework/web/page/TableSupport.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java
index fa6a9ee..511e24b 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/web/page/TableSupport.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java
@@ -1,4 +1,4 @@
-package com.ruoyi.framework.web.page;
+package com.ruoyi.common.core.page;
import com.ruoyi.common.utils.ServletUtils;
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/redis/RedisCache.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
similarity index 95%
rename from ruoyi/src/main/java/com/ruoyi/framework/redis/RedisCache.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
index 2905a38..530dcd9 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/redis/RedisCache.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
@@ -1,4 +1,4 @@
-package com.ruoyi.framework.redis;
+package com.ruoyi.common.core.redis;
import java.util.Collection;
import java.util.List;
diff --git a/ruoyi/src/main/java/com/ruoyi/common/core/text/CharsetKit.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/text/CharsetKit.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/core/text/CharsetKit.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/text/CharsetKit.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/core/text/Convert.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/core/text/Convert.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/core/text/StrFormatter.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/text/StrFormatter.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/core/text/StrFormatter.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/core/text/StrFormatter.java
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessStatus.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java
similarity index 70%
rename from ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessStatus.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java
index 7e27f2e..78188fc 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessStatus.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java
@@ -1,4 +1,4 @@
-package com.ruoyi.framework.aspectj.lang.enums;
+package com.ruoyi.common.enums;
/**
* 鎿嶄綔鐘舵
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessType.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java
similarity index 83%
rename from ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessType.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java
index d974a64..2bbeaf7 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessType.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java
@@ -1,4 +1,4 @@
-package com.ruoyi.framework.aspectj.lang.enums;
+package com.ruoyi.common.enums;
/**
* 涓氬姟鎿嶄綔绫诲瀷
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/enums/DataSourceType.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java
similarity index 70%
rename from ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/enums/DataSourceType.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java
index 274dd34..4b5341d 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/enums/DataSourceType.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java
@@ -1,4 +1,4 @@
-package com.ruoyi.framework.aspectj.lang.enums;
+package com.ruoyi.common.enums;
/**
* 鏁版嵁婧
diff --git a/ruoyi/src/main/java/com/ruoyi/common/enums/HttpMethod.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/enums/HttpMethod.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/enums/OperatorType.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java
similarity index 75%
rename from ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/enums/OperatorType.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java
index 98685a6..06532af 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/lang/enums/OperatorType.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java
@@ -1,4 +1,4 @@
-package com.ruoyi.framework.aspectj.lang.enums;
+package com.ruoyi.common.enums;
/**
* 鎿嶄綔浜虹被鍒
diff --git a/ruoyi/src/main/java/com/ruoyi/common/enums/UserStatus.java b/ruoyi-common/src/main/java/com/ruoyi/common/enums/UserStatus.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/enums/UserStatus.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/enums/UserStatus.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/exception/BaseException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/BaseException.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/exception/BaseException.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/BaseException.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/exception/CustomException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/CustomException.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/exception/CustomException.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/CustomException.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/exception/DemoModeException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/DemoModeException.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/exception/DemoModeException.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/DemoModeException.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/exception/UtilException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/UtilException.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/exception/UtilException.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/UtilException.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/exception/file/FileException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileException.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/exception/file/FileException.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileException.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/exception/job/TaskException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/job/TaskException.java
similarity index 95%
rename from ruoyi/src/main/java/com/ruoyi/common/exception/job/TaskException.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/job/TaskException.java
index a567b40..14b2361 100644
--- a/ruoyi/src/main/java/com/ruoyi/common/exception/job/TaskException.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/exception/job/TaskException.java
@@ -1,34 +1,34 @@
-package com.ruoyi.common.exception.job;
-
-/**
- * 璁″垝绛栫暐寮傚父
- *
- * @author ruoyi
- */
-public class TaskException extends Exception
-{
- private static final long serialVersionUID = 1L;
-
- private Code code;
-
- public TaskException(String msg, Code code)
- {
- this(msg, code, null);
- }
-
- public TaskException(String msg, Code code, Exception nestedEx)
- {
- super(msg, nestedEx);
- this.code = code;
- }
-
- public Code getCode()
- {
- return code;
- }
-
- public enum Code
- {
- TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE
- }
+package com.ruoyi.common.exception.job;
+
+/**
+ * 璁″垝绛栫暐寮傚父
+ *
+ * @author ruoyi
+ */
+public class TaskException extends Exception
+{
+ private static final long serialVersionUID = 1L;
+
+ private Code code;
+
+ public TaskException(String msg, Code code)
+ {
+ this(msg, code, null);
+ }
+
+ public TaskException(String msg, Code code, Exception nestedEx)
+ {
+ super(msg, nestedEx);
+ this.code = code;
+ }
+
+ public Code getCode()
+ {
+ return code;
+ }
+
+ public enum Code
+ {
+ TASK_EXISTS, NO_TASK_EXISTS, TASK_ALREADY_STARTED, UNKNOWN, CONFIG_ERROR, TASK_NODE_NOT_AVAILABLE
+ }
}
\ No newline at end of file
diff --git a/ruoyi/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/exception/user/UserException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserException.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/exception/user/UserException.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserException.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java b/ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java b/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java
similarity index 96%
rename from ruoyi/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java
index 6e3edfc..15a6804 100644
--- a/ruoyi/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java
@@ -1,52 +1,52 @@
-package com.ruoyi.common.filter;
-
-import java.io.IOException;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import org.springframework.http.MediaType;
-import com.ruoyi.common.utils.StringUtils;
-
-/**
- * Repeatable 杩囨护鍣
- *
- * @author ruoyi
- */
-public class RepeatableFilter implements Filter
-{
- @Override
- public void init(FilterConfig filterConfig) throws ServletException
- {
-
- }
-
- @Override
- public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
- throws IOException, ServletException
- {
- ServletRequest requestWrapper = null;
- if (request instanceof HttpServletRequest && StringUtils.equalsAnyIgnoreCase(request.getContentType(),
- MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_JSON_UTF8_VALUE))
- {
- requestWrapper = new RepeatedlyRequestWrapper((HttpServletRequest) request, response);
- }
- if (null == requestWrapper)
- {
- chain.doFilter(request, response);
- }
- else
- {
- chain.doFilter(requestWrapper, response);
- }
- }
-
- @Override
- public void destroy()
- {
-
- }
-}
+package com.ruoyi.common.filter;
+
+import java.io.IOException;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import org.springframework.http.MediaType;
+import com.ruoyi.common.utils.StringUtils;
+
+/**
+ * Repeatable 杩囨护鍣
+ *
+ * @author ruoyi
+ */
+public class RepeatableFilter implements Filter
+{
+ @Override
+ public void init(FilterConfig filterConfig) throws ServletException
+ {
+
+ }
+
+ @Override
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
+ throws IOException, ServletException
+ {
+ ServletRequest requestWrapper = null;
+ if (request instanceof HttpServletRequest && StringUtils.equalsAnyIgnoreCase(request.getContentType(),
+ MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_JSON_UTF8_VALUE))
+ {
+ requestWrapper = new RepeatedlyRequestWrapper((HttpServletRequest) request, response);
+ }
+ if (null == requestWrapper)
+ {
+ chain.doFilter(request, response);
+ }
+ else
+ {
+ chain.doFilter(requestWrapper, response);
+ }
+ }
+
+ @Override
+ public void destroy()
+ {
+
+ }
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java b/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java
similarity index 96%
rename from ruoyi/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java
index bd7097f..9ad6f49 100644
--- a/ruoyi/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java
@@ -1,72 +1,72 @@
-package com.ruoyi.common.filter;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import javax.servlet.ReadListener;
-import javax.servlet.ServletInputStream;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-import com.ruoyi.common.utils.http.HttpHelper;
-
-/**
- * 鏋勫缓鍙噸澶嶈鍙杋nputStream鐨剅equest
- *
- * @author ruoyi
- */
-public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper
-{
- private final byte[] body;
-
- public RepeatedlyRequestWrapper(HttpServletRequest request, ServletResponse response) throws IOException
- {
- super(request);
- request.setCharacterEncoding("UTF-8");
- response.setCharacterEncoding("UTF-8");
-
- body = HttpHelper.getBodyString(request).getBytes("UTF-8");
- }
-
- @Override
- public BufferedReader getReader() throws IOException
- {
- return new BufferedReader(new InputStreamReader(getInputStream()));
- }
-
- @Override
- public ServletInputStream getInputStream() throws IOException
- {
-
- final ByteArrayInputStream bais = new ByteArrayInputStream(body);
-
- return new ServletInputStream()
- {
-
- @Override
- public int read() throws IOException
- {
- return bais.read();
- }
-
- @Override
- public boolean isFinished()
- {
- return false;
- }
-
- @Override
- public boolean isReady()
- {
- return false;
- }
-
- @Override
- public void setReadListener(ReadListener readListener)
- {
-
- }
- };
- }
-}
+package com.ruoyi.common.filter;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import javax.servlet.ReadListener;
+import javax.servlet.ServletInputStream;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import com.ruoyi.common.utils.http.HttpHelper;
+
+/**
+ * 鏋勫缓鍙噸澶嶈鍙杋nputStream鐨剅equest
+ *
+ * @author ruoyi
+ */
+public class RepeatedlyRequestWrapper extends HttpServletRequestWrapper
+{
+ private final byte[] body;
+
+ public RepeatedlyRequestWrapper(HttpServletRequest request, ServletResponse response) throws IOException
+ {
+ super(request);
+ request.setCharacterEncoding("UTF-8");
+ response.setCharacterEncoding("UTF-8");
+
+ body = HttpHelper.getBodyString(request).getBytes("UTF-8");
+ }
+
+ @Override
+ public BufferedReader getReader() throws IOException
+ {
+ return new BufferedReader(new InputStreamReader(getInputStream()));
+ }
+
+ @Override
+ public ServletInputStream getInputStream() throws IOException
+ {
+
+ final ByteArrayInputStream bais = new ByteArrayInputStream(body);
+
+ return new ServletInputStream()
+ {
+
+ @Override
+ public int read() throws IOException
+ {
+ return bais.read();
+ }
+
+ @Override
+ public boolean isFinished()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isReady()
+ {
+ return false;
+ }
+
+ @Override
+ public void setReadListener(ReadListener readListener)
+ {
+
+ }
+ };
+ }
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/common/filter/XssFilter.java b/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/filter/XssFilter.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java b/ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/Arith.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/Arith.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/DateUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/DateUtils.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/DictUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java
similarity index 90%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/DictUtils.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java
index 0c1ee5d..6fb6289 100644
--- a/ruoyi/src/main/java/com/ruoyi/common/utils/DictUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java
@@ -2,10 +2,11 @@ package com.ruoyi.common.utils;
import java.util.Collection;
import java.util.List;
+
import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.core.domain.entity.SysDictData;
+import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.spring.SpringUtils;
-import com.ruoyi.framework.redis.RedisCache;
-import com.ruoyi.project.system.domain.SysDictData;
/**
* 瀛楀吀宸ュ叿绫
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java
similarity index 95%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java
index ad57439..4ca5283 100644
--- a/ruoyi/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java
@@ -1,40 +1,40 @@
-package com.ruoyi.common.utils;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import org.apache.commons.lang3.exception.ExceptionUtils;
-
-/**
- * 閿欒淇℃伅澶勭悊绫汇
- *
- * @author ruoyi
- */
-public class ExceptionUtil
-{
- /**
- * 鑾峰彇exception鐨勮缁嗛敊璇俊鎭
- */
- public static String getExceptionMessage(Throwable e)
- {
- StringWriter sw = new StringWriter();
- e.printStackTrace(new PrintWriter(sw, true));
- String str = sw.toString();
- return str;
- }
-
- public static String getRootErrorMseeage(Exception e)
- {
- Throwable root = ExceptionUtils.getRootCause(e);
- root = (root == null ? e : root);
- if (root == null)
- {
- return "";
- }
- String msg = root.getMessage();
- if (msg == null)
- {
- return "null";
- }
- return StringUtils.defaultString(msg);
- }
-}
+package com.ruoyi.common.utils;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import org.apache.commons.lang3.exception.ExceptionUtils;
+
+/**
+ * 閿欒淇℃伅澶勭悊绫汇
+ *
+ * @author ruoyi
+ */
+public class ExceptionUtil
+{
+ /**
+ * 鑾峰彇exception鐨勮缁嗛敊璇俊鎭
+ */
+ public static String getExceptionMessage(Throwable e)
+ {
+ StringWriter sw = new StringWriter();
+ e.printStackTrace(new PrintWriter(sw, true));
+ String str = sw.toString();
+ return str;
+ }
+
+ public static String getRootErrorMseeage(Exception e)
+ {
+ Throwable root = ExceptionUtils.getRootCause(e);
+ root = (root == null ? e : root);
+ if (root == null)
+ {
+ return "";
+ }
+ String msg = root.getMessage();
+ if (msg == null)
+ {
+ return "null";
+ }
+ return StringUtils.defaultString(msg);
+ }
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/LogUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/LogUtils.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/LogUtils.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/LogUtils.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/MessageUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/MessageUtils.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/SecurityUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
similarity index 93%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
index c8d1783..ce7f3b6 100644
--- a/ruoyi/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
@@ -4,8 +4,8 @@ import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import com.ruoyi.common.constant.HttpStatus;
+import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.CustomException;
-import com.ruoyi.framework.security.LoginUser;
/**
* 瀹夊叏鏈嶅姟宸ュ叿绫
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/ServletUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/ServletUtils.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/StringUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/StringUtils.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/Threads.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/Threads.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/VerifyCodeUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/VerifyCodeUtils.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/VerifyCodeUtils.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/VerifyCodeUtils.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java
similarity index 96%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java
index 4463662..51cdc2f 100644
--- a/ruoyi/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java
@@ -1,110 +1,110 @@
-package com.ruoyi.common.utils.bean;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Bean 宸ュ叿绫
- *
- * @author ruoyi
- */
-public class BeanUtils extends org.springframework.beans.BeanUtils
-{
- /** Bean鏂规硶鍚嶄腑灞炴у悕寮濮嬬殑涓嬫爣 */
- private static final int BEAN_METHOD_PROP_INDEX = 3;
-
- /** * 鍖归厤getter鏂规硶鐨勬鍒欒〃杈惧紡 */
- private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)");
-
- /** * 鍖归厤setter鏂规硶鐨勬鍒欒〃杈惧紡 */
- private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)");
-
- /**
- * Bean灞炴у鍒跺伐鍏锋柟娉曘
- *
- * @param dest 鐩爣瀵硅薄
- * @param src 婧愬璞
- */
- public static void copyBeanProp(Object dest, Object src)
- {
- try
- {
- copyProperties(src, dest);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- /**
- * 鑾峰彇瀵硅薄鐨剆etter鏂规硶銆
- *
- * @param obj 瀵硅薄
- * @return 瀵硅薄鐨剆etter鏂规硶鍒楄〃
- */
- public static List getSetterMethods(Object obj)
- {
- // setter鏂规硶鍒楄〃
- List setterMethods = new ArrayList();
-
- // 鑾峰彇鎵鏈夋柟娉
- Method[] methods = obj.getClass().getMethods();
-
- // 鏌ユ壘setter鏂规硶
-
- for (Method method : methods)
- {
- Matcher m = SET_PATTERN.matcher(method.getName());
- if (m.matches() && (method.getParameterTypes().length == 1))
- {
- setterMethods.add(method);
- }
- }
- // 杩斿洖setter鏂规硶鍒楄〃
- return setterMethods;
- }
-
- /**
- * 鑾峰彇瀵硅薄鐨刧etter鏂规硶銆
- *
- * @param obj 瀵硅薄
- * @return 瀵硅薄鐨刧etter鏂规硶鍒楄〃
- */
-
- public static List getGetterMethods(Object obj)
- {
- // getter鏂规硶鍒楄〃
- List getterMethods = new ArrayList();
- // 鑾峰彇鎵鏈夋柟娉
- Method[] methods = obj.getClass().getMethods();
- // 鏌ユ壘getter鏂规硶
- for (Method method : methods)
- {
- Matcher m = GET_PATTERN.matcher(method.getName());
- if (m.matches() && (method.getParameterTypes().length == 0))
- {
- getterMethods.add(method);
- }
- }
- // 杩斿洖getter鏂规硶鍒楄〃
- return getterMethods;
- }
-
- /**
- * 妫鏌ean鏂规硶鍚嶄腑鐨勫睘鎬у悕鏄惁鐩哥瓑銆
- * 濡俫etName()鍜宻etName()灞炴у悕涓鏍凤紝getName()鍜宻etAge()灞炴у悕涓嶄竴鏍枫
- *
- * @param m1 鏂规硶鍚1
- * @param m2 鏂规硶鍚2
- * @return 灞炴у悕涓鏍疯繑鍥瀟rue锛屽惁鍒欒繑鍥瀎alse
- */
-
- public static boolean isMethodPropEquals(String m1, String m2)
- {
- return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX));
- }
-}
+package com.ruoyi.common.utils.bean;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Bean 宸ュ叿绫
+ *
+ * @author ruoyi
+ */
+public class BeanUtils extends org.springframework.beans.BeanUtils
+{
+ /** Bean鏂规硶鍚嶄腑灞炴у悕寮濮嬬殑涓嬫爣 */
+ private static final int BEAN_METHOD_PROP_INDEX = 3;
+
+ /** * 鍖归厤getter鏂规硶鐨勬鍒欒〃杈惧紡 */
+ private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)");
+
+ /** * 鍖归厤setter鏂规硶鐨勬鍒欒〃杈惧紡 */
+ private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)");
+
+ /**
+ * Bean灞炴у鍒跺伐鍏锋柟娉曘
+ *
+ * @param dest 鐩爣瀵硅薄
+ * @param src 婧愬璞
+ */
+ public static void copyBeanProp(Object dest, Object src)
+ {
+ try
+ {
+ copyProperties(src, dest);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * 鑾峰彇瀵硅薄鐨剆etter鏂规硶銆
+ *
+ * @param obj 瀵硅薄
+ * @return 瀵硅薄鐨剆etter鏂规硶鍒楄〃
+ */
+ public static List getSetterMethods(Object obj)
+ {
+ // setter鏂规硶鍒楄〃
+ List setterMethods = new ArrayList();
+
+ // 鑾峰彇鎵鏈夋柟娉
+ Method[] methods = obj.getClass().getMethods();
+
+ // 鏌ユ壘setter鏂规硶
+
+ for (Method method : methods)
+ {
+ Matcher m = SET_PATTERN.matcher(method.getName());
+ if (m.matches() && (method.getParameterTypes().length == 1))
+ {
+ setterMethods.add(method);
+ }
+ }
+ // 杩斿洖setter鏂规硶鍒楄〃
+ return setterMethods;
+ }
+
+ /**
+ * 鑾峰彇瀵硅薄鐨刧etter鏂规硶銆
+ *
+ * @param obj 瀵硅薄
+ * @return 瀵硅薄鐨刧etter鏂规硶鍒楄〃
+ */
+
+ public static List getGetterMethods(Object obj)
+ {
+ // getter鏂规硶鍒楄〃
+ List getterMethods = new ArrayList();
+ // 鑾峰彇鎵鏈夋柟娉
+ Method[] methods = obj.getClass().getMethods();
+ // 鏌ユ壘getter鏂规硶
+ for (Method method : methods)
+ {
+ Matcher m = GET_PATTERN.matcher(method.getName());
+ if (m.matches() && (method.getParameterTypes().length == 0))
+ {
+ getterMethods.add(method);
+ }
+ }
+ // 杩斿洖getter鏂规硶鍒楄〃
+ return getterMethods;
+ }
+
+ /**
+ * 妫鏌ean鏂规硶鍚嶄腑鐨勫睘鎬у悕鏄惁鐩哥瓑銆
+ * 濡俫etName()鍜宻etName()灞炴у悕涓鏍凤紝getName()鍜宻etAge()灞炴у悕涓嶄竴鏍枫
+ *
+ * @param m1 鏂规硶鍚1
+ * @param m2 鏂规硶鍚2
+ * @return 灞炴у悕涓鏍疯繑鍥瀟rue锛屽惁鍒欒繑鍥瀎alse
+ */
+
+ public static boolean isMethodPropEquals(String m1, String m2)
+ {
+ return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX));
+ }
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
similarity index 95%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
index 5b356e2..183f918 100644
--- a/ruoyi/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
@@ -4,14 +4,14 @@ import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FilenameUtils;
import org.springframework.web.multipart.MultipartFile;
+import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.exception.file.FileNameLengthLimitExceededException;
import com.ruoyi.common.exception.file.FileSizeLimitExceededException;
import com.ruoyi.common.exception.file.InvalidExtensionException;
import com.ruoyi.common.utils.DateUtils;
-import com.ruoyi.common.utils.IdUtils;
import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.framework.config.RuoYiConfig;
+import com.ruoyi.common.utils.uuid.IdUtils;
/**
* 鏂囦欢涓婁紶宸ュ叿绫
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/file/FileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/file/FileUtils.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java
similarity index 97%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java
index 6244cd5..4173956 100644
--- a/ruoyi/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java
@@ -1,569 +1,569 @@
-package com.ruoyi.common.utils.html;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * HTML杩囨护鍣紝鐢ㄤ簬鍘婚櫎XSS婕忔礊闅愭偅銆
- *
- * @author ruoyi
- */
-public final class HTMLFilter
-{
- /**
- * regex flag union representing /si modifiers in php
- **/
- private static final int REGEX_FLAGS_SI = Pattern.CASE_INSENSITIVE | Pattern.DOTALL;
- private static final Pattern P_COMMENTS = Pattern.compile("", Pattern.DOTALL);
- private static final Pattern P_COMMENT = Pattern.compile("^!--(.*)--$", REGEX_FLAGS_SI);
- private static final Pattern P_TAGS = Pattern.compile("<(.*?)>", Pattern.DOTALL);
- private static final Pattern P_END_TAG = Pattern.compile("^/([a-z0-9]+)", REGEX_FLAGS_SI);
- private static final Pattern P_START_TAG = Pattern.compile("^([a-z0-9]+)(.*?)(/?)$", REGEX_FLAGS_SI);
- private static final Pattern P_QUOTED_ATTRIBUTES = Pattern.compile("([a-z0-9]+)=([\"'])(.*?)\\2", REGEX_FLAGS_SI);
- private static final Pattern P_UNQUOTED_ATTRIBUTES = Pattern.compile("([a-z0-9]+)(=)([^\"\\s']+)", REGEX_FLAGS_SI);
- private static final Pattern P_PROTOCOL = Pattern.compile("^([^:]+):", REGEX_FLAGS_SI);
- private static final Pattern P_ENTITY = Pattern.compile("(\\d+);?");
- private static final Pattern P_ENTITY_UNICODE = Pattern.compile("([0-9a-f]+);?");
- private static final Pattern P_ENCODE = Pattern.compile("%([0-9a-f]{2});?");
- private static final Pattern P_VALID_ENTITIES = Pattern.compile("&([^&;]*)(?=(;|&|$))");
- private static final Pattern P_VALID_QUOTES = Pattern.compile("(>|^)([^<]+?)(<|$)", Pattern.DOTALL);
- private static final Pattern P_END_ARROW = Pattern.compile("^>");
- private static final Pattern P_BODY_TO_END = Pattern.compile("<([^>]*?)(?=<|$)");
- private static final Pattern P_XML_CONTENT = Pattern.compile("(^|>)([^<]*?)(?=>)");
- private static final Pattern P_STRAY_LEFT_ARROW = Pattern.compile("<([^>]*?)(?=<|$)");
- private static final Pattern P_STRAY_RIGHT_ARROW = Pattern.compile("(^|>)([^<]*?)(?=>)");
- private static final Pattern P_AMP = Pattern.compile("&");
- private static final Pattern P_QUOTE = Pattern.compile("\"");
- private static final Pattern P_LEFT_ARROW = Pattern.compile("<");
- private static final Pattern P_RIGHT_ARROW = Pattern.compile(">");
- private static final Pattern P_BOTH_ARROWS = Pattern.compile("<>");
-
- // @xxx could grow large... maybe use sesat's ReferenceMap
- private static final ConcurrentMap P_REMOVE_PAIR_BLANKS = new ConcurrentHashMap<>();
- private static final ConcurrentMap P_REMOVE_SELF_BLANKS = new ConcurrentHashMap<>();
-
- /**
- * set of allowed html elements, along with allowed attributes for each element
- **/
- private final Map> vAllowed;
- /**
- * counts of open tags for each (allowable) html element
- **/
- private final Map vTagCounts = new HashMap<>();
-
- /**
- * html elements which must always be self-closing (e.g. "")
- **/
- private final String[] vSelfClosingTags;
- /**
- * html elements which must always have separate opening and closing tags (e.g. "")
- **/
- private final String[] vNeedClosingTags;
- /**
- * set of disallowed html elements
- **/
- private final String[] vDisallowed;
- /**
- * attributes which should be checked for valid protocols
- **/
- private final String[] vProtocolAtts;
- /**
- * allowed protocols
- **/
- private final String[] vAllowedProtocols;
- /**
- * tags which should be removed if they contain no content (e.g. "" or "")
- **/
- private final String[] vRemoveBlanks;
- /**
- * entities allowed within html markup
- **/
- private final String[] vAllowedEntities;
- /**
- * flag determining whether comments are allowed in input String.
- */
- private final boolean stripComment;
- private final boolean encodeQuotes;
- /**
- * flag determining whether to try to make tags when presented with "unbalanced" angle brackets (e.g. ""
- * becomes " text "). If set to false, unbalanced angle brackets will be html escaped.
- */
- private final boolean alwaysMakeTags;
-
- /**
- * Default constructor.
- */
- public HTMLFilter()
- {
- vAllowed = new HashMap<>();
-
- final ArrayList a_atts = new ArrayList<>();
- a_atts.add("href");
- a_atts.add("target");
- vAllowed.put("a", a_atts);
-
- final ArrayList img_atts = new ArrayList<>();
- img_atts.add("src");
- img_atts.add("width");
- img_atts.add("height");
- img_atts.add("alt");
- vAllowed.put("img", img_atts);
-
- final ArrayList no_atts = new ArrayList<>();
- vAllowed.put("b", no_atts);
- vAllowed.put("strong", no_atts);
- vAllowed.put("i", no_atts);
- vAllowed.put("em", no_atts);
-
- vSelfClosingTags = new String[] { "img" };
- vNeedClosingTags = new String[] { "a", "b", "strong", "i", "em" };
- vDisallowed = new String[] {};
- vAllowedProtocols = new String[] { "http", "mailto", "https" }; // no ftp.
- vProtocolAtts = new String[] { "src", "href" };
- vRemoveBlanks = new String[] { "a", "b", "strong", "i", "em" };
- vAllowedEntities = new String[] { "amp", "gt", "lt", "quot" };
- stripComment = true;
- encodeQuotes = true;
- alwaysMakeTags = true;
- }
-
- /**
- * Map-parameter configurable constructor.
- *
- * @param conf map containing configuration. keys match field names.
- */
- @SuppressWarnings("unchecked")
- public HTMLFilter(final Map conf)
- {
-
- assert conf.containsKey("vAllowed") : "configuration requires vAllowed";
- assert conf.containsKey("vSelfClosingTags") : "configuration requires vSelfClosingTags";
- assert conf.containsKey("vNeedClosingTags") : "configuration requires vNeedClosingTags";
- assert conf.containsKey("vDisallowed") : "configuration requires vDisallowed";
- assert conf.containsKey("vAllowedProtocols") : "configuration requires vAllowedProtocols";
- assert conf.containsKey("vProtocolAtts") : "configuration requires vProtocolAtts";
- assert conf.containsKey("vRemoveBlanks") : "configuration requires vRemoveBlanks";
- assert conf.containsKey("vAllowedEntities") : "configuration requires vAllowedEntities";
-
- vAllowed = Collections.unmodifiableMap((HashMap>) conf.get("vAllowed"));
- vSelfClosingTags = (String[]) conf.get("vSelfClosingTags");
- vNeedClosingTags = (String[]) conf.get("vNeedClosingTags");
- vDisallowed = (String[]) conf.get("vDisallowed");
- vAllowedProtocols = (String[]) conf.get("vAllowedProtocols");
- vProtocolAtts = (String[]) conf.get("vProtocolAtts");
- vRemoveBlanks = (String[]) conf.get("vRemoveBlanks");
- vAllowedEntities = (String[]) conf.get("vAllowedEntities");
- stripComment = conf.containsKey("stripComment") ? (Boolean) conf.get("stripComment") : true;
- encodeQuotes = conf.containsKey("encodeQuotes") ? (Boolean) conf.get("encodeQuotes") : true;
- alwaysMakeTags = conf.containsKey("alwaysMakeTags") ? (Boolean) conf.get("alwaysMakeTags") : true;
- }
-
- private void reset()
- {
- vTagCounts.clear();
- }
-
- // ---------------------------------------------------------------
- // my versions of some PHP library functions
- public static String chr(final int decimal)
- {
- return String.valueOf((char) decimal);
- }
-
- public static String htmlSpecialChars(final String s)
- {
- String result = s;
- result = regexReplace(P_AMP, "&", result);
- result = regexReplace(P_QUOTE, """, result);
- result = regexReplace(P_LEFT_ARROW, "<", result);
- result = regexReplace(P_RIGHT_ARROW, ">", result);
- return result;
- }
-
- // ---------------------------------------------------------------
-
- /**
- * given a user submitted input String, filter out any invalid or restricted html.
- *
- * @param input text (i.e. submitted by a user) than may contain html
- * @return "clean" version of input, with only valid, whitelisted html elements allowed
- */
- public String filter(final String input)
- {
- reset();
- String s = input;
-
- s = escapeComments(s);
-
- s = balanceHTML(s);
-
- s = checkTags(s);
-
- s = processRemoveBlanks(s);
-
- s = validateEntities(s);
-
- return s;
- }
-
- public boolean isAlwaysMakeTags()
- {
- return alwaysMakeTags;
- }
-
- public boolean isStripComments()
- {
- return stripComment;
- }
-
- private String escapeComments(final String s)
- {
- final Matcher m = P_COMMENTS.matcher(s);
- final StringBuffer buf = new StringBuffer();
- if (m.find())
- {
- final String match = m.group(1); // (.*?)
- m.appendReplacement(buf, Matcher.quoteReplacement(""));
- }
- m.appendTail(buf);
-
- return buf.toString();
- }
-
- private String balanceHTML(String s)
- {
- if (alwaysMakeTags)
- {
- //
- // try and form html
- //
- s = regexReplace(P_END_ARROW, "", s);
- s = regexReplace(P_BODY_TO_END, "<$1>", s);
- s = regexReplace(P_XML_CONTENT, "$1<$2", s);
-
- }
- else
- {
- //
- // escape stray brackets
- //
- s = regexReplace(P_STRAY_LEFT_ARROW, "<$1", s);
- s = regexReplace(P_STRAY_RIGHT_ARROW, "$1$2><", s);
-
- //
- // the last regexp causes '<>' entities to appear
- // (we need to do a lookahead assertion so that the last bracket can
- // be used in the next pass of the regexp)
- //
- s = regexReplace(P_BOTH_ARROWS, "", s);
- }
-
- return s;
- }
-
- private String checkTags(String s)
- {
- Matcher m = P_TAGS.matcher(s);
-
- final StringBuffer buf = new StringBuffer();
- while (m.find())
- {
- String replaceStr = m.group(1);
- replaceStr = processTag(replaceStr);
- m.appendReplacement(buf, Matcher.quoteReplacement(replaceStr));
- }
- m.appendTail(buf);
-
- // these get tallied in processTag
- // (remember to reset before subsequent calls to filter method)
- final StringBuilder sBuilder = new StringBuilder(buf.toString());
- for (String key : vTagCounts.keySet())
- {
- for (int ii = 0; ii < vTagCounts.get(key); ii++)
- {
- sBuilder.append("").append(key).append(">");
- }
- }
- s = sBuilder.toString();
-
- return s;
- }
-
- private String processRemoveBlanks(final String s)
- {
- String result = s;
- for (String tag : vRemoveBlanks)
- {
- if (!P_REMOVE_PAIR_BLANKS.containsKey(tag))
- {
- P_REMOVE_PAIR_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?>" + tag + ">"));
- }
- result = regexReplace(P_REMOVE_PAIR_BLANKS.get(tag), "", result);
- if (!P_REMOVE_SELF_BLANKS.containsKey(tag))
- {
- P_REMOVE_SELF_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?/>"));
- }
- result = regexReplace(P_REMOVE_SELF_BLANKS.get(tag), "", result);
- }
-
- return result;
- }
-
- private static String regexReplace(final Pattern regex_pattern, final String replacement, final String s)
- {
- Matcher m = regex_pattern.matcher(s);
- return m.replaceAll(replacement);
- }
-
- private String processTag(final String s)
- {
- // ending tags
- Matcher m = P_END_TAG.matcher(s);
- if (m.find())
- {
- final String name = m.group(1).toLowerCase();
- if (allowed(name))
- {
- if (false == inArray(name, vSelfClosingTags))
- {
- if (vTagCounts.containsKey(name))
- {
- vTagCounts.put(name, vTagCounts.get(name) - 1);
- return "" + name + ">";
- }
- }
- }
- }
-
- // starting tags
- m = P_START_TAG.matcher(s);
- if (m.find())
- {
- final String name = m.group(1).toLowerCase();
- final String body = m.group(2);
- String ending = m.group(3);
-
- // debug( "in a starting tag, name='" + name + "'; body='" + body + "'; ending='" + ending + "'" );
- if (allowed(name))
- {
- final StringBuilder params = new StringBuilder();
-
- final Matcher m2 = P_QUOTED_ATTRIBUTES.matcher(body);
- final Matcher m3 = P_UNQUOTED_ATTRIBUTES.matcher(body);
- final List paramNames = new ArrayList<>();
- final List paramValues = new ArrayList<>();
- while (m2.find())
- {
- paramNames.add(m2.group(1)); // ([a-z0-9]+)
- paramValues.add(m2.group(3)); // (.*?)
- }
- while (m3.find())
- {
- paramNames.add(m3.group(1)); // ([a-z0-9]+)
- paramValues.add(m3.group(3)); // ([^\"\\s']+)
- }
-
- String paramName, paramValue;
- for (int ii = 0; ii < paramNames.size(); ii++)
- {
- paramName = paramNames.get(ii).toLowerCase();
- paramValue = paramValues.get(ii);
-
- // debug( "paramName='" + paramName + "'" );
- // debug( "paramValue='" + paramValue + "'" );
- // debug( "allowed? " + vAllowed.get( name ).contains( paramName ) );
-
- if (allowedAttribute(name, paramName))
- {
- if (inArray(paramName, vProtocolAtts))
- {
- paramValue = processParamProtocol(paramValue);
- }
- params.append(' ').append(paramName).append("=\"").append(paramValue).append("\"");
- }
- }
-
- if (inArray(name, vSelfClosingTags))
- {
- ending = " /";
- }
-
- if (inArray(name, vNeedClosingTags))
- {
- ending = "";
- }
-
- if (ending == null || ending.length() < 1)
- {
- if (vTagCounts.containsKey(name))
- {
- vTagCounts.put(name, vTagCounts.get(name) + 1);
- }
- else
- {
- vTagCounts.put(name, 1);
- }
- }
- else
- {
- ending = " /";
- }
- return "<" + name + params + ending + ">";
- }
- else
- {
- return "";
- }
- }
-
- // comments
- m = P_COMMENT.matcher(s);
- if (!stripComment && m.find())
- {
- return "<" + m.group() + ">";
- }
-
- return "";
- }
-
- private String processParamProtocol(String s)
- {
- s = decodeEntities(s);
- final Matcher m = P_PROTOCOL.matcher(s);
- if (m.find())
- {
- final String protocol = m.group(1);
- if (!inArray(protocol, vAllowedProtocols))
- {
- // bad protocol, turn into local anchor link instead
- s = "#" + s.substring(protocol.length() + 1);
- if (s.startsWith("#//"))
- {
- s = "#" + s.substring(3);
- }
- }
- }
-
- return s;
- }
-
- private String decodeEntities(String s)
- {
- StringBuffer buf = new StringBuffer();
-
- Matcher m = P_ENTITY.matcher(s);
- while (m.find())
- {
- final String match = m.group(1);
- final int decimal = Integer.decode(match).intValue();
- m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal)));
- }
- m.appendTail(buf);
- s = buf.toString();
-
- buf = new StringBuffer();
- m = P_ENTITY_UNICODE.matcher(s);
- while (m.find())
- {
- final String match = m.group(1);
- final int decimal = Integer.valueOf(match, 16).intValue();
- m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal)));
- }
- m.appendTail(buf);
- s = buf.toString();
-
- buf = new StringBuffer();
- m = P_ENCODE.matcher(s);
- while (m.find())
- {
- final String match = m.group(1);
- final int decimal = Integer.valueOf(match, 16).intValue();
- m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal)));
- }
- m.appendTail(buf);
- s = buf.toString();
-
- s = validateEntities(s);
- return s;
- }
-
- private String validateEntities(final String s)
- {
- StringBuffer buf = new StringBuffer();
-
- // validate entities throughout the string
- Matcher m = P_VALID_ENTITIES.matcher(s);
- while (m.find())
- {
- final String one = m.group(1); // ([^&;]*)
- final String two = m.group(2); // (?=(;|&|$))
- m.appendReplacement(buf, Matcher.quoteReplacement(checkEntity(one, two)));
- }
- m.appendTail(buf);
-
- return encodeQuotes(buf.toString());
- }
-
- private String encodeQuotes(final String s)
- {
- if (encodeQuotes)
- {
- StringBuffer buf = new StringBuffer();
- Matcher m = P_VALID_QUOTES.matcher(s);
- while (m.find())
- {
- final String one = m.group(1); // (>|^)
- final String two = m.group(2); // ([^<]+?)
- final String three = m.group(3); // (<|$)
- // 涓嶆浛鎹㈠弻寮曞彿涓"锛岄槻姝son鏍煎紡鏃犳晥 regexReplace(P_QUOTE, """, two)
- m.appendReplacement(buf, Matcher.quoteReplacement(one + two + three));
- }
- m.appendTail(buf);
- return buf.toString();
- }
- else
- {
- return s;
- }
- }
-
- private String checkEntity(final String preamble, final String term)
- {
-
- return ";".equals(term) && isValidEntity(preamble) ? '&' + preamble : "&" + preamble;
- }
-
- private boolean isValidEntity(final String entity)
- {
- return inArray(entity, vAllowedEntities);
- }
-
- private static boolean inArray(final String s, final String[] array)
- {
- for (String item : array)
- {
- if (item != null && item.equals(s))
- {
- return true;
- }
- }
- return false;
- }
-
- private boolean allowed(final String name)
- {
- return (vAllowed.isEmpty() || vAllowed.containsKey(name)) && !inArray(name, vDisallowed);
- }
-
- private boolean allowedAttribute(final String name, final String paramName)
- {
- return allowed(name) && (vAllowed.isEmpty() || vAllowed.get(name).contains(paramName));
- }
+package com.ruoyi.common.utils.html;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * HTML杩囨护鍣紝鐢ㄤ簬鍘婚櫎XSS婕忔礊闅愭偅銆
+ *
+ * @author ruoyi
+ */
+public final class HTMLFilter
+{
+ /**
+ * regex flag union representing /si modifiers in php
+ **/
+ private static final int REGEX_FLAGS_SI = Pattern.CASE_INSENSITIVE | Pattern.DOTALL;
+ private static final Pattern P_COMMENTS = Pattern.compile("", Pattern.DOTALL);
+ private static final Pattern P_COMMENT = Pattern.compile("^!--(.*)--$", REGEX_FLAGS_SI);
+ private static final Pattern P_TAGS = Pattern.compile("<(.*?)>", Pattern.DOTALL);
+ private static final Pattern P_END_TAG = Pattern.compile("^/([a-z0-9]+)", REGEX_FLAGS_SI);
+ private static final Pattern P_START_TAG = Pattern.compile("^([a-z0-9]+)(.*?)(/?)$", REGEX_FLAGS_SI);
+ private static final Pattern P_QUOTED_ATTRIBUTES = Pattern.compile("([a-z0-9]+)=([\"'])(.*?)\\2", REGEX_FLAGS_SI);
+ private static final Pattern P_UNQUOTED_ATTRIBUTES = Pattern.compile("([a-z0-9]+)(=)([^\"\\s']+)", REGEX_FLAGS_SI);
+ private static final Pattern P_PROTOCOL = Pattern.compile("^([^:]+):", REGEX_FLAGS_SI);
+ private static final Pattern P_ENTITY = Pattern.compile("(\\d+);?");
+ private static final Pattern P_ENTITY_UNICODE = Pattern.compile("([0-9a-f]+);?");
+ private static final Pattern P_ENCODE = Pattern.compile("%([0-9a-f]{2});?");
+ private static final Pattern P_VALID_ENTITIES = Pattern.compile("&([^&;]*)(?=(;|&|$))");
+ private static final Pattern P_VALID_QUOTES = Pattern.compile("(>|^)([^<]+?)(<|$)", Pattern.DOTALL);
+ private static final Pattern P_END_ARROW = Pattern.compile("^>");
+ private static final Pattern P_BODY_TO_END = Pattern.compile("<([^>]*?)(?=<|$)");
+ private static final Pattern P_XML_CONTENT = Pattern.compile("(^|>)([^<]*?)(?=>)");
+ private static final Pattern P_STRAY_LEFT_ARROW = Pattern.compile("<([^>]*?)(?=<|$)");
+ private static final Pattern P_STRAY_RIGHT_ARROW = Pattern.compile("(^|>)([^<]*?)(?=>)");
+ private static final Pattern P_AMP = Pattern.compile("&");
+ private static final Pattern P_QUOTE = Pattern.compile("\"");
+ private static final Pattern P_LEFT_ARROW = Pattern.compile("<");
+ private static final Pattern P_RIGHT_ARROW = Pattern.compile(">");
+ private static final Pattern P_BOTH_ARROWS = Pattern.compile("<>");
+
+ // @xxx could grow large... maybe use sesat's ReferenceMap
+ private static final ConcurrentMap P_REMOVE_PAIR_BLANKS = new ConcurrentHashMap<>();
+ private static final ConcurrentMap P_REMOVE_SELF_BLANKS = new ConcurrentHashMap<>();
+
+ /**
+ * set of allowed html elements, along with allowed attributes for each element
+ **/
+ private final Map> vAllowed;
+ /**
+ * counts of open tags for each (allowable) html element
+ **/
+ private final Map vTagCounts = new HashMap<>();
+
+ /**
+ * html elements which must always be self-closing (e.g. "")
+ **/
+ private final String[] vSelfClosingTags;
+ /**
+ * html elements which must always have separate opening and closing tags (e.g. "")
+ **/
+ private final String[] vNeedClosingTags;
+ /**
+ * set of disallowed html elements
+ **/
+ private final String[] vDisallowed;
+ /**
+ * attributes which should be checked for valid protocols
+ **/
+ private final String[] vProtocolAtts;
+ /**
+ * allowed protocols
+ **/
+ private final String[] vAllowedProtocols;
+ /**
+ * tags which should be removed if they contain no content (e.g. "" or "")
+ **/
+ private final String[] vRemoveBlanks;
+ /**
+ * entities allowed within html markup
+ **/
+ private final String[] vAllowedEntities;
+ /**
+ * flag determining whether comments are allowed in input String.
+ */
+ private final boolean stripComment;
+ private final boolean encodeQuotes;
+ /**
+ * flag determining whether to try to make tags when presented with "unbalanced" angle brackets (e.g. ""
+ * becomes " text "). If set to false, unbalanced angle brackets will be html escaped.
+ */
+ private final boolean alwaysMakeTags;
+
+ /**
+ * Default constructor.
+ */
+ public HTMLFilter()
+ {
+ vAllowed = new HashMap<>();
+
+ final ArrayList a_atts = new ArrayList<>();
+ a_atts.add("href");
+ a_atts.add("target");
+ vAllowed.put("a", a_atts);
+
+ final ArrayList img_atts = new ArrayList<>();
+ img_atts.add("src");
+ img_atts.add("width");
+ img_atts.add("height");
+ img_atts.add("alt");
+ vAllowed.put("img", img_atts);
+
+ final ArrayList no_atts = new ArrayList<>();
+ vAllowed.put("b", no_atts);
+ vAllowed.put("strong", no_atts);
+ vAllowed.put("i", no_atts);
+ vAllowed.put("em", no_atts);
+
+ vSelfClosingTags = new String[] { "img" };
+ vNeedClosingTags = new String[] { "a", "b", "strong", "i", "em" };
+ vDisallowed = new String[] {};
+ vAllowedProtocols = new String[] { "http", "mailto", "https" }; // no ftp.
+ vProtocolAtts = new String[] { "src", "href" };
+ vRemoveBlanks = new String[] { "a", "b", "strong", "i", "em" };
+ vAllowedEntities = new String[] { "amp", "gt", "lt", "quot" };
+ stripComment = true;
+ encodeQuotes = true;
+ alwaysMakeTags = true;
+ }
+
+ /**
+ * Map-parameter configurable constructor.
+ *
+ * @param conf map containing configuration. keys match field names.
+ */
+ @SuppressWarnings("unchecked")
+ public HTMLFilter(final Map conf)
+ {
+
+ assert conf.containsKey("vAllowed") : "configuration requires vAllowed";
+ assert conf.containsKey("vSelfClosingTags") : "configuration requires vSelfClosingTags";
+ assert conf.containsKey("vNeedClosingTags") : "configuration requires vNeedClosingTags";
+ assert conf.containsKey("vDisallowed") : "configuration requires vDisallowed";
+ assert conf.containsKey("vAllowedProtocols") : "configuration requires vAllowedProtocols";
+ assert conf.containsKey("vProtocolAtts") : "configuration requires vProtocolAtts";
+ assert conf.containsKey("vRemoveBlanks") : "configuration requires vRemoveBlanks";
+ assert conf.containsKey("vAllowedEntities") : "configuration requires vAllowedEntities";
+
+ vAllowed = Collections.unmodifiableMap((HashMap>) conf.get("vAllowed"));
+ vSelfClosingTags = (String[]) conf.get("vSelfClosingTags");
+ vNeedClosingTags = (String[]) conf.get("vNeedClosingTags");
+ vDisallowed = (String[]) conf.get("vDisallowed");
+ vAllowedProtocols = (String[]) conf.get("vAllowedProtocols");
+ vProtocolAtts = (String[]) conf.get("vProtocolAtts");
+ vRemoveBlanks = (String[]) conf.get("vRemoveBlanks");
+ vAllowedEntities = (String[]) conf.get("vAllowedEntities");
+ stripComment = conf.containsKey("stripComment") ? (Boolean) conf.get("stripComment") : true;
+ encodeQuotes = conf.containsKey("encodeQuotes") ? (Boolean) conf.get("encodeQuotes") : true;
+ alwaysMakeTags = conf.containsKey("alwaysMakeTags") ? (Boolean) conf.get("alwaysMakeTags") : true;
+ }
+
+ private void reset()
+ {
+ vTagCounts.clear();
+ }
+
+ // ---------------------------------------------------------------
+ // my versions of some PHP library functions
+ public static String chr(final int decimal)
+ {
+ return String.valueOf((char) decimal);
+ }
+
+ public static String htmlSpecialChars(final String s)
+ {
+ String result = s;
+ result = regexReplace(P_AMP, "&", result);
+ result = regexReplace(P_QUOTE, """, result);
+ result = regexReplace(P_LEFT_ARROW, "<", result);
+ result = regexReplace(P_RIGHT_ARROW, ">", result);
+ return result;
+ }
+
+ // ---------------------------------------------------------------
+
+ /**
+ * given a user submitted input String, filter out any invalid or restricted html.
+ *
+ * @param input text (i.e. submitted by a user) than may contain html
+ * @return "clean" version of input, with only valid, whitelisted html elements allowed
+ */
+ public String filter(final String input)
+ {
+ reset();
+ String s = input;
+
+ s = escapeComments(s);
+
+ s = balanceHTML(s);
+
+ s = checkTags(s);
+
+ s = processRemoveBlanks(s);
+
+ s = validateEntities(s);
+
+ return s;
+ }
+
+ public boolean isAlwaysMakeTags()
+ {
+ return alwaysMakeTags;
+ }
+
+ public boolean isStripComments()
+ {
+ return stripComment;
+ }
+
+ private String escapeComments(final String s)
+ {
+ final Matcher m = P_COMMENTS.matcher(s);
+ final StringBuffer buf = new StringBuffer();
+ if (m.find())
+ {
+ final String match = m.group(1); // (.*?)
+ m.appendReplacement(buf, Matcher.quoteReplacement(""));
+ }
+ m.appendTail(buf);
+
+ return buf.toString();
+ }
+
+ private String balanceHTML(String s)
+ {
+ if (alwaysMakeTags)
+ {
+ //
+ // try and form html
+ //
+ s = regexReplace(P_END_ARROW, "", s);
+ s = regexReplace(P_BODY_TO_END, "<$1>", s);
+ s = regexReplace(P_XML_CONTENT, "$1<$2", s);
+
+ }
+ else
+ {
+ //
+ // escape stray brackets
+ //
+ s = regexReplace(P_STRAY_LEFT_ARROW, "<$1", s);
+ s = regexReplace(P_STRAY_RIGHT_ARROW, "$1$2><", s);
+
+ //
+ // the last regexp causes '<>' entities to appear
+ // (we need to do a lookahead assertion so that the last bracket can
+ // be used in the next pass of the regexp)
+ //
+ s = regexReplace(P_BOTH_ARROWS, "", s);
+ }
+
+ return s;
+ }
+
+ private String checkTags(String s)
+ {
+ Matcher m = P_TAGS.matcher(s);
+
+ final StringBuffer buf = new StringBuffer();
+ while (m.find())
+ {
+ String replaceStr = m.group(1);
+ replaceStr = processTag(replaceStr);
+ m.appendReplacement(buf, Matcher.quoteReplacement(replaceStr));
+ }
+ m.appendTail(buf);
+
+ // these get tallied in processTag
+ // (remember to reset before subsequent calls to filter method)
+ final StringBuilder sBuilder = new StringBuilder(buf.toString());
+ for (String key : vTagCounts.keySet())
+ {
+ for (int ii = 0; ii < vTagCounts.get(key); ii++)
+ {
+ sBuilder.append("").append(key).append(">");
+ }
+ }
+ s = sBuilder.toString();
+
+ return s;
+ }
+
+ private String processRemoveBlanks(final String s)
+ {
+ String result = s;
+ for (String tag : vRemoveBlanks)
+ {
+ if (!P_REMOVE_PAIR_BLANKS.containsKey(tag))
+ {
+ P_REMOVE_PAIR_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?>" + tag + ">"));
+ }
+ result = regexReplace(P_REMOVE_PAIR_BLANKS.get(tag), "", result);
+ if (!P_REMOVE_SELF_BLANKS.containsKey(tag))
+ {
+ P_REMOVE_SELF_BLANKS.putIfAbsent(tag, Pattern.compile("<" + tag + "(\\s[^>]*)?/>"));
+ }
+ result = regexReplace(P_REMOVE_SELF_BLANKS.get(tag), "", result);
+ }
+
+ return result;
+ }
+
+ private static String regexReplace(final Pattern regex_pattern, final String replacement, final String s)
+ {
+ Matcher m = regex_pattern.matcher(s);
+ return m.replaceAll(replacement);
+ }
+
+ private String processTag(final String s)
+ {
+ // ending tags
+ Matcher m = P_END_TAG.matcher(s);
+ if (m.find())
+ {
+ final String name = m.group(1).toLowerCase();
+ if (allowed(name))
+ {
+ if (false == inArray(name, vSelfClosingTags))
+ {
+ if (vTagCounts.containsKey(name))
+ {
+ vTagCounts.put(name, vTagCounts.get(name) - 1);
+ return "" + name + ">";
+ }
+ }
+ }
+ }
+
+ // starting tags
+ m = P_START_TAG.matcher(s);
+ if (m.find())
+ {
+ final String name = m.group(1).toLowerCase();
+ final String body = m.group(2);
+ String ending = m.group(3);
+
+ // debug( "in a starting tag, name='" + name + "'; body='" + body + "'; ending='" + ending + "'" );
+ if (allowed(name))
+ {
+ final StringBuilder params = new StringBuilder();
+
+ final Matcher m2 = P_QUOTED_ATTRIBUTES.matcher(body);
+ final Matcher m3 = P_UNQUOTED_ATTRIBUTES.matcher(body);
+ final List paramNames = new ArrayList<>();
+ final List paramValues = new ArrayList<>();
+ while (m2.find())
+ {
+ paramNames.add(m2.group(1)); // ([a-z0-9]+)
+ paramValues.add(m2.group(3)); // (.*?)
+ }
+ while (m3.find())
+ {
+ paramNames.add(m3.group(1)); // ([a-z0-9]+)
+ paramValues.add(m3.group(3)); // ([^\"\\s']+)
+ }
+
+ String paramName, paramValue;
+ for (int ii = 0; ii < paramNames.size(); ii++)
+ {
+ paramName = paramNames.get(ii).toLowerCase();
+ paramValue = paramValues.get(ii);
+
+ // debug( "paramName='" + paramName + "'" );
+ // debug( "paramValue='" + paramValue + "'" );
+ // debug( "allowed? " + vAllowed.get( name ).contains( paramName ) );
+
+ if (allowedAttribute(name, paramName))
+ {
+ if (inArray(paramName, vProtocolAtts))
+ {
+ paramValue = processParamProtocol(paramValue);
+ }
+ params.append(' ').append(paramName).append("=\"").append(paramValue).append("\"");
+ }
+ }
+
+ if (inArray(name, vSelfClosingTags))
+ {
+ ending = " /";
+ }
+
+ if (inArray(name, vNeedClosingTags))
+ {
+ ending = "";
+ }
+
+ if (ending == null || ending.length() < 1)
+ {
+ if (vTagCounts.containsKey(name))
+ {
+ vTagCounts.put(name, vTagCounts.get(name) + 1);
+ }
+ else
+ {
+ vTagCounts.put(name, 1);
+ }
+ }
+ else
+ {
+ ending = " /";
+ }
+ return "<" + name + params + ending + ">";
+ }
+ else
+ {
+ return "";
+ }
+ }
+
+ // comments
+ m = P_COMMENT.matcher(s);
+ if (!stripComment && m.find())
+ {
+ return "<" + m.group() + ">";
+ }
+
+ return "";
+ }
+
+ private String processParamProtocol(String s)
+ {
+ s = decodeEntities(s);
+ final Matcher m = P_PROTOCOL.matcher(s);
+ if (m.find())
+ {
+ final String protocol = m.group(1);
+ if (!inArray(protocol, vAllowedProtocols))
+ {
+ // bad protocol, turn into local anchor link instead
+ s = "#" + s.substring(protocol.length() + 1);
+ if (s.startsWith("#//"))
+ {
+ s = "#" + s.substring(3);
+ }
+ }
+ }
+
+ return s;
+ }
+
+ private String decodeEntities(String s)
+ {
+ StringBuffer buf = new StringBuffer();
+
+ Matcher m = P_ENTITY.matcher(s);
+ while (m.find())
+ {
+ final String match = m.group(1);
+ final int decimal = Integer.decode(match).intValue();
+ m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal)));
+ }
+ m.appendTail(buf);
+ s = buf.toString();
+
+ buf = new StringBuffer();
+ m = P_ENTITY_UNICODE.matcher(s);
+ while (m.find())
+ {
+ final String match = m.group(1);
+ final int decimal = Integer.valueOf(match, 16).intValue();
+ m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal)));
+ }
+ m.appendTail(buf);
+ s = buf.toString();
+
+ buf = new StringBuffer();
+ m = P_ENCODE.matcher(s);
+ while (m.find())
+ {
+ final String match = m.group(1);
+ final int decimal = Integer.valueOf(match, 16).intValue();
+ m.appendReplacement(buf, Matcher.quoteReplacement(chr(decimal)));
+ }
+ m.appendTail(buf);
+ s = buf.toString();
+
+ s = validateEntities(s);
+ return s;
+ }
+
+ private String validateEntities(final String s)
+ {
+ StringBuffer buf = new StringBuffer();
+
+ // validate entities throughout the string
+ Matcher m = P_VALID_ENTITIES.matcher(s);
+ while (m.find())
+ {
+ final String one = m.group(1); // ([^&;]*)
+ final String two = m.group(2); // (?=(;|&|$))
+ m.appendReplacement(buf, Matcher.quoteReplacement(checkEntity(one, two)));
+ }
+ m.appendTail(buf);
+
+ return encodeQuotes(buf.toString());
+ }
+
+ private String encodeQuotes(final String s)
+ {
+ if (encodeQuotes)
+ {
+ StringBuffer buf = new StringBuffer();
+ Matcher m = P_VALID_QUOTES.matcher(s);
+ while (m.find())
+ {
+ final String one = m.group(1); // (>|^)
+ final String two = m.group(2); // ([^<]+?)
+ final String three = m.group(3); // (<|$)
+ // 涓嶆浛鎹㈠弻寮曞彿涓"锛岄槻姝son鏍煎紡鏃犳晥 regexReplace(P_QUOTE, """, two)
+ m.appendReplacement(buf, Matcher.quoteReplacement(one + two + three));
+ }
+ m.appendTail(buf);
+ return buf.toString();
+ }
+ else
+ {
+ return s;
+ }
+ }
+
+ private String checkEntity(final String preamble, final String term)
+ {
+
+ return ";".equals(term) && isValidEntity(preamble) ? '&' + preamble : "&" + preamble;
+ }
+
+ private boolean isValidEntity(final String entity)
+ {
+ return inArray(entity, vAllowedEntities);
+ }
+
+ private static boolean inArray(final String s, final String[] array)
+ {
+ for (String item : array)
+ {
+ if (item != null && item.equals(s))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean allowed(final String name)
+ {
+ return (vAllowed.isEmpty() || vAllowed.containsKey(name)) && !inArray(name, vDisallowed);
+ }
+
+ private boolean allowedAttribute(final String name, final String paramName)
+ {
+ return allowed(name) && (vAllowed.isEmpty() || vAllowed.get(name).contains(paramName));
+ }
}
\ No newline at end of file
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java
similarity index 88%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java
index dcf1b8f..e34fa5a 100644
--- a/ruoyi/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java
@@ -1,55 +1,55 @@
-package com.ruoyi.common.utils.http;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.nio.charset.Charset;
-import javax.servlet.ServletRequest;
-import org.apache.commons.lang.exception.ExceptionUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * 閫氱敤http宸ュ叿灏佽
- *
- * @author ruoyi
- */
-public class HttpHelper
-{
- private static final Logger LOGGER = LoggerFactory.getLogger(HttpHelper.class);
-
- public static String getBodyString(ServletRequest request)
- {
- StringBuilder sb = new StringBuilder();
- BufferedReader reader = null;
- try (InputStream inputStream = request.getInputStream())
- {
- reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("UTF-8")));
- String line = "";
- while ((line = reader.readLine()) != null)
- {
- sb.append(line);
- }
- }
- catch (IOException e)
- {
- LOGGER.warn("getBodyString鍑虹幇闂锛");
- }
- finally
- {
- if (reader != null)
- {
- try
- {
- reader.close();
- }
- catch (IOException e)
- {
- LOGGER.error(ExceptionUtils.getFullStackTrace(e));
- }
- }
- }
- return sb.toString();
- }
-}
+package com.ruoyi.common.utils.http;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.nio.charset.Charset;
+import javax.servlet.ServletRequest;
+import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * 閫氱敤http宸ュ叿灏佽
+ *
+ * @author ruoyi
+ */
+public class HttpHelper
+{
+ private static final Logger LOGGER = LoggerFactory.getLogger(HttpHelper.class);
+
+ public static String getBodyString(ServletRequest request)
+ {
+ StringBuilder sb = new StringBuilder();
+ BufferedReader reader = null;
+ try (InputStream inputStream = request.getInputStream())
+ {
+ reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("UTF-8")));
+ String line = "";
+ while ((line = reader.readLine()) != null)
+ {
+ sb.append(line);
+ }
+ }
+ catch (IOException e)
+ {
+ LOGGER.warn("getBodyString鍑虹幇闂锛");
+ }
+ finally
+ {
+ if (reader != null)
+ {
+ try
+ {
+ reader.close();
+ }
+ catch (IOException e)
+ {
+ LOGGER.error(ExceptionUtils.getMessage(e));
+ }
+ }
+ }
+ return sb.toString();
+ }
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java
similarity index 93%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java
index c36431f..11faa32 100644
--- a/ruoyi/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java
@@ -3,10 +3,10 @@ package com.ruoyi.common.utils.ip;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.fastjson.JSONObject;
+import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.http.HttpUtils;
-import com.ruoyi.framework.config.RuoYiConfig;
/**
* 鑾峰彇鍦板潃绫
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java
similarity index 100%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java
diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
similarity index 95%
rename from ruoyi/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
rename to ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
index 3211ac5..f4947e0 100644
--- a/ruoyi/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
@@ -1,875 +1,875 @@
-package com.ruoyi.common.utils.poi;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.math.BigDecimal;
-import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import java.util.stream.Collectors;
-import org.apache.poi.hssf.usermodel.HSSFDateUtil;
-import org.apache.poi.ss.usermodel.BorderStyle;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.CellType;
-import org.apache.poi.ss.usermodel.DataValidation;
-import org.apache.poi.ss.usermodel.DataValidationConstraint;
-import org.apache.poi.ss.usermodel.DataValidationHelper;
-import org.apache.poi.ss.usermodel.DateUtil;
-import org.apache.poi.ss.usermodel.FillPatternType;
-import org.apache.poi.ss.usermodel.Font;
-import org.apache.poi.ss.usermodel.HorizontalAlignment;
-import org.apache.poi.ss.usermodel.IndexedColors;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.VerticalAlignment;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.ss.usermodel.WorkbookFactory;
-import org.apache.poi.ss.util.CellRangeAddressList;
-import org.apache.poi.xssf.streaming.SXSSFWorkbook;
-import org.apache.poi.xssf.usermodel.XSSFDataValidation;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import com.ruoyi.common.core.text.Convert;
-import com.ruoyi.common.exception.CustomException;
-import com.ruoyi.common.utils.DateUtils;
-import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.common.utils.reflect.ReflectUtils;
-import com.ruoyi.framework.aspectj.lang.annotation.Excel;
-import com.ruoyi.framework.aspectj.lang.annotation.Excel.ColumnType;
-import com.ruoyi.framework.aspectj.lang.annotation.Excel.Type;
-import com.ruoyi.framework.aspectj.lang.annotation.Excels;
-import com.ruoyi.framework.config.RuoYiConfig;
-import com.ruoyi.framework.web.domain.AjaxResult;
-
-/**
- * Excel鐩稿叧澶勭悊
- *
- * @author ruoyi
- */
-public class ExcelUtil
-{
- private static final Logger log = LoggerFactory.getLogger(ExcelUtil.class);
-
- /**
- * Excel sheet鏈澶ц鏁帮紝榛樿65536
- */
- public static final int sheetSize = 65536;
-
- /**
- * 宸ヤ綔琛ㄥ悕绉
- */
- private String sheetName;
-
- /**
- * 瀵煎嚭绫诲瀷锛圗XPORT:瀵煎嚭鏁版嵁锛汭MPORT锛氬鍏ユā鏉匡級
- */
- private Type type;
-
- /**
- * 宸ヤ綔钖勫璞
- */
- private Workbook wb;
-
- /**
- * 宸ヤ綔琛ㄥ璞
- */
- private Sheet sheet;
-
- /**
- * 鏍峰紡鍒楄〃
- */
- private Map styles;
-
- /**
- * 瀵煎叆瀵煎嚭鏁版嵁鍒楄〃
- */
- private List list;
-
- /**
- * 娉ㄨВ鍒楄〃
- */
- private List