Compare commits

...

157 Commits

Author SHA1 Message Date
李佳航
0de59dd77d Merge pull request #70 from dromara/dev
Dev
2024-12-10 09:58:59 +08:00
lijiahang
d0b25c38a6 Merge remote-tracking branch 'origin/dev' into dev 2024-12-09 15:28:11 +08:00
lijiahang
9fe2531d2f 📝 修改介绍. 2024-12-09 15:28:03 +08:00
lijiahangmax
28ce2317c0 merge dev into dev
合并

Created-by: liushaoshuai
Author-id: 3003091
MR-id: 5446172
Commit-by: liushaoshuai
Merged-by: lijiahangmax
E2E-issues: 
Description: ⬆️ 升级 orion-kit 版本. 

See merge request: dromara/orion-visor!15
2024-12-09 15:25:26 +08:00
liushaoshuai
f38ae06fa0 ⬆️ 升级 orion-kit 版本.
Signed-off-by: liushaoshuai <liushaoshuai@noreply.gitcode.com>
2024-12-09 15:23:27 +08:00
lijiahangmax
e434d85ea5 merge dev into dev
修改文档

Created-by: liushaoshuai
Author-id: 3003091
MR-id: 5361842
Commit-by: liushaoshuai
Merged-by: lijiahangmax
E2E-issues: 
Description: 📝修改文档. 

See merge request: dromara/orion-visor!14
2024-12-06 13:59:08 +08:00
liushaoshuai
d303406332 📝修改文档.
Signed-off-by: liushaoshuai <liushaoshuai@noreply.gitcode.com>
2024-12-06 13:58:09 +08:00
lijiahangmax
952d63b282 merge dev into dev
PR#1

Created-by: SuperOwn
Author-id: 3000065
MR-id: 5350395
Commit-by: SuperOwn
Merged-by: lijiahangmax
E2E-issues: 
Description: 🔖 升级版本. 

See merge request: dromara/orion-visor!13
2024-12-06 12:11:59 +08:00
SuperOwn
cffb3c9e90 🔖 升级版本.
Signed-off-by: SuperOwn <SuperOwn@noreply.gitcode.com>
2024-12-06 12:10:56 +08:00
lijiahangmax
d828d4a754 merge dev into dev
升级版本

Created-by: orionsec
Author-id: 3000702
MR-id: 5345512
Commit-by: orionsec
Merged-by: lijiahangmax
E2E-issues: 
Description: 🔖 升级版本. 

See merge request: dromara/orion-visor!12
2024-12-06 11:41:29 +08:00
orionsec
30ff601078 🔖 升级版本.
Signed-off-by: orionsec <orionsec@noreply.gitcode.com>
2024-12-06 11:40:36 +08:00
lijiahangmax
eb18f4281a merge dev into dev
禁用缓存

Created-by: orionsec
Author-id: 3000702
MR-id: 5345037
Commit-by: orionsec
Merged-by: lijiahangmax
E2E-issues: 
Description: 🔖 升级版本. 
🐳 禁用缓存. 

See merge request: dromara/orion-visor!11
2024-12-06 11:37:45 +08:00
orionsec
b850aa1f7f 🐳 禁用缓存.
Signed-off-by: orionsec <orionsec@noreply.gitcode.com>
2024-12-06 11:36:50 +08:00
orionsec
100b5e8740 🔖 升级版本.
Signed-off-by: orionsec <orionsec@noreply.gitcode.com>
2024-12-06 11:36:25 +08:00
lijiahangmax
148d9f1201 merge dev into dev
PR

Created-by: orionsec
Author-id: 3000702
MR-id: 5344615
Commit-by: orionsec
Merged-by: lijiahangmax
E2E-issues: 
Description: 🔖 升级版本. 

See merge request: dromara/orion-visor!10
2024-12-06 11:33:29 +08:00
orionsec
88ddc7c4b2 🔖 升级版本.
Signed-off-by: orionsec <orionsec@noreply.gitcode.com>
2024-12-06 11:31:10 +08:00
lijiahangmax
4a2c01fba6 merge dev into dev
merge

Created-by: SuperOwn
Author-id: 3000065
MR-id: 5343257
Commit-by: SuperOwn
Merged-by: lijiahangmax
E2E-issues: 
Description: 🔖 升级版本. 

See merge request: dromara/orion-visor!8
2024-12-06 11:20:14 +08:00
SuperOwn
45c83f6080 🔖 升级版本.
Signed-off-by: SuperOwn <SuperOwn@noreply.gitcode.com>
2024-12-06 11:19:27 +08:00
lijiahangmax
08a0eeb6b5 merge dev into dev
修改版本

Created-by: SuperOwn
Author-id: 3000065
MR-id: 5343027
Commit-by: SuperOwn
Merged-by: lijiahangmax
E2E-issues: 
Description: 🔖 升级版本. 

See merge request: dromara/orion-visor!7
2024-12-06 11:18:31 +08:00
SuperOwn
73b034b27c 🔖 升级版本.
Signed-off-by: SuperOwn <SuperOwn@noreply.gitcode.com>
2024-12-06 11:16:06 +08:00
lijiahang
95a31d613d Merge remote-tracking branch 'origin/dev' into dev 2024-12-06 10:53:44 +08:00
lijiahangmax
8027d39938 merge dev into dev
merge

Created-by: chaoyuyu
Author-id: 2987168
MR-id: 5338562
Commit-by: chaoyuyu
Merged-by: lijiahangmax
E2E-issues: 
Description: update: 更新文件 build.sh 

See merge request: dromara/orion-visor!5
2024-12-06 10:51:33 +08:00
chaoyuyu
e3d33295fe update: 更新文件 build.sh
Signed-off-by: chaoyuyu <chaoyuyu@noreply.gitcode.com>
2024-12-06 10:46:09 +08:00
lijiahangmax
691c61613f merge dev into dev
合并

Created-by: opensources
Author-id: 2983898
MR-id: 5338447
Commit-by: opensources
Merged-by: lijiahangmax
E2E-issues: 
Description: 🐳 修改 docker 版本. 
🔖 升级版本. 

See merge request: dromara/orion-visor!4
2024-12-06 10:42:56 +08:00
opensources
a75ce2143d 🔖 升级版本.
Signed-off-by: opensources <opensources@noreply.gitcode.com>
2024-12-06 10:35:37 +08:00
opensources
cb828e5684 🐳 修改 docker 版本.
Signed-off-by: opensources <opensources@noreply.gitcode.com>
2024-12-06 10:34:30 +08:00
lijiahangmax
168f193416 merge dev into dev
修改 docker

Created-by: opensources
Author-id: 2983898
MR-id: 5338443
Commit-by: opensources
Merged-by: lijiahangmax
E2E-issues: 
Description: 🐳 修改版本. 

See merge request: dromara/orion-visor!3
2024-12-06 10:32:00 +08:00
opensources
211a50d33d 🐳 修改版本.
Signed-off-by: opensources <opensources@noreply.gitcode.com>
2024-12-06 10:31:17 +08:00
lijiahangmax
713af9d032 merge dev into dev
升级版本

Created-by: chaoyuyu
Author-id: 2987168
MR-id: 5338426
Commit-by: chaoyuyu
Merged-by: lijiahangmax
E2E-issues: 
Description: 🔖 升级版本. 

See merge request: dromara/orion-visor!2
2024-12-06 10:29:14 +08:00
chaoyuyu
214b6fe9ac 🔖 升级版本.
Signed-off-by: chaoyuyu <chaoyuyu@noreply.gitcode.com>
2024-12-06 10:25:02 +08:00
lijiahangmax
343c188749 merge dev into dev
merge

Created-by: Hanner
Author-id: 2987512
MR-id: 5338327
Commit-by: Hanner
Merged-by: lijiahangmax
E2E-issues: 
Description: 🔖 升级版本. 
update: 更新文件 pom.xml 
🔖 升级版本. 

See merge request: dromara/orion-visor!1
2024-12-06 10:14:32 +08:00
Hanner
fc6418caf3 🔖 升级版本.
Signed-off-by: Hanner <Hanner@noreply.gitcode.com>
2024-12-06 10:11:51 +08:00
Hanner
cf093e1023 update: 更新文件 pom.xml
Signed-off-by: Hanner <Hanner@noreply.gitcode.com>
2024-12-06 10:10:27 +08:00
Hanner
90eb6003c9 🔖 升级版本.
Signed-off-by: Hanner <Hanner@noreply.gitcode.com>
2024-12-06 10:08:54 +08:00
lijiahang
652691b32b 📝 修改 README. 2024-12-04 11:37:36 +08:00
lijiahang
eb77f33574 去除轮询接口错误信息. 2024-12-03 11:28:58 +08:00
lijiahang
9bfd5888bf 修改代码生成器. 2024-11-25 10:23:40 +08:00
lijiahang
73c18c79b8 🐛 计划任务创建后会自动执行. 2024-11-13 10:00:25 +08:00
lijiahang
562052b868 优化前端代码语义. 2024-11-07 10:46:17 +08:00
李佳航
6f42d41344 Merge pull request #65 from dromara/dev
merge
2024-11-01 10:41:52 +08:00
lijiahang
8db677684d 修改包名. 2024-10-29 09:59:50 +08:00
李佳航
988528ccca Merge pull request #64 from dromara/dev
Dev
2024-10-24 11:13:17 +08:00
lijiahang
029a46c07d 🔖 升级版本. 2024-10-24 09:36:05 +08:00
lijiahang
8ace3ddd1f 🐛 代码生成器无法运行. 2024-10-18 18:16:41 +08:00
lijiahang
2c705f0b67 🐛 代码生成器无法运行. 2024-10-18 14:06:28 +08:00
lijiahang
3ec43bd8a5 拆分模块. 2024-10-17 15:25:45 +08:00
lijiahang
b33abd3196 拆分模块. 2024-10-17 10:20:04 +08:00
lijiahang
d82f5b4bfb 拆分模块. 2024-10-16 15:37:12 +08:00
lijiahang
3e41e17367 优化模块值. 2024-10-15 17:41:39 +08:00
lijiahang
6e3abab232 📝 修改文档. 2024-10-15 15:05:11 +08:00
lijiahang
6306baa51a 修改表名. 2024-10-15 12:36:11 +08:00
lijiahang
7ceb7e162a 📝 修改文档. 2024-10-15 11:08:21 +08:00
lijiahang
2243d3cf5b 📝 添加 license 文件头. 2024-10-11 14:58:06 +08:00
lijiahang
e6937d67c1 📝 修改许可信息. 2024-10-11 12:23:05 +08:00
lijiahangmax
6e977dabf6 优化文件下载逻辑. 2024-10-10 23:18:53 +08:00
lijiahang
c229029c1d 系统动态设置. 2024-10-10 18:32:40 +08:00
lijiahang
76aa64fe75 📝 修改初始化sql. 2024-09-30 10:25:14 +08:00
lijiahang
3b1d6ab8a4 优化按钮组件逻辑. 2024-09-29 10:20:45 +08:00
李佳航
7015468e04 Merge pull request #60 from dromara/dev
Dev
2024-09-27 10:52:27 +08:00
lijiahang
ef57040e1d 📝 修改文档. 2024-09-27 10:41:06 +08:00
lijiahang
2a6537c604 🔖 升级版本. 2024-09-27 10:21:17 +08:00
lijiahang
541a9790ad 优化批量上传逻辑. 2024-09-26 17:38:39 +08:00
lijiahang
011e8ad089 📝 修改文档. 2024-09-14 17:18:51 +08:00
李佳航
3918d36c24 Merge pull request #59 from dromara/dev
Dev
2024-09-14 16:46:32 +08:00
lijiahang
37f452c7c3 Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
#	README.md
2024-09-14 16:44:31 +08:00
lijiahang
fc885bc0ad 📝 修改文档. 2024-09-14 16:43:53 +08:00
李佳航
44c226092d Merge pull request #58 from dromara/dev
Dev
2024-09-11 21:18:41 +08:00
lijiahangmax
14cf8c2492 Merge remote-tracking branch 'origin/dev' into dev 2024-09-11 21:16:08 +08:00
lijiahangmax
d6f5898e61 📝 修改 logo. 2024-09-11 21:14:32 +08:00
lijiahang
0ab8e405cc 📝 修改文档. 2024-09-11 10:18:35 +08:00
lijiahang
4e4231d5a5 修改清理限制. 2024-09-03 10:53:39 +08:00
李佳航
2df3f2fa1a Merge pull request #56 from dromara/dev
🔖 升级版本.
2024-09-02 15:28:10 +08:00
lijiahang
d6048f78f0 🔖 升级版本. 2024-09-02 14:57:47 +08:00
李佳航
f73fa14bfd Merge pull request #55 from dromara/dev
Dev
2024-09-02 13:11:36 +08:00
lijiahang
fd88c725d3 :replace: 修改 demo 地址. 2024-09-02 13:06:17 +08:00
lijiahang
3a16f9d9ab 优化查询逻辑. 2024-09-02 12:37:11 +08:00
lijiahang
de9b89d805 🔖 升级版本. 2024-09-02 11:51:30 +08:00
lijiahangmax
a05c387ba1 修改配置. 2024-08-29 23:34:28 +08:00
lijiahangmax
3cb6e5a2d4 修改配置. 2024-08-29 23:33:46 +08:00
lijiahang
104a9a0aa3 🔨 数据清理时添加条数限制. 2024-08-29 18:26:26 +08:00
lijiahangmax
d7b747eac4 优化主机删除逻辑. 2024-08-29 00:33:13 +08:00
lijiahangmax
d2949c11f3 Merge remote-tracking branch 'origin/dev' into dev 2024-08-29 00:23:33 +08:00
lijiahangmax
cd05f71173 🐛 修复开始 webgl 终端显示错误. 2024-08-29 00:23:11 +08:00
lijiahang
e0dca73369 📝 修改文档. 2024-08-28 17:14:18 +08:00
lijiahang
b8599a6693 🐛 修复加载缓存时报错. 2024-08-28 10:46:06 +08:00
lijiahang
a0adb415fa 🔨 数据清理时添加条数限制. 2024-08-26 17:10:40 +08:00
lijiahang
6c60756e54 禁用 demo api. 2024-08-26 13:57:18 +08:00
lijiahangmax
ee9f51ce7d 🐛 修复 quartz 配置不生效. 2024-08-25 00:50:16 +08:00
lijiahangmax
924b46b41a 优化异常信息获取逻辑. 2024-08-24 19:59:45 +08:00
lijiahangmax
1fca5a1912 优化数据分组逻辑. 2024-08-23 01:44:05 +08:00
李佳航
120eb1ee69 Merge pull request #54 from dromara/dev
Dev
2024-08-22 12:27:58 +08:00
lijiahang
252c538571 🔖 升级版本. 2024-08-22 11:45:24 +08:00
lijiahang
1eec373b7e demo 禁用定时任务. 2024-08-21 13:23:31 +08:00
lijiahang
aa9b96a9c1 修改表格显示字段. 2024-08-21 12:56:07 +08:00
lijiahang
059fb30aa4 优化权限逻辑. 2024-08-20 10:20:35 +08:00
lijiahang
2afaf7ad34 Merge remote-tracking branch 'origin/dev' into dev 2024-08-19 09:53:15 +08:00
lijiahang
076a0956c5 修改心跳检测时间. 2024-08-19 09:49:41 +08:00
lijiahangmax
4a91ec47bf 添加主题. 2024-08-13 20:56:00 +08:00
lijiahangmax
1066b43b3d 全屏模式. 2024-08-12 00:07:54 +08:00
lijiahangmax
3f78125c43 Merge remote-tracking branch 'origin/dev' into dev 2024-08-11 23:07:14 +08:00
lijiahangmax
144a44673b 🐛 修复更新菜单后查询条件错误. 2024-08-11 23:06:59 +08:00
李佳航
777f7b3758 Merge pull request #52 from dromara/dev
Dev
2024-08-08 10:52:09 +08:00
lijiahang
947fa0fea3 🐳 添加 push 脚本. 2024-08-08 10:17:31 +08:00
lijiahang
7109e89fb4 🔖 升级版本. 2024-08-08 10:14:39 +08:00
lijiahang
70e7b1d544 修改终端标签颜色显示. 2024-08-07 10:18:39 +08:00
lijiahangmax
613f86155c 💄 修改终端样式. 2024-08-06 00:01:27 +08:00
lijiahang
8d0b58e48f ⬆️ 升级 orion kit 版本. 2024-08-05 13:49:52 +08:00
lijiahang
8cea9dc977 优化终端代码. 2024-08-05 09:11:54 +08:00
lijiahangmax
471acfdf00 优化自动聚焦逻辑. 2024-08-04 17:01:44 +08:00
lijiahangmax
8ed42131d0 优化命令片段处理逻辑. 2024-08-02 01:52:29 +08:00
lijiahangmax
18c605354a 🔨 修改终端逻辑. 2024-07-31 00:42:02 +08:00
李佳航
8c04411458 Merge pull request #48 from MemoryShadow/dev
perf: Use the.env file instead to modify docker-compose.yml
2024-07-30 17:53:31 +08:00
lijiahang
9a8d1d05cd 💄 修改终端样式. 2024-07-30 14:40:15 +08:00
MemoryShadow
1cbaf9c424 docs: Clarify behavior semantics and accelerate deployment efficiency 2024-07-29 07:02:32 +00:00
MemoryShadow
537c2fc108 perf: Use the.env file instead to modify docker-compose.yml 2024-07-29 07:02:21 +00:00
李佳航
122b568cf5 Merge pull request #46 from dromara/dev
Dev
2024-07-29 11:39:00 +08:00
lijiahang
8b97c02d15 🐳 修改 docker 配置. 2024-07-29 11:15:44 +08:00
lijiahang
dcfb016ce5 🔖 升级版本. 2024-07-29 10:33:59 +08:00
lijiahang
c842de9e23 修改 hook 位置. 2024-07-29 10:25:11 +08:00
李佳航
1b2753a2b7 Merge pull request #44 from dromara/dev
Dev
2024-07-26 11:11:47 +08:00
lijiahang
29b44b8b77 🚨 修复 ts 构建报错. 2024-07-26 10:56:36 +08:00
lijiahang
7290b1364c 🔖 升级版本. 2024-07-26 10:25:38 +08:00
lijiahang
3851ead8bb 💄 修改滚动条样式. 2024-07-26 10:18:39 +08:00
lijiahang
305312cc26 🐛 修复文件上传列表显示错误. 2024-07-25 13:46:48 +08:00
李佳航
b4217555d2 Merge pull request #43 from dromara/dev
Dev
2024-07-25 11:16:59 +08:00
lijiahang
87b8e405f5 🔖 升级版本. 2024-07-25 10:27:49 +08:00
lijiahang
3513196a78 修改类型定义. 2024-07-24 15:29:15 +08:00
lijiahang
0240a12321 ⬆️ 修改升级sql. 2024-07-24 15:04:29 +08:00
lijiahang
3a8eac4d4a 重构终端功能. 2024-07-23 10:47:59 +08:00
lijiahang
4bd2de4ce2 🔨 重构主机模块. 2024-07-22 19:36:02 +08:00
lijiahang
b7608fccb3 🔨 修改主机逻辑. 2024-07-22 18:05:00 +08:00
lijiahang
bb925d354d 📝 修改 md 地址. 2024-07-22 10:37:11 +08:00
lijiahang
3a476d41d2 Merge remote-tracking branch 'origin/main'
# Conflicts:
#	README.md
2024-07-22 10:31:45 +08:00
lijiahang
1927b10bcc 📝 修改 md 地址. 2024-07-22 10:31:05 +08:00
lijiahang
0664eff151 🐛 windows 移动文件失败. 2024-07-22 10:27:21 +08:00
lijiahang
a71456b209 去除注解. 2024-07-18 15:39:31 +08:00
lijiahang
48d308b1a8 🐛 批量执行历史显示错误. 2024-07-17 13:38:51 +08:00
lijiahang
f75d097d8a 删除 http 文件. 2024-07-17 13:35:04 +08:00
lijiahang
0d46d81c4e 优化文件上传逻辑. 2024-07-15 10:15:20 +08:00
lijiahangmax
c20c83245f 🐛 修复 windows 文件备份失败. 2024-07-14 21:24:53 +08:00
lijiahangmax
849e010bc3 Merge remote-tracking branch 'origin/dev' into dev 2024-07-12 00:02:57 +08:00
lijiahangmax
95c299eea4 💄 修改主机编辑样式. 2024-07-12 00:02:45 +08:00
李佳航
ad3edd4ccd Merge pull request #41 from dromara/dev
Dev
2024-07-11 11:08:52 +08:00
lijiahang
81b7b3505e 🚀 修改启动命令. 2024-07-11 10:56:49 +08:00
lijiahang
1522a6f3ad 🔖 升级版本. 2024-07-11 10:28:44 +08:00
lijiahang
04bae45955 修改执行参数. 2024-07-10 11:46:07 +08:00
lijiahang
873e910eb1 定时任务添加参数. 2024-07-10 10:21:16 +08:00
lijiahang
a7f86bf62a 💄 修改表格样式. 2024-07-09 10:34:39 +08:00
lijiahang
7ba278d210 📝 添加 NOTICE 文件. 2024-07-08 14:45:12 +08:00
lijiahang
e9ac9b9f13 修改字典值长度. 2024-07-08 14:44:33 +08:00
lijiahangmax
d34843f90c 主机终端主题从字典中获取. 2024-07-04 21:53:21 +08:00
lijiahang
374d0bdd9c Merge remote-tracking branch 'origin/dev' into dev 2024-07-04 10:29:58 +08:00
lijiahang
5d3dc83bab 🐛 修复操作日志分页无效. 2024-07-04 10:29:39 +08:00
lijiahangmax
05d0f75cdc Merge remote-tracking branch 'origin/dev' into dev 2024-06-30 01:14:58 +08:00
lijiahangmax
711a4a6bab 🐛 修复终端大小适配失效. 2024-06-30 01:14:44 +08:00
李佳航
08895ba170 Merge pull request #37 from LinuxSuRen/fix/e2e
🐛 e2e 配置失效.
2024-06-27 15:27:11 +08:00
rick
c2c8b108ac fix: the e2e testing failure due to auth error 2024-06-27 07:23:24 +00:00
1643 changed files with 37324 additions and 22499 deletions

15
.env.example Normal file
View File

@@ -0,0 +1,15 @@
SERVICE_PORT=1081
VOLUME_BASE=/data/orion-visor-space/docker-volumes
MYSQL_HOST=mysql
MYSQL_PORT=3306
MYSQL_DATABASE=orion_visor
MYSQL_USER=orion
MYSQL_PASSWORD=Data@123456
MYSQL_ROOT_PASSWORD=Data@123456
REDIS_HOST=redis
REDIS_PASSWORD=Data@123456
SECRET_KEY=uQeacXV8b3isvKLK
DEMO_MODE=false

View File

@@ -4,9 +4,8 @@ on:
pull_request:
branches:
- main
- dev
concurrency:
concurrency:
group: ${{github.workflow}} - ${{github.ref}}
cancel-in-progress: true

1
.gitignore vendored
View File

@@ -33,3 +33,4 @@ build/
### VS Code ###
.vscode/
.env

87
LICENSE
View File

@@ -200,90 +200,3 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Apache Dubbo Submodules:
Apache Dubbo includes a number of submodules with separate copyright notices
and license terms. Your use of these submodules is subject to the terms and
conditions of the following licenses.
For the package org.apache.dubbo.common.threadlocal and org.apache.dubbo.common.timer:
This product contains a modified portion of 'Netty', an event-driven asynchronous network application framework also
under a "Apache License 2.0" license, see https://github.com/netty/netty/blob/4.1/LICENSE.txt:
* io.netty.util.concurrent.FastThreadLocal
* io.netty.util.internal.InternalThreadLocalMap
* io.netty.util.Timer
* io.netty.util.TimerTask
* io.netty.util.Timeout
* io.netty.util.HashedWheelTimer
For the org.apache.dubbo.common.utils.CIDRUtils :
This product contains a modified portion of 'edazdarevic.commons.net.CIDRUtils' published at
https://github.com/edazdarevic/CIDRUtils. The project is licensed under a MIT License:
* The MIT License
*
* Copyright (c) 2013 Edin Dazdarevic (edin.dazdarevic@gmail.com)
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
For the file org.apache.dubbo.common.utils.Utf8Utils.java:
This product contains a portion of the Protocol Buffers project, which is published at
https://developers.google.com/protocol-buffers/ and is licensed under the following License:
Copyright 2008 Google Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Code generated by the Protocol Buffer compiler is owned by the owner
of the input file used when generating it. This code is not
standalone and requires a support library to be linked with it. This
support library is itself covered by the above license.
For the ca.proto in dubbo-registry-xds:
This product contains a modified portion of 'Istio', an open platform to connect, manage, and secure microservices also
under a "Apache License 2.0" license, see https://github.com/istio/api/blob/master/LICENSE:
* security/v1alpha1/ca.proto

9
NOTICE Normal file
View File

@@ -0,0 +1,9 @@
* 在使用本项目前,请您仔细阅读使用须知及免责声明,确保您已充分理解其中的内容
* 本项目采用 APACHE LICENSE 2.0 开源协议,如您需要源码的开发方式,需要遵循以下几点
1. 禁止修改或删除 LICENSE 文件。
2. 禁止修改或删除源码头部的版权声明。
3. 本项目可免费商业使用,商业使用请保留项目源码、出处、描述文件和作者声明等。
4. 分发源码时候,请注明软件出处 https://visor.orionsec.cn/
5. 不可二次开发或参与同类竞品的开发。

View File

@@ -1,5 +1,5 @@
<div align="center"><img src="https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/5/29/cec03bbd-0eab-464d-9caf-d0b5a7ffc5a6.png" alt="logo" width="32" /></div>
<p style="margin-top: 12px" align="center"><b>一款高颜值、现代化的智能运维&轻量堡垒机平台。</b></p>
<div align="center"><img src="https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/9/11/11e7e78e-2af0-4c68-9811-db8a4c4400f4.png" alt="logo" width="520" /></div>
<p style="margin-top: 12px" align="center"><b>【Dromara】 一款高颜值、现代化的自动化运维&轻量堡垒机平台。</b></p>
<p align="center">
<a target="_blank"
style="text-decoration: none !important;"
@@ -19,12 +19,12 @@
<a target="_blank"
style="text-decoration: none !important;"
href="https://gitee.com/dromara/orion-visor/stargazers">
<img src="https://gitee.com/dromara/orion-visor/badge/star.svg?theme=dark" alt="star" />
<img src="https://gitee.com/dromara/orion-visor/badge/star.svg?theme=gvp" alt="star" />
</a>
<a target="_blank"
style="text-decoration: none !important;"
href="https://gitee.com/dromara/orion-visor/members">
<img src="https://gitee.com/dromara/orion-visor/badge/fork.svg?theme=dark" alt="fork" />
<img src="https://gitee.com/dromara/orion-visor/badge/fork.svg?theme=gvp" alt="fork" />
</a>
<a target="_blank"
style="text-decoration: none !important;"
@@ -40,7 +40,7 @@
------------------------------
**`orion-visor`** 提供一站式服务器运维解决方案。
**`orion-visor`** 提供一站式自动化运维解决方案。
* **资产管理**:支持对资产进行分组,实现对主机、密钥和身份的统一管理和授权。
* **在线终端**:提供在线终端 SSH 服务,支持快捷命令、自定义快捷键和主题风格。
@@ -51,9 +51,10 @@
## 演示环境
* 🔗 演示地址: http://101.43.254.243:1081/
* 🔗 演示地址: [https://dv.orionsec.cn/](https://dv.orionsec.cn/)
* 🔏 演示账号: admin/admin
* ⭐ 体验后可以点一下 `star` 这对我很重要! [github](https://github.com/dromara/orion-visor) [gitee](https://gitee.com/dromara/orion-visor)
* ⭐ 体验后可以点一下 `star`
这对我很重要! [github](https://github.com/dromara/orion-visor) [gitee](https://gitee.com/dromara/orion-visor) [gitcode](https://gitcode.com/dromara/orion-visor/overview)
* 🌈 如果本项目对你有帮助请帮忙推广一下 让更多的人知道此项目!
* 🎭 演示环境部分功能不可用, 完整功能请本地部署!
* 📛 演示环境请不要随便删除数据!
@@ -63,7 +64,7 @@
```bash
# clone
git clone https://github.com/dromara/orion-visor
git clone --depth=1 https://github.com/dromara/orion-visor
cd orion-visor
# 启动
docker compose up -d
@@ -72,15 +73,15 @@ docker compose up -d
## 项目文档
* [文档地址](https://lijiahangmax.github.io/open-orion/orion-visor/)
* [安装文档](https://lijiahangmax.github.io/open-orion/orion-visor/quickstart/docker.html)
* [更新日志](https://lijiahangmax.github.io/open-orion/orion-visor/update/change-log.html)
* [操作手册](https://lijiahangmax.github.io/open-orion/orion-visor/operator/asset.html)
* [常见问题](https://lijiahangmax.github.io/open-orion/orion-visor/support/faq.html)
* [文档地址](https://visor.orionsec.cn/)
* [安装文档](https://visor.orionsec.cn/quickstart/docker.html)
* [更新日志](https://visor.orionsec.cn/update/change-log.html)
* [操作手册](https://visor.orionsec.cn/operator/asset.html)
* [常见问题](https://visor.orionsec.cn/support/faq.html)
## 技术栈
* SpringBoot 2.7.17
* SpringBoot 2.7.+
* Mysql 8.0.+
* Redis 6.0.+
* Vue3 3.2.+
@@ -111,16 +112,18 @@ docker compose up -d
[![Star History Chart](https://api.star-history.com/svg?repos=lijiahangmax/orion-visor&type=Date)](https://star-history.com/#lijiahangmax/orion-visor&Date)
## 关于我
本人专注于使用 Java 和 Vue 进行全栈开发, 并在系统自动化运维方面拥有丰富开发的经验。如果您在这些领域有需求或遇到痛点, 请随时联系我, 并备注“合作”。
## 联系我
<div style="display: flex;">
<img src="https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/5/17/d42d91f3-f0ee-4c63-adab-a35809e0804c.jpg" alt="wx" width="298px" height="398px"/>
</div>
<img src="https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/10/11/cf72c603-3951-4171-95b4-06271dda1c80.jpg" alt="wx" width="628px"/>
![个人微信: ljh1553488](https://img.shields.io/badge/ljh1553488-blue?style=social&label=WX%3A)
![QQ群1: 755242157](https://img.shields.io/badge/755242157-blue?style=social&label=QQ%E7%BE%A41%3A%20)
微信: ljh1553488
QQ群: 755242157
📧 咨询问题微信备注: vis
📧 问题/加群微信备注: ops
📧 合作/功能定制备注: 合作
## 支持一下
@@ -135,4 +138,8 @@ docker compose up -d
## License
本项目遵循 [Apache-2.0](https://github.com/dromara/orion-visor/blob/main/LICENSE) 开源许可证。
本项目遵循 [Apache-2.0](https://github.com/dromara/orion-visor/blob/main/LICENSE) 开源许可证。
## Gite 最有价值开源项目 GVP
![GVP](https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/10/24/8dd98b8d-9de5-44e6-86d3-04e27ec66123.jpg "GVP")

View File

@@ -1,17 +1,17 @@
version: '3.3'
services:
orion-visor-service:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.0.10
service:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.2.1
privileged: true
ports:
- 1081:80
environment:
- MYSQL_HOST=orion-visor-mysql
- MYSQL_HOST=mysql
- MYSQL_PORT=3306
- MYSQL_DATABASE=orion_visor
- MYSQL_USER=root
- MYSQL_PASSWORD=Data@123456
- REDIS_HOST=orion-visor-redis
- REDIS_HOST=redis
- REDIS_PASSWORD=Data@123456
- SECRET_KEY=uQeacXV8b3isvKLK
- DEMO_MODE=false
@@ -24,15 +24,15 @@ services:
retries: 200
start_period: 3s
depends_on:
orion-visor-mysql:
mysql:
condition: service_healthy
orion-visor-redis:
redis:
condition: service_healthy
links:
- orion-visor-mysql
- orion-visor-redis
orion-visor-mysql:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.0.10
- mysql
- redis
mysql:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.2.1
privileged: true
ports:
- 3307:3306
@@ -51,8 +51,8 @@ services:
timeout: 60s
retries: 10
start_period: 3s
orion-visor-redis:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.0.10
redis:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.2.1
privileged: true
ports:
- 6380:6379
@@ -71,9 +71,9 @@ services:
build:
context: ./docker/e2e
environment:
SERVER: http://orion-visor-service:80
SERVER: http://service:80
depends_on:
orion-visor-service:
service:
condition: service_healthy
links:
- orion-visor-service
- service

View File

@@ -1,73 +1,78 @@
version: '3.3'
services:
orion-visor-service:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.0.10
service:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.2.1
privileged: true
ports:
- 1081:80
- ${SERVICE_PORT:-1081}:80
environment:
- MYSQL_HOST=orion-visor-mysql
- MYSQL_PORT=3306
- MYSQL_DATABASE=orion_visor
- MYSQL_USER=root
- MYSQL_PASSWORD=Data@123456
- REDIS_HOST=orion-visor-redis
- REDIS_PASSWORD=Data@123456
- SECRET_KEY=uQeacXV8b3isvKLK
- DEMO_MODE=false
- MYSQL_HOST=${MYSQL_HOST:-mysql}
- MYSQL_PORT=${MYSQL_PORT:-3306}
- MYSQL_DATABASE=${MYSQL_DATABASE:-orion_visor}
- MYSQL_USER=${MYSQL_USER:-root}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-Data@123456}
- REDIS_HOST=${REDIS_HOST:-redis}
- REDIS_PASSWORD=${REDIS_PASSWORD:-Data@123456}
- SECRET_KEY=${SECRET_KEY:-uQeacXV8b3isvKLK}
- DEMO_MODE=${DEMO_MODE:-false}
volumes:
- /data/orion-visor-space/docker-volumes/service/root-orion:/root/orion
- ${VOLUME_BASE:-/data/orion-visor-space/docker-volumes}/service/root-orion:/root/orion
healthcheck:
test: [ "CMD", "curl", "http://127.0.0.1:9200/orion-visor/api/server/bootstrap/health" ]
interval: 3s
interval: 15s
timeout: 300s
retries: 200
retries: 15
start_period: 3s
depends_on:
orion-visor-mysql:
mysql:
condition: service_healthy
orion-visor-redis:
redis:
condition: service_healthy
links:
- orion-visor-mysql
- orion-visor-redis
orion-visor-mysql:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.0.10
- mysql
- redis
mysql:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.2.1
privileged: true
ports:
- 3307:3306
environment:
- MYSQL_DATABASE=orion_visor
- MYSQL_USER=orion
- MYSQL_PASSWORD=Data@123456
- MYSQL_ROOT_PASSWORD=Data@123456
- MYSQL_DATABASE=${MYSQL_DATABASE:-orion_visor}
- MYSQL_USER=${MYSQL_USER:-orion}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-Data@123456}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-Data@123456}
volumes:
- /data/orion-visor-space/docker-volumes/mysql/var-lib-mysql:/var/lib/mysql
- /data/orion-visor-space/docker-volumes/mysql/var-lib-mysql-files:/var/lib/mysql-files
- /data/orion-visor-space/docker-volumes/mysql/etc-mysql:/etc/mysql
- ${VOLUME_BASE:-/data/orion-visor-space/docker-volumes}/mysql/var-lib-mysql:/var/lib/mysql
- ${VOLUME_BASE:-/data/orion-visor-space/docker-volumes}/mysql/var-lib-mysql-files:/var/lib/mysql-files
- ${VOLUME_BASE:-/data/orion-visor-space/docker-volumes}/mysql/etc-mysql:/etc/mysql
healthcheck:
test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/3306" ]
interval: 3s
interval: 15s
timeout: 60s
retries: 10
retries: 15
start_period: 3s
orion-visor-redis:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.0.10
redis:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.2.1
privileged: true
ports:
- 6380:6379
environment:
- REDIS_PASSWORD=Data@123456
- REDIS_PASSWORD=${REDIS_PASSWORD:-Data@123456}
volumes:
- /data/orion-visor-space/docker-volumes/redis/data:/data
- ${VOLUME_BASE:-/data/orion-visor-space/docker-volumes}/redis/data:/data
command: sh -c "redis-server /usr/local/redis.conf --requirepass $${REDIS_PASSWORD}"
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
interval: 3s
interval: 15s
timeout: 60s
retries: 10
retries: 15
start_period: 3s
orion-visor-adminer:
image: adminer
adminer:
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-adminer:2.2.1
ports:
- 8081:8080
depends_on:
mysql:
condition: service_healthy
links:
- mysql

View File

@@ -2,6 +2,6 @@
docker compose down
# demo 启动
if [ "$1" == "demo" ]; then
sed -i 's/DEMO_MODE=false/DEMO_MODE=true/g' docker-compose.yml
sed -i 's/\${DEMO_MODE:-false}/true/g' docker-compose.yml
fi
docker compose up -d
docker compose up -d --remove-orphans

View File

@@ -0,0 +1 @@
FROM adminer:latest

4
docker/adminer/build.sh Normal file
View File

@@ -0,0 +1,4 @@
#/bin/bash
version=2.2.1
docker build -t orion-visor-adminer:${version} .
docker tag orion-visor-adminer:${version} registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-adminer:${version}

View File

@@ -17,7 +17,7 @@ items:
code: 200
- name: userPermission
request:
api: /orion-visor/api/infra/permission/user
api: /orion-visor/api/infra/user-permission/user
header:
Authorization: Bearer {{.login.data.token}}
expect:
@@ -26,7 +26,7 @@ items:
msg: "success"
- name: menu
request:
api: /orion-visor/api/infra/permission/menu
api: /orion-visor/api/infra/user-permission/menu
header:
Authorization: Bearer {{.login.data.token}}
expect:
@@ -36,22 +36,14 @@ items:
- name: haveUnRead
request:
api: /orion-visor/api/infra/system-message/has-unread
header:
Authorization: Bearer {{.login.data.token}}
- name: queryOperatorLog
request:
api: /orion-visor/api/infra/mine/query-operator-log
method: POST
header:
Authorization: Bearer {{.login.data.token}}
- name: hostList
request:
api: /orion-visor/api/infra/tag/list?type=HOST
header:
Authorization: Bearer {{.login.data.token}}
- name: queryHost
request:
api: /orion-visor/api/asset/host/query
method: POST
header:
Authorization: Bearer {{.login.data.token}}

View File

@@ -1,7 +1,6 @@
#/bin/bash
version=2.0.10
version=2.2.1
cp -r ../../sql ./sql
docker build -t orion-visor-mysql:${version} .
rm -rf ./sql
docker tag orion-visor-mysql:${version} registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:${version}
docker push registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:${version}

6
docker/push.sh Normal file
View File

@@ -0,0 +1,6 @@
#/bin/bash
version=2.2.1
docker push registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-adminer:${version}
docker push registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:${version}
docker push registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version}
docker push registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:${version}

View File

@@ -1,5 +1,4 @@
#/bin/bash
version=2.0.10
version=2.2.1
docker build -t orion-visor-redis:${version} .
docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version}
docker push registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version}

View File

@@ -1,9 +1,8 @@
#/bin/bash
version=2.0.10
version=2.2.1
mv ../../orion-visor-launch/target/orion-visor-launch.jar ./orion-visor-launch.jar
mv ../../orion-visor-ui/dist ./dist
docker build -t orion-visor-service:${version} .
docker build --no-cache -t orion-visor-service:${version} .
rm -rf ./orion-visor-launch.jar
rm -rf ./dist
docker tag orion-visor-service:${version} registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:${version}
docker push registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:${version}

View File

@@ -29,7 +29,7 @@ server {
location /orion-visor/api {
proxy_pass http://localhost:9200/orion-visor/api;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}

View File

@@ -19,12 +19,12 @@
<a target="_blank"
style="text-decoration: none !important;"
href="https://gitee.com/lijiahangmax/orion-visor/stargazers">
<img src="https://gitee.com/lijiahangmax/orion-visor/badge/star.svg?theme=dark" alt="star" />
<img src="https://gitee.com/lijiahangmax/orion-visor/badge/star.svg?theme=gvp" alt="star" />
</a>
<a target="_blank"
style="text-decoration: none !important;"
href="https://gitee.com/lijiahangmax/orion-visor/members">
<img src="https://gitee.com/lijiahangmax/orion-visor/badge/fork.svg?theme=dark" alt="fork" />
<img src="https://gitee.com/lijiahangmax/orion-visor/badge/fork.svg?theme=gvp" alt="fork" />
</a>
<a target="_blank"
style="text-decoration: none !important;"

View File

@@ -20,7 +20,7 @@
// 左侧文档名称
name: 'orion-visor',
// 右上角仓库
repo: 'https://github.com/lijiahangmax/orion-visor',
repo: 'https://github.com/dromara/orion-visor',
coverpage: true,
// 加载侧边栏
loadSidebar: true,

View File

@@ -21,22 +21,35 @@ Dashboard 修改)
```shell
# github
git clone https://github.com/lijiahangmax/orion-visor
git clone --depth=1 https://github.com/lijiahangmax/orion-visor
# gitee
git clone https://gitee.com/lijiahangmax/orion-visor
git clone --depth=1 https://gitee.com/lijiahangmax/orion-visor
```
### 构建镜像
### 拉取镜像
```
# 进入仓库目录
cd orion-visor
# 修改 docker-compose.yml (建议修改)
# MYSQL_USER mysql 用户名
# MYSQL_PASSWORD mysql 用户密码
# MYSQL_ROOT_PASSWORD mysql root 密码
# REDIS_PASSWORD redis 密码
# SECRET_KEY 加密密钥
# 创建名为 .env 的 .env.example 副本
cp .env.example .env
# 将其中的值删除以保持默认或将其修改为你喜欢的值
# SERVICE_PORT 你希望服务监听的端口
# VOLUME_BASE 你希望数据持久化保存的目录, 如果不提前创建将以 docker 进程宿主身份创建(通常是 root)
# MYSQL_HOST mysql 服务所在的主机, 如果你没有现有的 MySQL 请保持值为 mysql, 如果你有自部署的请在 docker-compose.yml 中移除 services.mysql 以节约性能
# MYSQL_PORT mysql 监听的端口
# MYSQL_DATABASE mysql 数据库
# MYSQL_USER mysql 用户名
# MYSQL_PASSWORD mysql 用户密码
# MYSQL_ROOT_PASSWORD mysql root 密码
# REDIS_HOST redis 服务所在的主机, 如果你没有现有的 Redis 请保持值为 redis, 如果你有自部署的请在 docker-compose.yml 中移除 services.redis 以节约性能
# REDIS_PASSWORD redis 密码
# SECRET_KEY 加密密钥
# 拉取远程镜像
docker compose pull
```
### 启动
@@ -45,7 +58,7 @@ cd orion-visor
docker compose up -d
```
### 修改加密方式
### 修改 MySQL 账户的加密方式
```
访问 adminer: http://localhost:8081

View File

@@ -4,21 +4,21 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-dependencies</artifactId>
<version>${revision}</version>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
<description>项目所有依赖</description>
<description>项目全部依赖</description>
<url>https://github.com/dromara/orion-visor</url>
<properties>
<revision>2.0.10</revision>
<revision>2.2.1</revision>
<spring.boot.version>2.7.17</spring.boot.version>
<spring.boot.admin.version>2.7.15</spring.boot.admin.version>
<flatten.maven.plugin.version>1.5.0</flatten.maven.plugin.version>
<orion.kit.version>1.0.7</orion.kit.version>
<orion.kit.version>2.0.1</orion.kit.version>
<aspectj.version>1.9.7</aspectj.version>
<lombok.version>1.18.26</lombok.version>
<springdoc.version>1.6.15</springdoc.version>
@@ -48,95 +48,95 @@
<!-- orion-kit -->
<dependency>
<groupId>io.github.lijiahangmax</groupId>
<groupId>cn.orionsec.kit</groupId>
<artifactId>orion-all</artifactId>
<version>${orion.kit.version}</version>
<exclusions>
<exclusion>
<artifactId>orion-log</artifactId>
<groupId>io.github.lijiahangmax</groupId>
<groupId>cn.orionsec.kit</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- orion-visor-starter -->
<dependency>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-framework-common</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-banner</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-web</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-swagger</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-datasource</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-mybatis</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-job</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-websocket</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-redis</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-desensitize</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-log</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-storage</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-security</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-monitor</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-test</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-spring-boot-starter-biz-operator-log</artifactId>
<version>${revision}</version>
</dependency>

View File

@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.orion.visor</groupId>
<groupId>org.dromara.visor</groupId>
<artifactId>orion-visor-framework</artifactId>
<version>${revision}</version>
</parent>
@@ -18,7 +18,7 @@
<dependencies>
<dependency>
<groupId>io.github.lijiahangmax</groupId>
<groupId>cn.orionsec.kit</groupId>
<artifactId>orion-all</artifactId>
</dependency>

View File

@@ -1,17 +0,0 @@
package com.orion.visor.framework.common.annotation;
import java.lang.annotation.*;
/**
* 保留
*
* @author Jiahang Li
* @version 1.0.0
* @since 2024/6/6 15:26
*/
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Keep {
}

View File

@@ -1,30 +0,0 @@
package com.orion.visor.framework.common.constant;
import com.orion.lang.constant.OrionConst;
/**
* 项目常量
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/6/19 18:56
*/
public interface AppConst extends OrionConst {
/**
* 同 ${orion.version} 迭代时候需要手动更改
*/
String VERSION = "2.0.10";
/**
* 同 ${spring.application.name}
*/
String APP_NAME = "orion-visor";
String GITHUB = "https://github.com/dromara/orion-visor";
String GITEE = "https://gitee.com/dromara/orion-visor";
String ISSUES = "https://github.com/dromara/orion-visor/issues";
}

View File

@@ -1,32 +0,0 @@
package com.orion.visor.framework.common.constant;
/**
* bean 排序常量
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/6/29 16:09
*/
public interface BeanOrderConst {
/**
* 公共返回值包装处理器
*/
int RESPONSE_ADVICE_WRAPPER = Integer.MIN_VALUE + 1000;
/**
* 演示模式切面
*/
int DEMO_DISABLE_API_ASPECT = Integer.MIN_VALUE + 10;
/**
* 全局日志打印
*/
int LOG_PRINT_ASPECT = Integer.MIN_VALUE + 20;
/**
* 操作日志切面
*/
int OPERATOR_LOG_ASPECT = Integer.MIN_VALUE + 30;
}

View File

@@ -1,20 +0,0 @@
package com.orion.visor.framework.common.constant;
/**
* 常量 - 中文
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/11/30 21:00
*/
public interface CnConst {
String CN_USER = "用户";
String CN_ROLE = "角色";
String CN_UNKNOWN = "未知";
String CN_INTRANET_IP = "内网IP";
}

View File

@@ -1,32 +0,0 @@
package com.orion.visor.framework.common.constant;
/**
* 常量
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/6/23 18:49
*/
public interface Const extends com.orion.lang.constant.Const, FieldConst, CnConst {
Integer NOT_DELETE = 0;
Integer IS_DELETED = 1;
int BEARER_PREFIX_LEN = 7;
int MD5_LEN = 32;
Long ROOT_PARENT_ID = 0L;
Integer DEFAULT_SORT = 10;
Long NONE_ID = -1L;
Integer DEFAULT_VERSION = 1;
Long SYSTEM_USER_ID = 0L;
String SYSTEM_USERNAME = "system";
}

View File

@@ -1,68 +0,0 @@
package com.orion.visor.framework.common.constant;
/**
* 字段常量
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/10/17 12:44
*/
public interface FieldConst {
String ID = "id";
String KEY = "key";
String CODE = "code";
String NAME = "name";
String TITLE = "title";
String VALUE = "value";
String LABEL = "label";
String TYPE = "type";
String COLOR = "color";
String STATUS = "status";
String INFO = "info";
String REL_ID = "relId";
String BEFORE = "before";
String AFTER = "after";
String SOURCE = "source";
String TARGET = "target";
String CHARSET = "charset";
String TOKEN = "token";
String SEQ = "seq";
String PATH = "path";
String ADDRESS = "address";
String MOD = "mod";
String COUNT = "count";
String DATE = "date";
String TIME = "time";
String LOCATION = "location";
String USER_AGENT = "userAgent";
String ERROR_MESSAGE = "errorMessage";
}

View File

@@ -1,18 +0,0 @@
package com.orion.visor.framework.common.constant;
/**
* 文件常量
*
* @author Jiahang Li
* @version 1.0.0
* @since 2024/4/17 10:35
*/
public interface FileConst {
String ERROR_LOG = "error.log";
String EXEC = "exec";
String SCRIPT = "script";
}

View File

@@ -1,16 +0,0 @@
package com.orion.visor.framework.common.constant;
/**
* 过滤器排序常量
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/6/16 17:04
*/
public interface FilterOrderConst {
int TRICE_ID_FILTER = Integer.MIN_VALUE + 1000;
int CORS_FILTER = Integer.MIN_VALUE + 2000;
}

View File

@@ -1,20 +0,0 @@
package com.orion.visor.framework.common.constant;
/**
* 验证常量
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/10/20 11:45
*/
public interface ValidConst {
String USERNAME_4_32_PATTERN = "^[a-zA-Z0-9_]{4,32}$";
String USERNAME_4_32_MESSAGE = "只能为 4-32 位的数字,字母或下滑线";
String DICT_1_32_PATTERN = "^[a-zA-Z0-9_]{1,32}$";
String DICT_1_32_MESSAGE = "只能为 1-32 位的数字,字母或下滑线";
}

View File

@@ -1,40 +0,0 @@
package com.orion.visor.framework.common.crypto;
import com.orion.lang.utils.codec.Base62s;
import com.orion.lang.utils.crypto.symmetric.SymmetricCrypto;
/**
* 数据加密器
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/7/8 0:20
*/
public interface ValueCrypto extends SymmetricCrypto {
/**
* 初始化
*/
void init();
/**
* 加密后 base62 编码
*
* @param plain 明文
* @return 密文
*/
default String encryptBase62(String plain) {
return new String(Base62s.encode(this.encrypt(plain)));
}
/**
* base62 解码后解密
*
* @param text 密文
* @return 明文
*/
default String decryptBase62(String text) {
return new String(this.decrypt(Base62s.decode(text)));
}
}

View File

@@ -1,25 +0,0 @@
package com.orion.visor.framework.common.entity;
import lombok.Data;
/**
* 自动清理配置
*
* @author Jiahang Li
* @version 1.0.0
* @since 2024/6/24 15:03
*/
@Data
public class AutoClearConfig {
/**
* 是否开启
*/
private Boolean enabled;
/**
* 保留周期 (天)
*/
private Integer keepPeriod;
}

View File

@@ -1,28 +0,0 @@
package com.orion.visor.framework.common.entity;
import com.orion.lang.define.wrapper.IPageRequest;
import com.orion.visor.framework.common.validator.group.Page;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
/**
* 公共页码请求
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/7/12 23:14
*/
@Data
@Schema(description = "公共页码请求")
public class PageRequest implements IPageRequest {
@Range(min = 1, max = 10000, groups = Page.class)
@Schema(description = "页码")
private int page;
@Range(min = 1, max = 100, groups = Page.class)
@Schema(description = "大小")
private int limit;
}

View File

@@ -1,30 +0,0 @@
package com.orion.visor.framework.common.entity;
import lombok.Data;
/**
* 请求留痕模型
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/12/29 11:57
*/
@Data
public class RequestIdentityModel implements RequestIdentity {
/**
* 请求地址
*/
private String address;
/**
* 请求位置
*/
private String location;
/**
* userAgent
*/
private String userAgent;
}

View File

@@ -1,49 +0,0 @@
package com.orion.visor.framework.common.entity;
import java.util.List;
/**
* 树节点
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/11/23 16:52
*/
public interface TreeNode<T extends TreeNode<T>> {
/**
* id
*
* @return id
*/
Long getId();
/**
* parentId
*
* @return parentId
*/
Long getParentId();
/**
* sort
*
* @return sort
*/
Integer getSort();
/**
* children
*
* @return children
*/
List<T> getChildren();
/**
* 设置 children
*
* @param children children
*/
void setChildren(List<T> children);
}

View File

@@ -1,43 +0,0 @@
package com.orion.visor.framework.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 启用状态
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/10/12 16:02
*/
@Getter
@AllArgsConstructor
public enum EnableStatus {
/**
* 停用
*/
DISABLED(0),
/**
* 启用
*/
ENABLED(1),
;
private final Integer value;
public static EnableStatus of(Integer value) {
if (value == null) {
return null;
}
for (EnableStatus e : values()) {
if (e.value.equals(value)) {
return e;
}
}
return null;
}
}

View File

@@ -1,45 +0,0 @@
package com.orion.visor.framework.common.enums;
import com.orion.lang.utils.Strings;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 端点定义
*
* @author Jiahang Li
* @version 1.0.0
* @since 2024/6/21 19:15
*/
@Getter
@AllArgsConstructor
public enum EndpointDefine {
/**
* 上传临时分区
*/
UPLOAD_SWAP("/upload/swap/{}"),
/**
* 批量执行日志
*/
EXEC_LOG("/exec/{}/{}.log"),
;
/**
* 端点
*/
private final String endpoint;
/**
* 格式化
*
* @param params params
* @return path
*/
public String format(Object... params) {
return Strings.format(this.endpoint, params);
}
}

View File

@@ -1,35 +0,0 @@
package com.orion.visor.framework.common.handler.data.model;
import com.alibaba.fastjson.JSON;
import java.util.Map;
/**
* 标准数据模型
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/12/20 22:07
*/
public interface GenericsDataModel {
/**
* 序列化
*
* @return json
*/
default String serial() {
return JSON.toJSONString(this);
}
/**
* 转为 map
*
* @return map
*/
default Map<String, Object> toMap() {
return JSON.parseObject(this.serial());
}
}

View File

@@ -1,46 +0,0 @@
package com.orion.visor.framework.common.handler.data.strategy;
import com.orion.visor.framework.common.handler.data.model.GenericsDataModel;
/**
* 标准数据处理策略
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/12/20 22:09
*/
public interface GenericsDataStrategy<M extends GenericsDataModel> {
/**
* 获取默认值
*
* @return 默认值
*/
M getDefault();
/**
* 执行完整验证链
* <p>
* preValid > updateFill > valid
*
* @param beforeModel beforeModel
* @param afterModel afterModel
*/
void doValid(M beforeModel, M afterModel);
/**
* 解析数据
*
* @param serialModel serialModel
* @return model
*/
M parse(String serialModel);
/**
* 转为视图配置
*
* @param model model
*/
void toView(M model);
}

View File

@@ -1,28 +0,0 @@
package com.orion.visor.framework.common.json.filter;
import com.alibaba.fastjson.serializer.PropertyFilter;
import com.orion.lang.utils.collect.Lists;
import java.util.List;
/**
* 字段忽略过滤器
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/10/12 11:21
*/
public class FieldIgnoreFilter implements PropertyFilter {
private final List<String> ignoreFields;
public FieldIgnoreFilter(List<String> ignoreFields) {
this.ignoreFields = ignoreFields;
}
@Override
public boolean apply(Object object, String name, Object value) {
return Lists.isEmpty(ignoreFields) || !ignoreFields.contains(name);
}
}

View File

@@ -1,33 +0,0 @@
package com.orion.visor.framework.common.lock;
import java.util.function.Supplier;
/**
* 分布式锁
*
* @author Jiahang Li
* @version 1.0.0
* @since 2024/5/16 12:24
*/
public interface Locker {
/**
* 尝试获取锁
*
* @param key key
* @param run run
* @return 是否获取到锁
*/
boolean tryLock(String key, Runnable run);
/**
* 尝试获取锁
*
* @param key key
* @param call call
* @param <T> T
* @return 执行结果
*/
<T> T tryLock(String key, Supplier<T> call);
}

View File

@@ -1,38 +0,0 @@
package com.orion.visor.framework.common.meta;
import com.alibaba.ttl.TransmittableThreadLocal;
/**
* traceId 持有者
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/6/16 17:35
*/
public class TraceIdHolder {
public static final String TRACE_ID_HEADER = "trace-id";
public static final String TRACE_ID_MDC = "tid";
private TraceIdHolder() {
}
/**
* 请求序列
*/
private static final ThreadLocal<String> HOLDER = new TransmittableThreadLocal<>();
public static String get() {
return HOLDER.get();
}
public static void set(String traceId) {
HOLDER.set(traceId);
}
public static void remove() {
HOLDER.remove();
}
}

View File

@@ -1,40 +0,0 @@
package com.orion.visor.framework.common.security;
import com.orion.lang.utils.Booleans;
import com.orion.lang.utils.Strings;
import com.orion.visor.framework.common.constant.Const;
import com.orion.visor.framework.common.utils.CryptoUtils;
/**
* 密码修改器
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/9/21 11:35
*/
public class PasswordModifier {
private PasswordModifier() {
}
/**
* 获取新密码
*
* @param action action
* @return password
*/
public static String getEncryptNewPassword(UpdatePasswordAction action) {
if (Booleans.isTrue(action.getUseNewPassword())) {
// 使用新密码
String password = action.getPassword();
if (Strings.isBlank(password)) {
return Const.EMPTY;
} else {
return CryptoUtils.encryptAsString(password);
}
} else {
return null;
}
}
}

View File

@@ -1,26 +0,0 @@
package com.orion.visor.framework.common.security;
/**
* SecurityUtils 的 bean 对象
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/7/7 15:20
*/
public interface SecurityHolder {
/**
* 获取当前用户
*
* @return 当前用户
*/
LoginUser getLoginUser();
/**
* 获取当前用户id
*
* @return id
*/
Long getLoginUserId();
}

View File

@@ -1,28 +0,0 @@
package com.orion.visor.framework.common.security;
import java.io.Serializable;
/**
* 更新密码操作
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/9/21 11:32
*/
public interface UpdatePasswordAction extends Serializable {
/**
* 是否使用新密码
*
* @return use
*/
Boolean getUseNewPassword();
/**
* 获取密码
*
* @return password
*/
String getPassword();
}

View File

@@ -1,28 +0,0 @@
package com.orion.visor.framework.common.security;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
/**
* 用户角色
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/11/20 23:39
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
@Schema(name = "UserRole", description = "用户角色")
public class UserRole {
@EqualsAndHashCode.Include
@Schema(description = "id")
private Long id;
@Schema(description = "角色")
private String code;
}

View File

@@ -1,33 +0,0 @@
package com.orion.visor.framework.common.thread;
import com.orion.visor.framework.common.utils.ThreadMdcUtils;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
/**
* 自动注入 MDC 异步线程池
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/7/10 15:16
*/
public class ThreadPoolMdcTaskExecutor extends ThreadPoolTaskExecutor {
@Override
public void execute(Runnable task) {
super.execute(ThreadMdcUtils.wrap(task));
}
@Override
public <T> Future<T> submit(Callable<T> task) {
return super.submit(ThreadMdcUtils.wrap(task));
}
@Override
public Future<?> submit(Runnable task) {
return super.submit(ThreadMdcUtils.wrap(task));
}
}

View File

@@ -1,28 +0,0 @@
package com.orion.visor.framework.common.utils;
import com.orion.lang.utils.time.Dates;
import com.orion.visor.framework.common.constant.Const;
/**
* 文件名称
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/8/31 17:57
*/
public class FileNames {
private FileNames() {
}
/**
* 导出文件名称
*
* @param title title
* @return name
*/
public static String exportName(String title) {
return title + "-" + Dates.current(Dates.YMD_HMS2) + "." + Const.SUFFIX_XLSX;
}
}

View File

@@ -1,38 +0,0 @@
package com.orion.visor.framework.common.utils;
import com.orion.lang.utils.Arrays1;
import com.orion.lang.utils.crypto.Caesars;
/**
* 混淆工具类
*
* @author Jiahang Li
* @version 1.0.0
* @since 2024/6/17 18:27
*/
public class Mixes {
private Mixes() {
}
/**
* 混淆
* <p>
* 此方法不可修改
*
* @param str str
* @return str
*/
public static String obfuscate(String str) {
char[] chars = str.toCharArray();
Arrays1.reverse(chars);
for (int i = 0; i < chars.length; i += 2) {
char temp = chars[i];
chars[i] = chars[i + 1];
chars[i + 1] = temp;
}
String res = new String(chars);
return new Caesars().encrypt(res);
}
}

View File

@@ -1,69 +0,0 @@
package com.orion.visor.framework.common.utils;
import com.orion.lang.utils.Objects1;
import com.orion.visor.framework.common.constant.AppConst;
import com.orion.visor.framework.common.constant.Const;
/**
* 路径工具类
*
* @author Jiahang Li
* @version 1.0.0
* @since 2024/4/17 10:28
*/
public class PathUtils {
private PathUtils() {
}
/**
* 获取用户根目录
*
* @param isWindows isWindows
* @param username 用户名
* @return 用户目录
*/
public static String getHomePath(boolean isWindows, String username) {
if (isWindows) {
// windows
return "C:/Users/" + username;
} else {
// linux
if (Const.ROOT.equals(username)) {
return "/" + Const.ROOT;
} else {
return "/home/" + username;
}
}
}
/**
* 获取应用路径
*
* @param isWindows isWindows
* @param username username
* @return path
*/
public static String getAppPath(boolean isWindows, String username) {
return getHomePath(isWindows, username)
+ "/" + AppConst.ORION
+ "/" + AppConst.APP_NAME;
}
/**
* 构建应用路径
*
* @param isWindows isWindows,
* @param username username
* @param paths paths
* @return path
*/
public static String buildAppPath(boolean isWindows, String username, Object... paths) {
StringBuilder path = new StringBuilder(getAppPath(isWindows, username));
for (Object o : paths) {
path.append("/").append(Objects1.toString(o));
}
return path.toString();
}
}

View File

@@ -1,13 +0,0 @@
package com.orion.visor.framework.common.validator.group;
import javax.validation.groups.Default;
/**
* 批量验证分组
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/9/1 19:13
*/
public interface Batch extends Default {
}

View File

@@ -1,13 +0,0 @@
package com.orion.visor.framework.common.validator.group;
import javax.validation.groups.Default;
/**
* 分页验证分组
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/9/1 19:13
*/
public interface Id extends Default {
}

View File

@@ -1,13 +0,0 @@
package com.orion.visor.framework.common.validator.group;
import javax.validation.groups.Default;
/**
* 分页验证分组
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/9/1 19:13
*/
public interface Page extends Default {
}

View File

@@ -1,33 +0,0 @@
package com.orion.visor.framework.common.web.filter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import javax.servlet.Filter;
/**
* 过滤器构造器
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/6/25 15:05
*/
public class FilterCreator {
private FilterCreator() {
}
/**
* 创建过滤器
*
* @param filter filter
* @param order order
* @param <T> type
* @return filter bean
*/
public static <T extends Filter> FilterRegistrationBean<T> create(T filter, Integer order) {
FilterRegistrationBean<T> bean = new FilterRegistrationBean<>(filter);
bean.setOrder(order);
return bean;
}
}

View File

@@ -1,9 +1,24 @@
package com.orion.visor.framework.common.configuration;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.configuration;
import com.orion.spring.SpringHolder;
import com.orion.visor.framework.common.configuration.config.AsyncExecutorConfig;
import com.orion.visor.framework.common.constant.AutoConfigureOrderConst;
import com.orion.visor.framework.common.thread.ThreadPoolMdcTaskExecutor;
import cn.orionsec.kit.spring.SpringHolder;
import org.dromara.visor.framework.common.configuration.config.AsyncExecutorConfig;
import org.dromara.visor.framework.common.constant.AutoConfigureOrderConst;
import org.dromara.visor.framework.common.thread.ThreadPoolMdcTaskExecutor;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.boot.context.properties.EnableConfigurationProperties;

View File

@@ -1,4 +1,19 @@
package com.orion.visor.framework.common.configuration.config;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.configuration.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@@ -0,0 +1,45 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.constant;
import cn.orionsec.kit.lang.constant.OrionConst;
/**
* 项目常量
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/6/19 18:56
*/
public interface AppConst extends OrionConst {
/**
* 同 ${orion.version} 迭代时候需要手动更改
*/
String VERSION = "2.2.1";
/**
* 同 ${spring.application.name}
*/
String APP_NAME = "orion-visor";
String GITHUB = "https://github.com/dromara/orion-visor";
String GITEE = "https://gitee.com/dromara/orion-visor";
String ISSUES = "https://github.com/dromara/orion-visor/issues";
}

View File

@@ -1,4 +1,19 @@
package com.orion.visor.framework.common.constant;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.constant;
/**
* 自动装配排序常量

View File

@@ -0,0 +1,47 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.constant;
/**
* bean 排序常量
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/6/29 16:09
*/
public interface BeanOrderConst {
/**
* 公共返回值包装处理器
*/
int RESPONSE_ADVICE_WRAPPER = Integer.MIN_VALUE + 1000;
/**
* 演示模式切面
*/
int DEMO_DISABLE_API_ASPECT = Integer.MIN_VALUE + 10;
/**
* 全局日志打印
*/
int LOG_PRINT_ASPECT = Integer.MIN_VALUE + 20;
/**
* 操作日志切面
*/
int OPERATOR_LOG_ASPECT = Integer.MIN_VALUE + 30;
}

View File

@@ -0,0 +1,35 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.constant;
/**
* 常量 - 中文
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/11/30 21:00
*/
public interface CnConst {
String CN_USER = "用户";
String CN_ROLE = "角色";
String CN_UNKNOWN = "未知";
String CN_INTRANET_IP = "内网IP";
}

View File

@@ -0,0 +1,49 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.constant;
/**
* 常量
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/6/23 18:49
*/
public interface Const extends cn.orionsec.kit.lang.constant.Const, FieldConst, CnConst {
Integer NOT_DELETE = 0;
Integer IS_DELETED = 1;
int BEARER_PREFIX_LEN = 7;
int MD5_LEN = 32;
Long ROOT_PARENT_ID = 0L;
Integer DEFAULT_SORT = 10;
Long NONE_ID = -1L;
Integer DEFAULT_VERSION = 1;
Long SYSTEM_USER_ID = 0L;
String SYSTEM_USERNAME = "system";
int BATCH_COUNT = 500;
}

View File

@@ -1,9 +1,24 @@
package com.orion.visor.framework.common.constant;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.constant;
import com.orion.lang.define.wrapper.CodeInfo;
import com.orion.lang.define.wrapper.HttpWrapper;
import com.orion.lang.utils.Exceptions;
import com.orion.lang.utils.Strings;
import cn.orionsec.kit.lang.define.wrapper.CodeInfo;
import cn.orionsec.kit.lang.define.wrapper.HttpWrapper;
import cn.orionsec.kit.lang.utils.Exceptions;
import cn.orionsec.kit.lang.utils.Strings;
/**
* 用于定义错误码

View File

@@ -1,4 +1,22 @@
package com.orion.visor.framework.common.constant;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.constant;
import cn.orionsec.kit.lang.exception.ApplicationException;
import cn.orionsec.kit.lang.exception.argument.InvalidArgumentException;
/**
* 错误信息
@@ -61,6 +79,10 @@ public interface ErrorMessage {
String GROUP_ABSENT = "分组不存在";
String HOST_TYPE_ERROR = "主机类型错误";
String HOST_NOT_ENABLED = "主机未启用";
String UNABLE_OPERATE_ADMIN_ROLE = "无法操作管理员账号";
String UNSUPPORTED_CHARSET = "不支持的编码 [{}]";
@@ -93,6 +115,14 @@ public interface ErrorMessage {
String TASK_ABSENT = "任务不存在";
String CONNECT_ERROR = "连接失败";
String AUTH_ERROR = "认证失败";
String SCRIPT_UPLOAD_ERROR = "脚本上传失败";
String EXEC_ERROR = "执行失败";
String ILLEGAL_STATUS = "当前状态不支持此操作";
String CHECK_AUTHORIZED_HOST = "请选择已授权的主机";
@@ -105,4 +135,43 @@ public interface ErrorMessage {
String CLIENT_ABORT = "手动中断";
String UNABLE_DOWNLOAD_FOLDER = "无法下载文件夹";
/**
* 是否为业务异常
*
* @param ex ex
* @return biz exception
*/
static boolean isBizException(Exception ex) {
if (ex == null) {
return false;
}
return ex instanceof InvalidArgumentException
|| ex instanceof IllegalArgumentException
|| ex instanceof ApplicationException;
}
/**
* 获取错误信息
*
* @param ex ex
* @param defaultMsg defaultMsg
* @return message
*/
static String getErrorMessage(Exception ex, String defaultMsg) {
if (ex == null) {
return null;
}
String message = ex.getMessage();
if (message == null) {
return defaultMsg;
}
// 业务异常
if (isBizException(ex)) {
return message;
}
return defaultMsg;
}
}

View File

@@ -1,4 +1,19 @@
package com.orion.visor.framework.common.constant;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.constant;
/**
* 额外字段常量
@@ -21,6 +36,8 @@ public interface ExtraFieldConst extends FieldConst {
String USERNAME = "username";
String HOME = "home";
String STATUS_NAME = "statusName";
String KEY_NAME = "keyName";
@@ -43,4 +60,6 @@ public interface ExtraFieldConst extends FieldConst {
String LOG_ID = "logId";
String DARK = "dark";
}

View File

@@ -0,0 +1,101 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.constant;
/**
* 字段常量
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/10/17 12:44
*/
public interface FieldConst {
String ID = "id";
String KEY = "key";
String CODE = "code";
String NAME = "name";
String TITLE = "title";
String VALUE = "value";
String LABEL = "label";
String TYPE = "type";
String COLOR = "color";
String STATUS = "status";
String INFO = "info";
String EXTRA = "extra";
String REL_ID = "relId";
String BEFORE = "before";
String AFTER = "after";
String SOURCE = "source";
String TARGET = "target";
String CHARSET = "charset";
String TOKEN = "token";
String SEQ = "seq";
String PATH = "path";
String ADDRESS = "address";
String MOD = "mod";
String COUNT = "count";
String DATE = "date";
String TIME = "time";
String TEXT = "text";
String ISSUE = "issue";
String EXPIRE = "expire";
String LOCATION = "location";
String USER_AGENT = "userAgent";
String ERROR_MESSAGE = "errorMessage";
String UUID = "uuid";
String REDIRECT = "redirect";
String SCHEMA = "schema";
String FILTER = "filter";
String ALL = "all";
}

View File

@@ -0,0 +1,33 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.constant;
/**
* 文件常量
*
* @author Jiahang Li
* @version 1.0.0
* @since 2024/4/17 10:35
*/
public interface FileConst {
String ERROR_LOG = "error.log";
String EXEC = "exec";
String SCRIPT = "script";
}

View File

@@ -0,0 +1,31 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.constant;
/**
* 过滤器排序常量
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/6/16 17:04
*/
public interface FilterOrderConst {
int TRICE_ID_FILTER = Integer.MIN_VALUE + 1000;
int CORS_FILTER = Integer.MIN_VALUE + 2000;
}

View File

@@ -0,0 +1,35 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.constant;
/**
* 验证常量
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/10/20 11:45
*/
public interface ValidConst {
String USERNAME_4_32_PATTERN = "^[a-zA-Z0-9_]{4,32}$";
String USERNAME_4_32_MESSAGE = "只能为 4-32 位的数字,字母或下滑线";
String DICT_1_32_PATTERN = "^[a-zA-Z0-9_]{1,32}$";
String DICT_1_32_MESSAGE = "只能为 1-32 位的数字,字母或下滑线";
}

View File

@@ -0,0 +1,55 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.crypto;
import cn.orionsec.kit.lang.utils.codec.Base62s;
import cn.orionsec.kit.lang.utils.crypto.symmetric.SymmetricCrypto;
/**
* 数据加密器
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/7/8 0:20
*/
public interface ValueCrypto extends SymmetricCrypto {
/**
* 初始化
*/
void init();
/**
* 加密后 base62 编码
*
* @param plain 明文
* @return 密文
*/
default String encryptBase62(String plain) {
return new String(Base62s.encode(this.encrypt(plain)));
}
/**
* base62 解码后解密
*
* @param text 密文
* @return 明文
*/
default String decryptBase62(String text) {
return new String(this.decrypt(Base62s.decode(text)));
}
}

View File

@@ -0,0 +1,40 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.entity;
import lombok.Data;
/**
* 自动清理配置
*
* @author Jiahang Li
* @version 1.0.0
* @since 2024/6/24 15:03
*/
@Data
public class AutoClearConfig {
/**
* 是否开启
*/
private Boolean enabled;
/**
* 保留周期 (天)
*/
private Integer keepPeriod;
}

View File

@@ -0,0 +1,41 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.entity;
/**
* 数据清理请求 定义
*
* @author Jiahang Li
* @version 1.0.0
* @since 2024/8/29 11:26
*/
public interface DataClearRequest {
/**
* 获取清理数量限制
*
* @return 清理限制
*/
Integer getLimit();
/**
* 设置清理数量限制
*
* @param limit limit
*/
void setLimit(Integer limit);
}

View File

@@ -0,0 +1,49 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.entity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.dromara.visor.framework.common.validator.group.Page;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* 公共页码请求
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/7/12 23:14
*/
@Data
@Schema(description = "公共页码请求")
public class PageRequest {
@NotNull(groups = Page.class)
@Min(value = 1, groups = Page.class)
@Max(value = 10000, groups = Page.class)
@Schema(description = "页码")
private Integer page;
@NotNull(groups = Page.class)
@Min(value = 1, groups = Page.class)
@Max(value = 200, groups = Page.class)
@Schema(description = "大小")
private Integer limit;
}

View File

@@ -1,4 +1,19 @@
package com.orion.visor.framework.common.entity;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.entity;
import java.io.Serializable;

View File

@@ -0,0 +1,45 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.entity;
import lombok.Data;
/**
* 请求留痕模型
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/12/29 11:57
*/
@Data
public class RequestIdentityModel implements RequestIdentity {
/**
* 请求地址
*/
private String address;
/**
* 请求位置
*/
private String location;
/**
* userAgent
*/
private String userAgent;
}

View File

@@ -0,0 +1,64 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.entity;
import java.util.List;
/**
* 树节点
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/11/23 16:52
*/
public interface TreeNode<T extends TreeNode<T>> {
/**
* id
*
* @return id
*/
Long getId();
/**
* parentId
*
* @return parentId
*/
Long getParentId();
/**
* sort
*
* @return sort
*/
Integer getSort();
/**
* children
*
* @return children
*/
List<T> getChildren();
/**
* 设置 children
*
* @param children children
*/
void setChildren(List<T> children);
}

View File

@@ -1,4 +1,19 @@
package com.orion.visor.framework.common.enums;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;

View File

@@ -0,0 +1,58 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 启用状态
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/10/12 16:02
*/
@Getter
@AllArgsConstructor
public enum EnableStatus {
/**
* 停用
*/
DISABLED(0),
/**
* 启用
*/
ENABLED(1),
;
private final Integer value;
public static EnableStatus of(Integer value) {
if (value == null) {
return null;
}
for (EnableStatus e : values()) {
if (e.value.equals(value)) {
return e;
}
}
return null;
}
}

View File

@@ -0,0 +1,60 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.enums;
import cn.orionsec.kit.lang.utils.Strings;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 端点定义
*
* @author Jiahang Li
* @version 1.0.0
* @since 2024/6/21 19:15
*/
@Getter
@AllArgsConstructor
public enum EndpointDefine {
/**
* 上传临时分区
*/
UPLOAD_SWAP("/upload/swap/{}"),
/**
* 批量执行日志
*/
EXEC_LOG("/exec/{}/{}.log"),
;
/**
* 端点
*/
private final String endpoint;
/**
* 格式化
*
* @param params params
* @return path
*/
public String format(Object... params) {
return Strings.format(this.endpoint, params);
}
}

View File

@@ -1,4 +1,19 @@
package com.orion.visor.framework.common.enums;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;

View File

@@ -1,4 +1,19 @@
package com.orion.visor.framework.common.file;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.file;
import java.io.InputStream;
import java.io.OutputStream;

View File

@@ -1,8 +1,23 @@
package com.orion.visor.framework.common.handler.data;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.handler.data;
import com.orion.spring.SpringHolder;
import com.orion.visor.framework.common.handler.data.model.GenericsDataModel;
import com.orion.visor.framework.common.handler.data.strategy.GenericsDataStrategy;
import cn.orionsec.kit.spring.SpringHolder;
import org.dromara.visor.framework.common.handler.data.model.GenericsDataModel;
import org.dromara.visor.framework.common.handler.data.strategy.GenericsDataStrategy;
/**
* 标准数据定义

View File

@@ -0,0 +1,50 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.handler.data.model;
import com.alibaba.fastjson.JSON;
import java.util.Map;
/**
* 标准数据模型
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/12/20 22:07
*/
public interface GenericsDataModel {
/**
* 序列化
*
* @return json
*/
default String serial() {
return JSON.toJSONString(this);
}
/**
* 转为 map
*
* @return map
*/
default Map<String, Object> toMap() {
return JSON.parseObject(this.serial());
}
}

View File

@@ -1,7 +1,22 @@
package com.orion.visor.framework.common.handler.data.strategy;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.handler.data.strategy;
import com.alibaba.fastjson.JSON;
import com.orion.visor.framework.common.handler.data.model.GenericsDataModel;
import org.dromara.visor.framework.common.handler.data.model.GenericsDataModel;
/**
* 标准数据处理策略 基类

View File

@@ -0,0 +1,61 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.handler.data.strategy;
import org.dromara.visor.framework.common.handler.data.model.GenericsDataModel;
/**
* 标准数据处理策略
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/12/20 22:09
*/
public interface GenericsDataStrategy<M extends GenericsDataModel> {
/**
* 获取默认值
*
* @return 默认值
*/
M getDefault();
/**
* 执行完整验证链
* <p>
* preValid > updateFill > valid
*
* @param beforeModel beforeModel
* @param afterModel afterModel
*/
void doValid(M beforeModel, M afterModel);
/**
* 解析数据
*
* @param serialModel serialModel
* @return model
*/
M parse(String serialModel);
/**
* 转为视图配置
*
* @param model model
*/
void toView(M model);
}

View File

@@ -1,9 +1,24 @@
package com.orion.visor.framework.common.json.filter;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.json.filter;
import cn.orionsec.kit.lang.utils.Desensitizes;
import cn.orionsec.kit.lang.utils.Objects1;
import cn.orionsec.kit.lang.utils.collect.Lists;
import com.alibaba.fastjson.serializer.ValueFilter;
import com.orion.lang.utils.Desensitizes;
import com.orion.lang.utils.Objects1;
import com.orion.lang.utils.collect.Lists;
import java.util.List;

View File

@@ -0,0 +1,43 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.json.filter;
import cn.orionsec.kit.lang.utils.collect.Lists;
import com.alibaba.fastjson.serializer.PropertyFilter;
import java.util.List;
/**
* 字段忽略过滤器
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/10/12 11:21
*/
public class FieldIgnoreFilter implements PropertyFilter {
private final List<String> ignoreFields;
public FieldIgnoreFilter(List<String> ignoreFields) {
this.ignoreFields = ignoreFields;
}
@Override
public boolean apply(Object object, String name, Object value) {
return Lists.isEmpty(ignoreFields) || !ignoreFields.contains(name);
}
}

View File

@@ -0,0 +1,48 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.lock;
import java.util.function.Supplier;
/**
* 分布式锁
*
* @author Jiahang Li
* @version 1.0.0
* @since 2024/5/16 12:24
*/
public interface Locker {
/**
* 尝试获取锁
*
* @param key key
* @param run run
* @return 是否获取到锁
*/
boolean tryLock(String key, Runnable run);
/**
* 尝试获取锁
*
* @param key key
* @param call call
* @param <T> T
* @return 执行结果
*/
<T> T tryLock(String key, Supplier<T> call);
}

View File

@@ -0,0 +1,113 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.meta;
import cn.orionsec.kit.lang.id.UUIds;
import com.alibaba.ttl.TransmittableThreadLocal;
import org.slf4j.MDC;
/**
* traceId 持有者
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/6/16 17:35
*/
public class TraceIdHolder {
public static final String TRACE_ID_HEADER = "trace-id";
public static final String TRACE_ID_MDC = "tid";
private TraceIdHolder() {
}
/**
* 请求序列
*/
private static final ThreadLocal<String> HOLDER = new TransmittableThreadLocal<>();
/**
* 获取 traceId
*
* @return traceId
*/
public static String get() {
return HOLDER.get();
}
/**
* 设置 traceId
*/
public static void set() {
set(createTraceId());
}
/**
* 设置 traceId
*
* @param traceId traceId
*/
public static void set(String traceId) {
// 设置应用上下文
HOLDER.set(traceId);
// 设置日志上下文
setMdc(traceId);
}
/**
* 删除 traceId
*/
public static void remove() {
// 移除应用上下文
HOLDER.remove();
// 移除日志上下文
removeMdc();
}
/**
* 从应用上下文 设置到日志上下文
*/
public static void setMdc() {
setMdc(HOLDER.get());
}
/**
* 设置到日志上下文
*
* @param traceId traceId
*/
public static void setMdc(String traceId) {
MDC.put(TRACE_ID_MDC, traceId);
}
/**
* 移除日志上下文
*/
public static void removeMdc() {
MDC.remove(TRACE_ID_MDC);
}
/**
* 创建 traceId
*
* @return traceId
*/
public static String createTraceId() {
return UUIds.random32();
}
}

View File

@@ -1,4 +1,19 @@
package com.orion.visor.framework.common.security;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.security;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

View File

@@ -0,0 +1,55 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.security;
import cn.orionsec.kit.lang.utils.Booleans;
import cn.orionsec.kit.lang.utils.Strings;
import org.dromara.visor.framework.common.constant.Const;
import org.dromara.visor.framework.common.utils.CryptoUtils;
/**
* 密码修改器
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/9/21 11:35
*/
public class PasswordModifier {
private PasswordModifier() {
}
/**
* 获取新密码
*
* @param action action
* @return password
*/
public static String getEncryptNewPassword(UpdatePasswordAction action) {
if (Booleans.isTrue(action.getUseNewPassword())) {
// 使用新密码
String password = action.getPassword();
if (Strings.isBlank(password)) {
return Const.EMPTY;
} else {
return CryptoUtils.encryptAsString(password);
}
} else {
return null;
}
}
}

View File

@@ -0,0 +1,41 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.security;
/**
* SecurityUtils 的 bean 对象
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/7/7 15:20
*/
public interface SecurityHolder {
/**
* 获取当前用户
*
* @return 当前用户
*/
LoginUser getLoginUser();
/**
* 获取当前用户id
*
* @return id
*/
Long getLoginUserId();
}

View File

@@ -0,0 +1,43 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.security;
import java.io.Serializable;
/**
* 更新密码操作
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/9/21 11:32
*/
public interface UpdatePasswordAction extends Serializable {
/**
* 是否使用新密码
*
* @return use
*/
Boolean getUseNewPassword();
/**
* 获取密码
*
* @return password
*/
String getPassword();
}

View File

@@ -0,0 +1,43 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.security;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
/**
* 用户角色
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/11/20 23:39
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
@Schema(name = "UserRole", description = "用户角色")
public class UserRole {
@EqualsAndHashCode.Include
@Schema(description = "id")
private Long id;
@Schema(description = "角色")
private String code;
}

View File

@@ -0,0 +1,48 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.thread;
import org.dromara.visor.framework.common.utils.ThreadMdcUtils;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
/**
* 自动注入 MDC 异步线程池
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/7/10 15:16
*/
public class ThreadPoolMdcTaskExecutor extends ThreadPoolTaskExecutor {
@Override
public void execute(Runnable task) {
super.execute(ThreadMdcUtils.wrap(task));
}
@Override
public <T> Future<T> submit(Callable<T> task) {
return super.submit(ThreadMdcUtils.wrap(task));
}
@Override
public Future<?> submit(Runnable task) {
return super.submit(ThreadMdcUtils.wrap(task));
}
}

View File

@@ -1,6 +1,21 @@
package com.orion.visor.framework.common.utils;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.utils;
import com.orion.lang.constant.Const;
import cn.orionsec.kit.lang.constant.Const;
import java.util.Arrays;
import java.util.List;

View File

@@ -1,7 +1,22 @@
package com.orion.visor.framework.common.utils;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.utils;
import com.orion.lang.utils.Exceptions;
import com.orion.visor.framework.common.crypto.ValueCrypto;
import cn.orionsec.kit.lang.utils.Exceptions;
import org.dromara.visor.framework.common.crypto.ValueCrypto;
/**
* 加密工具类

View File

@@ -1,7 +1,22 @@
package com.orion.visor.framework.common.utils;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.utils;
import com.orion.lang.utils.Exceptions;
import com.orion.visor.framework.common.file.FileClient;
import cn.orionsec.kit.lang.utils.Exceptions;
import org.dromara.visor.framework.common.file.FileClient;
import java.io.InputStream;
import java.io.OutputStream;

View File

@@ -0,0 +1,43 @@
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.utils;
import cn.orionsec.kit.lang.utils.time.Dates;
import org.dromara.visor.framework.common.constant.Const;
/**
* 文件名称
*
* @author Jiahang Li
* @version 1.0.0
* @since 2023/8/31 17:57
*/
public class FileNames {
private FileNames() {
}
/**
* 导出文件名称
*
* @param title title
* @return name
*/
public static String exportName(String title) {
return title + "-" + Dates.current(Dates.YMD_HMS2) + "." + Const.SUFFIX_XLSX;
}
}

View File

@@ -1,11 +1,24 @@
package com.orion.visor.framework.common.utils;
/*
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dromara.visor.framework.common.utils;
import com.orion.ext.location.Region;
import com.orion.ext.location.region.LocationRegions;
import com.orion.lang.constant.StandardHttpHeader;
import com.orion.lang.utils.Strings;
import com.orion.visor.framework.common.constant.Const;
import com.orion.web.servlet.web.Servlets;
import cn.orionsec.kit.ext.location.Region;
import cn.orionsec.kit.ext.location.region.LocationRegions;
import cn.orionsec.kit.web.servlet.web.Servlets;
import org.dromara.visor.framework.common.constant.Const;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
@@ -32,11 +45,11 @@ public class IpUtils {
* @return addr
*/
public static String getRemoteAddr(HttpServletRequest request) {
// 获取实际地址
String realIp = request.getHeader(StandardHttpHeader.X_REAL_IP);
if (!Strings.isBlank(realIp)) {
return realIp;
}
// 获取实际地址 X_REAL_IP 在多代理情况下会有问题
// String realIp = request.getHeader(StandardHttpHeader.X_REAL_IP);
// if (!Strings.isBlank(realIp)) {
// return realIp;
// }
// 获取请求地址
return Servlets.getRemoteAddr(request);
}

Some files were not shown because too many files have changed in this diff Show More