Compare commits
204 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f79d89def9 | ||
|
|
fd535f00c8 | ||
|
|
2c07551b88 | ||
|
|
86914321a6 | ||
|
|
f64c15a01b | ||
|
|
8265cc3cfd | ||
|
|
84c8bc98af | ||
|
|
858ca1becc | ||
|
|
0e0c9cc628 | ||
|
|
cdc3c88507 | ||
|
|
10624b42c4 | ||
|
|
6479694b4b | ||
|
|
d2e72aea56 | ||
|
|
986f0974db | ||
|
|
6b5c7fd409 | ||
|
|
ca803e4e5a | ||
|
|
5de22e4b41 | ||
|
|
b8e81ee100 | ||
|
|
0b53924dbd | ||
|
|
3359d163fb | ||
|
|
2ef1517338 | ||
|
|
a5bee66afa | ||
|
|
88fd0e31e0 | ||
|
|
226dfb2c25 | ||
|
|
94ed071897 | ||
|
|
4efd2b5ec2 | ||
|
|
76e766367f | ||
|
|
b3009bb65e | ||
|
|
819520ef73 | ||
|
|
a2acbc0c3a | ||
|
|
2e8a7c40d9 | ||
|
|
94c0b6a785 | ||
|
|
9752dfa680 | ||
|
|
bc776e4186 | ||
|
|
cdce5a0dc1 | ||
|
|
0db732fc19 | ||
|
|
69f331c048 | ||
|
|
032f1763f6 | ||
|
|
d071ef64d8 | ||
|
|
c820443a3b | ||
|
|
14c4e77445 | ||
|
|
79d9f69ed4 | ||
|
|
6c9065072d | ||
|
|
05bc6c1fbb | ||
|
|
a1dd9eec01 | ||
|
|
660df7c110 | ||
|
|
093501a400 | ||
|
|
7943deb924 | ||
|
|
490167e649 | ||
|
|
8635f6bb05 | ||
|
|
9e31d820e0 | ||
|
|
92353d859a | ||
|
|
bef8d69e59 | ||
|
|
ac46dd6703 | ||
|
|
b3ab78e063 | ||
|
|
95d2c6cb65 | ||
|
|
7017c7502b | ||
|
|
c14055ba8c | ||
|
|
04aa6c9680 | ||
|
|
397bbb2657 | ||
|
|
9a68282127 | ||
|
|
dcd02acc61 | ||
|
|
1025688e9b | ||
|
|
26eeb26a75 | ||
|
|
7f76325284 | ||
|
|
de9a921c49 | ||
|
|
a9ac9d0f79 | ||
|
|
a14b28de6a | ||
|
|
ccd7430b8f | ||
|
|
6791ea5770 | ||
|
|
2d5835b150 | ||
|
|
cec11ce8c3 | ||
|
|
972103841c | ||
|
|
89f6d2cd1c | ||
|
|
d13008ce0c | ||
|
|
abf384dd3c | ||
|
|
0abd4a893b | ||
|
|
d0710fb52b | ||
|
|
534fe83ac2 | ||
|
|
d95d958de0 | ||
|
|
4e5730f31f | ||
|
|
81b9bacb96 | ||
|
|
dc42a31711 | ||
|
|
27e3e65ea1 | ||
|
|
a001ab3f16 | ||
|
|
aeb161a482 | ||
|
|
5ecb476be5 | ||
|
|
5389334304 | ||
|
|
56ece9c854 | ||
|
|
a217b95783 | ||
|
|
ffcdd80996 | ||
|
|
f804dc0338 | ||
|
|
25359f0f66 | ||
|
|
932bdb86ad | ||
|
|
0e14e55c5a | ||
|
|
e2a645d1e1 | ||
|
|
51392e09e2 | ||
|
|
8d71d64d49 | ||
|
|
956c34176d | ||
|
|
f65aa89421 | ||
|
|
c481cb0ae4 | ||
|
|
a734ec40ec | ||
|
|
2a5bda3d00 | ||
|
|
72579c7e83 | ||
|
|
41797e41d2 | ||
|
|
35733e80eb | ||
|
|
4119dbad6a | ||
|
|
c0122079c1 | ||
|
|
c793ebf394 | ||
|
|
45b3e0746a | ||
|
|
aaf18d79bf | ||
|
|
4e3f548ac8 | ||
|
|
cbe1eeec74 | ||
|
|
0557c41454 | ||
|
|
c2311f0682 | ||
|
|
3b89e9bf29 | ||
|
|
6b14c2ef9c | ||
|
|
6606d2ca76 | ||
|
|
1846a496c1 | ||
|
|
7996ae5b63 | ||
|
|
cb5657c685 | ||
|
|
95759adf91 | ||
|
|
4d08a18548 | ||
|
|
8f1e976c2f | ||
|
|
5ee18436b8 | ||
|
|
00ea709f9e | ||
|
|
4873d2cc91 | ||
|
|
4c306fb4f8 | ||
|
|
9017ada3aa | ||
|
|
00c4484184 | ||
|
|
5a6b1bfafd | ||
|
|
c25e74c296 | ||
|
|
bbe2980998 | ||
|
|
544a01534d | ||
|
|
41a9bebe06 | ||
|
|
c84452630a | ||
|
|
23bf0e360f | ||
|
|
62eb8f2d9a | ||
|
|
adcc6dddef | ||
|
|
8bbda6691d | ||
|
|
79f14632bb | ||
|
|
d51de4a520 | ||
|
|
f65e17c723 | ||
|
|
c04859294c | ||
|
|
23363efade | ||
|
|
933e9d90d1 | ||
|
|
b2341ce62e | ||
|
|
7fb17a173e | ||
|
|
c95d52e197 | ||
|
|
d651c37e87 | ||
|
|
1d89b392b0 | ||
|
|
04327c19e3 | ||
|
|
786d07907d | ||
|
|
1227ed1770 | ||
|
|
6d74b4379e | ||
|
|
985091f42b | ||
|
|
885446dc58 | ||
|
|
dd973a46fc | ||
|
|
190b78d14a | ||
|
|
824f7317d7 | ||
|
|
247ae2c862 | ||
|
|
f52a81f9d0 | ||
|
|
32e4859ba7 | ||
|
|
0de59dd77d | ||
|
|
d0b25c38a6 | ||
|
|
9fe2531d2f | ||
|
|
28ce2317c0 | ||
|
|
f38ae06fa0 | ||
|
|
e434d85ea5 | ||
|
|
d303406332 | ||
|
|
952d63b282 | ||
|
|
cffb3c9e90 | ||
|
|
d828d4a754 | ||
|
|
30ff601078 | ||
|
|
eb18f4281a | ||
|
|
b850aa1f7f | ||
|
|
100b5e8740 | ||
|
|
148d9f1201 | ||
|
|
88ddc7c4b2 | ||
|
|
4a2c01fba6 | ||
|
|
45c83f6080 | ||
|
|
08a0eeb6b5 | ||
|
|
73b034b27c | ||
|
|
95a31d613d | ||
|
|
8027d39938 | ||
|
|
e3d33295fe | ||
|
|
691c61613f | ||
|
|
a75ce2143d | ||
|
|
cb828e5684 | ||
|
|
168f193416 | ||
|
|
211a50d33d | ||
|
|
713af9d032 | ||
|
|
214b6fe9ac | ||
|
|
343c188749 | ||
|
|
fc6418caf3 | ||
|
|
cf093e1023 | ||
|
|
90eb6003c9 | ||
|
|
652691b32b | ||
|
|
eb77f33574 | ||
|
|
9bfd5888bf | ||
|
|
73c18c79b8 | ||
|
|
562052b868 | ||
|
|
6f42d41344 | ||
|
|
8db677684d |
@@ -1,6 +1,9 @@
|
||||
SERVICE_PORT=1081
|
||||
VOLUME_BASE=/data/orion-visor-space/docker-volumes
|
||||
|
||||
SERVICE_PORT=1081
|
||||
SPRING_PROFILES_ACTIVE=prod
|
||||
SECRET_KEY=uQeacXV8b3isvKLK
|
||||
|
||||
MYSQL_HOST=mysql
|
||||
MYSQL_PORT=3306
|
||||
MYSQL_DATABASE=orion_visor
|
||||
@@ -11,5 +14,4 @@ MYSQL_ROOT_PASSWORD=Data@123456
|
||||
REDIS_HOST=redis
|
||||
REDIS_PASSWORD=Data@123456
|
||||
|
||||
SECRET_KEY=uQeacXV8b3isvKLK
|
||||
DEMO_MODE=false
|
||||
|
||||
2
NOTICE
2
NOTICE
@@ -5,5 +5,5 @@
|
||||
1. 禁止修改或删除 LICENSE 文件。
|
||||
2. 禁止修改或删除源码头部的版权声明。
|
||||
3. 本项目可免费商业使用,商业使用请保留项目源码、出处、描述文件和作者声明等。
|
||||
4. 分发源码时候,请注明软件出处 https://visor.orionsec.cn/
|
||||
4. 分发源码时候,请注明软件出处 https://visor.dromara.org/
|
||||
5. 不可二次开发或参与同类竞品的开发。
|
||||
|
||||
49
README.md
49
README.md
@@ -1,5 +1,5 @@
|
||||
<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>一款高颜值、现代化的自动化运维&轻量堡垒机平台。</b></p>
|
||||
<p style="margin-top: 12px" align="center"><b>【Dromara】 一款高颜值、现代化的自动化运维&轻量堡垒机平台。</b></p>
|
||||
<p align="center">
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
@@ -9,12 +9,12 @@
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
href="https://www.apache.org/licenses/LICENSE-2.0">
|
||||
<img src="https://img.shields.io/github/license/lijiahangmax/orion-visor" alt="License" />
|
||||
<img src="https://img.shields.io/github/license/dromara/orion-visor" alt="License" />
|
||||
</a>
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
href="https://github.com/dromara/orion-visor/releases">
|
||||
<img src="https://img.shields.io/github/v/release/lijiahangmax/orion-visor" alt="release" />
|
||||
<img src="https://img.shields.io/github/v/release/dromara/orion-visor" alt="release" />
|
||||
</a>
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
@@ -29,12 +29,17 @@
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
href="https://github.com/dromara/orion-visor">
|
||||
<img src="https://img.shields.io/github/stars/lijiahangmax/orion-visor" alt="star" />
|
||||
<img src="https://img.shields.io/github/stars/dromara/orion-visor" alt="star" />
|
||||
</a>
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
href="https://github.com/dromara/orion-visor">
|
||||
<img src="https://img.shields.io/github/forks/lijiahangmax/orion-visor" alt="star" />
|
||||
<img src="https://img.shields.io/github/forks/dromara/orion-visor" alt="star" />
|
||||
</a>
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
href="https://gitcode.com/dromara/orion-visor">
|
||||
<img src="https://gitcode.com/dromara/orion-visor/star/badge.svg" alt="star"/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
@@ -53,11 +58,13 @@
|
||||
|
||||
* 🔗 演示地址: [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) [gitcode](https://gitcode.com/dromara/orion-visor/overview)
|
||||
* ⭐ 体验后可以点一下 `star`
|
||||
这对我很重要! [github](https://github.com/dromara/orion-visor) [gitee](https://gitee.com/dromara/orion-visor) [gitcode](https://gitcode.com/dromara/orion-visor)
|
||||
* 🌈 如果本项目对你有帮助请帮忙推广一下 让更多的人知道此项目!
|
||||
* 🎭 演示环境部分功能不可用, 完整功能请本地部署!
|
||||
* 📛 演示环境请不要随便删除数据!
|
||||
* 📧 如果演示环境不可用请联系我!
|
||||
* 📨 **作者已被毕(cai)业(yuan) 寻java高级内推 望京/5号/10号线 有坑位的联系我哦** 微信: `ljh1553488`
|
||||
|
||||
## 快速开始
|
||||
|
||||
@@ -72,19 +79,19 @@ docker compose up -d
|
||||
|
||||
## 项目文档
|
||||
|
||||
* [文档地址](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)
|
||||
* [文档地址](https://visor.dromara.org/)
|
||||
* [安装文档](https://visor.dromara.org/quickstart/docker.html)
|
||||
* [更新日志](https://visor.dromara.org/update/change-log.html)
|
||||
* [操作手册](https://visor.dromara.org/operator/asset.html)
|
||||
* [常见问题](https://visor.dromara.org/support/faq.html)
|
||||
|
||||
## 技术栈
|
||||
|
||||
* SpringBoot 2.7.17
|
||||
* Mysql 8.0.+
|
||||
* Redis 6.0.+
|
||||
* Vue3 3.2.+
|
||||
* Arco Design 2.55.+
|
||||
* SpringBoot 2.7+
|
||||
* Mysql 8+
|
||||
* Redis 6+
|
||||
* Vue3 3+
|
||||
* Arco Design 2+
|
||||
|
||||
## 主要功能预览
|
||||
|
||||
@@ -109,7 +116,7 @@ docker compose up -d
|
||||
|
||||
## Star History
|
||||
|
||||
[](https://star-history.com/#lijiahangmax/orion-visor&Date)
|
||||
[](https://star-history.com/#dromara/orion-visor&Date)
|
||||
|
||||
## 关于我
|
||||
|
||||
@@ -122,7 +129,7 @@ docker compose up -d
|
||||
微信: ljh1553488
|
||||
QQ群: 755242157
|
||||
|
||||
📧 咨询问题微信备注: vis
|
||||
📧 问题/加群微信备注: ops
|
||||
📧 合作/功能定制备注: 合作
|
||||
|
||||
## 支持一下
|
||||
@@ -137,4 +144,8 @@ QQ群: 755242157
|
||||
|
||||
## 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) 开源许可证。
|
||||
|
||||
## Gitee 最有价值开源项目 GVP
|
||||
|
||||

|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
version: '3.3'
|
||||
|
||||
services:
|
||||
service:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.1.8
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:latest
|
||||
privileged: true
|
||||
ports:
|
||||
- 1081:80
|
||||
- 9200:9200
|
||||
environment:
|
||||
- SPRING_PROFILES_ACTIVE=prod
|
||||
- MYSQL_HOST=mysql
|
||||
- MYSQL_PORT=3306
|
||||
- MYSQL_DATABASE=orion_visor
|
||||
@@ -19,20 +21,20 @@ services:
|
||||
- /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
|
||||
timeout: 300s
|
||||
retries: 200
|
||||
start_period: 3s
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 15s
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
links:
|
||||
- mysql
|
||||
- redis
|
||||
networks:
|
||||
- orion-visor-net
|
||||
|
||||
mysql:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.1.8
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:latest
|
||||
privileged: true
|
||||
ports:
|
||||
- 3307:3306
|
||||
@@ -44,15 +46,17 @@ services:
|
||||
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
|
||||
healthcheck:
|
||||
test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/3306" ]
|
||||
interval: 3s
|
||||
timeout: 60s
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 3s
|
||||
start_period: 5s
|
||||
networks:
|
||||
- orion-visor-net
|
||||
|
||||
redis:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.1.8
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:latest
|
||||
privileged: true
|
||||
ports:
|
||||
- 6380:6379
|
||||
@@ -63,17 +67,24 @@ services:
|
||||
command: sh -c "redis-server /usr/local/redis.conf --requirepass $${REDIS_PASSWORD}"
|
||||
healthcheck:
|
||||
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
||||
interval: 3s
|
||||
timeout: 60s
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 3s
|
||||
start_period: 5s
|
||||
networks:
|
||||
- orion-visor-net
|
||||
|
||||
testing:
|
||||
build:
|
||||
context: ./docker/e2e
|
||||
environment:
|
||||
SERVER: http://service:80
|
||||
SERVER: http://service:9200
|
||||
depends_on:
|
||||
service:
|
||||
condition: service_healthy
|
||||
links:
|
||||
- service
|
||||
networks:
|
||||
- orion-visor-net
|
||||
|
||||
networks:
|
||||
orion-visor-net:
|
||||
driver: bridge
|
||||
@@ -1,11 +1,24 @@
|
||||
version: '3.3'
|
||||
|
||||
services:
|
||||
service:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.1.8
|
||||
privileged: true
|
||||
ui:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-ui:latest
|
||||
ports:
|
||||
- ${SERVICE_PORT:-1081}:80
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
service:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- orion-visor-net
|
||||
|
||||
service:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:latest
|
||||
privileged: true
|
||||
ports:
|
||||
- 9200:9200
|
||||
environment:
|
||||
- SPRING_PROFILES_ACTIVE=${SPRING_PROFILES_ACTIVE:-prod}
|
||||
- MYSQL_HOST=${MYSQL_HOST:-mysql}
|
||||
- MYSQL_PORT=${MYSQL_PORT:-3306}
|
||||
- MYSQL_DATABASE=${MYSQL_DATABASE:-orion_visor}
|
||||
@@ -17,22 +30,23 @@ services:
|
||||
- DEMO_MODE=${DEMO_MODE:-false}
|
||||
volumes:
|
||||
- ${VOLUME_BASE:-/data/orion-visor-space/docker-volumes}/service/root-orion:/root/orion
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "http://127.0.0.1:9200/orion-visor/api/server/bootstrap/health" ]
|
||||
interval: 15s
|
||||
timeout: 300s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
start_period: 3s
|
||||
start_period: 30s
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
links:
|
||||
- mysql
|
||||
- redis
|
||||
networks:
|
||||
- orion-visor-net
|
||||
|
||||
mysql:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.1.8
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:latest
|
||||
privileged: true
|
||||
ports:
|
||||
- 3307:3306
|
||||
@@ -44,15 +58,18 @@ services:
|
||||
volumes:
|
||||
- ${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
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/3306" ]
|
||||
interval: 15s
|
||||
timeout: 60s
|
||||
retries: 15
|
||||
start_period: 3s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
networks:
|
||||
- orion-visor-net
|
||||
|
||||
redis:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.1.8
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:latest
|
||||
privileged: true
|
||||
ports:
|
||||
- 6380:6379
|
||||
@@ -61,18 +78,28 @@ services:
|
||||
volumes:
|
||||
- ${VOLUME_BASE:-/data/orion-visor-space/docker-volumes}/redis/data:/data
|
||||
command: sh -c "redis-server /usr/local/redis.conf --requirepass $${REDIS_PASSWORD}"
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
||||
interval: 15s
|
||||
timeout: 60s
|
||||
retries: 15
|
||||
start_period: 3s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
networks:
|
||||
- orion-visor-net
|
||||
|
||||
adminer:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-adminer:2.1.8
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:latest
|
||||
ports:
|
||||
- 8081:8080
|
||||
environment:
|
||||
- ADMINER_DEFAULT_SERVER=${MYSQL_HOST:-mysql}
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
links:
|
||||
- mysql
|
||||
networks:
|
||||
- orion-visor-net
|
||||
|
||||
networks:
|
||||
orion-visor-net:
|
||||
driver: bridge
|
||||
@@ -1,4 +1,6 @@
|
||||
#/bin/bash
|
||||
version=2.1.8
|
||||
set -e
|
||||
version=2.3.8
|
||||
docker build -t orion-visor-adminer:${version} .
|
||||
docker tag orion-visor-adminer:${version} registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-adminer:${version}
|
||||
docker tag orion-visor-adminer:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:${version}
|
||||
docker tag orion-visor-adminer:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:latest
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# yaml-language-server: $schema=https://linuxsuren.github.io/api-testing/api-testing-schema.json
|
||||
name: orion-visor
|
||||
api: |
|
||||
{{default "http://orion-visor-service:80" (env "SERVER")}}
|
||||
{{default "http://service:9200" (env "SERVER")}}
|
||||
items:
|
||||
- name: login
|
||||
request:
|
||||
@@ -15,9 +15,9 @@ items:
|
||||
expect:
|
||||
bodyFieldsExpect:
|
||||
code: 200
|
||||
- name: userPermission
|
||||
- name: user
|
||||
request:
|
||||
api: /orion-visor/api/infra/user-permission/user
|
||||
api: /orion-visor/api/infra/user-aggregate/user
|
||||
header:
|
||||
Authorization: Bearer {{.login.data.token}}
|
||||
expect:
|
||||
@@ -26,7 +26,7 @@ items:
|
||||
msg: "success"
|
||||
- name: menu
|
||||
request:
|
||||
api: /orion-visor/api/infra/user-permission/menu
|
||||
api: /orion-visor/api/infra/user-aggregate/menu
|
||||
header:
|
||||
Authorization: Bearer {{.login.data.token}}
|
||||
expect:
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#/bin/bash
|
||||
version=2.1.8
|
||||
set -e
|
||||
version=2.3.8
|
||||
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 tag orion-visor-mysql:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:${version}
|
||||
docker tag orion-visor-mysql:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:latest
|
||||
|
||||
@@ -12,13 +12,13 @@ socket=/var/run/mysqld/mysqld.sock
|
||||
# 数据目录
|
||||
datadir=/var/lib/mysql
|
||||
# 不区分大小 0区分 1不区分
|
||||
lower_case_table_names=1
|
||||
lower_case_table_names=0
|
||||
# 服务器时区
|
||||
default-time_zone='+8:00'
|
||||
# 服务端字符集
|
||||
character_set_server=utf8mb4
|
||||
# 字符排序规则
|
||||
collation_server=utf8mb4_general_ci
|
||||
collation_server=utf8mb4_unicode_ci
|
||||
# 默认存储引擎
|
||||
default-storage-engine=InnoDB
|
||||
# 禁止 DNS 解析
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
#/bin/bash
|
||||
version=2.1.8
|
||||
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}
|
||||
set -e
|
||||
version=2.3.8
|
||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:${version}
|
||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:${version}
|
||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:${version}
|
||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:${version}
|
||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-ui:${version}
|
||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:latest
|
||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:latest
|
||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:latest
|
||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:latest
|
||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-ui:latest
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#/bin/bash
|
||||
version=2.1.8
|
||||
set -e
|
||||
version=2.3.8
|
||||
docker build -t orion-visor-redis:${version} .
|
||||
docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version}
|
||||
docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:${version}
|
||||
docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:latest
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM nginx:alpine
|
||||
FROM openjdk:8-jdk-alpine
|
||||
USER root
|
||||
WORKDIR /app
|
||||
# 系统时区
|
||||
@@ -7,18 +7,14 @@ ARG TZ=Asia/Shanghai
|
||||
RUN \
|
||||
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
|
||||
apk update && \
|
||||
apk add curl && \
|
||||
apk add udev && \
|
||||
apk add tzdata && \
|
||||
apk add dmidecode && \
|
||||
apk add openjdk8
|
||||
apk add dmidecode
|
||||
# 设置时区
|
||||
RUN ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
|
||||
echo '${TZ}' > /etc/timezone
|
||||
# 删除原 nginx 配置
|
||||
RUN rm -rf /etc/nginx/conf.d/*
|
||||
# 复制包
|
||||
COPY ./orion-visor-launch.jar /app/app.jar
|
||||
COPY ./dist /usr/share/nginx/html
|
||||
COPY ./entrypoint.sh /app/entrypoint.sh
|
||||
COPY ./nginx.conf /etc/nginx/conf.d
|
||||
# 启动
|
||||
ENTRYPOINT [ "sh", "/app/entrypoint.sh" ]
|
||||
CMD ["java", "-jar", "/app/app.jar"]
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#/bin/bash
|
||||
version=2.1.8
|
||||
set -e
|
||||
version=2.3.8
|
||||
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} .
|
||||
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 tag orion-visor-service:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:${version}
|
||||
docker tag orion-visor-service:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:latest
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/bash
|
||||
cd /app
|
||||
nohup java -jar app.jar --spring.profiles.active=prod 2>&1 &
|
||||
nginx -g 'daemon off;'
|
||||
18
docker/ui/Dockerfile
Normal file
18
docker/ui/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM nginx:alpine
|
||||
# 系统时区
|
||||
ARG TZ=Asia/Shanghai
|
||||
# 添加包
|
||||
RUN \
|
||||
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
|
||||
apk update && \
|
||||
apk add tzdata
|
||||
# 设置时区
|
||||
RUN ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
|
||||
echo '${TZ}' > /etc/timezone
|
||||
# 删除原 nginx 配置
|
||||
RUN rm -rf /etc/nginx/conf.d/*
|
||||
# 复制包
|
||||
COPY ./dist /usr/share/nginx/html
|
||||
COPY ./nginx.conf /etc/nginx/conf.d
|
||||
# 启动
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
9
docker/ui/build.sh
Normal file
9
docker/ui/build.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#/bin/bash
|
||||
set -e
|
||||
version=2.3.8
|
||||
mv ../../orion-visor-ui/dist ./dist
|
||||
docker build -t orion-visor-ui:${version} .
|
||||
rm -rf ./orion-visor-launch.jar
|
||||
rm -rf ./dist
|
||||
docker tag orion-visor-ui:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-ui:${version}
|
||||
docker tag orion-visor-ui:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-ui:latest
|
||||
@@ -19,7 +19,7 @@ server {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
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;
|
||||
# web history 模式 404
|
||||
@@ -27,7 +27,7 @@ server {
|
||||
}
|
||||
|
||||
location /orion-visor/api {
|
||||
proxy_pass http://localhost:9200/orion-visor/api;
|
||||
proxy_pass http://service:9200/orion-visor/api;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -35,7 +35,7 @@ server {
|
||||
}
|
||||
|
||||
location /orion-visor/keep-alive {
|
||||
proxy_pass http://localhost:9200/orion-visor/keep-alive;
|
||||
proxy_pass http://service:9200/orion-visor/keep-alive;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
@@ -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,
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
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>
|
||||
<artifactId>orion-visor-framework</artifactId>
|
||||
<groupId>org.dromara.visor</groupId>
|
||||
<artifactId>orion-visor</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>orion-visor-framework-common</artifactId>
|
||||
<artifactId>orion-visor-common</artifactId>
|
||||
<name>${project.artifactId}</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.github.lijiahangmax</groupId>
|
||||
<groupId>cn.orionsec.kit</groupId>
|
||||
<artifactId>orion-all</artifactId>
|
||||
</dependency>
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* 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.common.config;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* 配置引用
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2025/1/6 18:01
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class ConfigRef<T> {
|
||||
|
||||
public final String key;
|
||||
|
||||
public T value;
|
||||
|
||||
protected final Function<String, T> convert;
|
||||
|
||||
public ConfigRef(String key, Function<String, T> convert) {
|
||||
this.key = key;
|
||||
this.convert = convert;
|
||||
}
|
||||
|
||||
/**
|
||||
* 覆盖配置
|
||||
*
|
||||
* @param value value
|
||||
*/
|
||||
public abstract void override(String value);
|
||||
|
||||
/**
|
||||
* 修改配置
|
||||
*
|
||||
* @param value value
|
||||
*/
|
||||
public abstract void set(T value);
|
||||
|
||||
/**
|
||||
* 获取配置
|
||||
*
|
||||
* @return value
|
||||
*/
|
||||
public abstract T get();
|
||||
|
||||
/**
|
||||
* 修改回调
|
||||
*
|
||||
* @param changeEvent changeEvent
|
||||
* @return this
|
||||
*/
|
||||
public abstract ConfigRef<T> onChange(BiConsumer<T, T> changeEvent);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* 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.common.config;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* 配置中心
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2025/1/5 21:30
|
||||
*/
|
||||
public interface ConfigStore {
|
||||
|
||||
/**
|
||||
* 获取 string 配置
|
||||
*
|
||||
* @param key key
|
||||
* @return config
|
||||
*/
|
||||
String getString(String key);
|
||||
|
||||
/**
|
||||
* 获取 string 配置
|
||||
*
|
||||
* @param key key
|
||||
* @param defaultValue defaultValue
|
||||
* @return config
|
||||
*/
|
||||
String getString(String key, String defaultValue);
|
||||
|
||||
/**
|
||||
* 获取 int 配置
|
||||
*
|
||||
* @param key key
|
||||
* @return config
|
||||
*/
|
||||
Integer getInteger(String key);
|
||||
|
||||
/**
|
||||
* 获取 int 配置
|
||||
*
|
||||
* @param key key
|
||||
* @param defaultValue defaultValue
|
||||
* @return config
|
||||
*/
|
||||
Integer getInteger(String key, Integer defaultValue);
|
||||
|
||||
/**
|
||||
* 获取 long 配置
|
||||
*
|
||||
* @param key key
|
||||
* @return config
|
||||
*/
|
||||
Long getLong(String key);
|
||||
|
||||
/**
|
||||
* 获取 long 配置
|
||||
*
|
||||
* @param key key
|
||||
* @param defaultValue defaultValue
|
||||
* @return config
|
||||
*/
|
||||
Long getLong(String key, Long defaultValue);
|
||||
|
||||
/**
|
||||
* 获取 double 配置
|
||||
*
|
||||
* @param key key
|
||||
* @return config
|
||||
*/
|
||||
Double getDouble(String key);
|
||||
|
||||
/**
|
||||
* 获取 double 配置
|
||||
*
|
||||
* @param key key
|
||||
* @param defaultValue defaultValue
|
||||
* @return config
|
||||
*/
|
||||
Double getDouble(String key, Double defaultValue);
|
||||
|
||||
/**
|
||||
* 获取 boolean 配置
|
||||
*
|
||||
* @param key key
|
||||
* @return config
|
||||
*/
|
||||
Boolean getBoolean(String key);
|
||||
|
||||
/**
|
||||
* 获取 boolean 配置
|
||||
*
|
||||
* @param key key
|
||||
* @param defaultValue defaultValue
|
||||
* @return config
|
||||
*/
|
||||
Boolean getBoolean(String key, Boolean defaultValue);
|
||||
|
||||
/**
|
||||
* 获取配置
|
||||
*
|
||||
* @param key key
|
||||
* @return conf
|
||||
*/
|
||||
String getConfig(String key);
|
||||
|
||||
/**
|
||||
* 获取配置
|
||||
*
|
||||
* @param key key
|
||||
* @param defaultValue defaultValue
|
||||
* @return conf
|
||||
*/
|
||||
String getConfig(String key, String defaultValue);
|
||||
|
||||
/**
|
||||
* 获取配置
|
||||
*
|
||||
* @param key key
|
||||
* @param convert convert
|
||||
* @param <T> T
|
||||
* @return conf
|
||||
*/
|
||||
<T> T getConfig(String key, Function<String, T> convert);
|
||||
|
||||
/**
|
||||
* 获取配置
|
||||
*
|
||||
* @param key key
|
||||
* @param convert convert
|
||||
* @param defaultValue defaultValue
|
||||
* @param <T> T
|
||||
* @return conf
|
||||
*/
|
||||
<T> T getConfig(String key, Function<String, T> convert, T defaultValue);
|
||||
|
||||
/**
|
||||
* 获取 string 配置
|
||||
*
|
||||
* @param key key
|
||||
* @return ref
|
||||
*/
|
||||
ConfigRef<String> string(String key);
|
||||
|
||||
/**
|
||||
* 获取 string 配置
|
||||
*
|
||||
* @param key key
|
||||
* @param defaultValue defaultValue
|
||||
* @return ref
|
||||
*/
|
||||
ConfigRef<String> string(String key, String defaultValue);
|
||||
|
||||
/**
|
||||
* 获取 int 配置
|
||||
*
|
||||
* @param key key
|
||||
* @return ref
|
||||
*/
|
||||
ConfigRef<Integer> int32(String key);
|
||||
|
||||
/**
|
||||
* 获取 int 配置
|
||||
*
|
||||
* @param key key
|
||||
* @param defaultValue defaultValue
|
||||
* @return ref
|
||||
*/
|
||||
ConfigRef<Integer> int32(String key, Integer defaultValue);
|
||||
|
||||
/**
|
||||
* 获取 long 配置
|
||||
*
|
||||
* @param key key
|
||||
* @return ref
|
||||
*/
|
||||
ConfigRef<Long> int64(String key);
|
||||
|
||||
/**
|
||||
* 获取 long 配置
|
||||
*
|
||||
* @param key key
|
||||
* @param defaultValue defaultValue
|
||||
* @return ref
|
||||
*/
|
||||
ConfigRef<Long> int64(String key, Long defaultValue);
|
||||
|
||||
/**
|
||||
* 获取 double 配置
|
||||
*
|
||||
* @param key key
|
||||
* @return ref
|
||||
*/
|
||||
ConfigRef<Double> float64(String key);
|
||||
|
||||
/**
|
||||
* 获取 double 配置
|
||||
*
|
||||
* @param key key
|
||||
* @param defaultValue defaultValue
|
||||
* @return ref
|
||||
*/
|
||||
ConfigRef<Double> float64(String key, Double defaultValue);
|
||||
|
||||
/**
|
||||
* 获取 boolean 配置
|
||||
*
|
||||
* @param key key
|
||||
* @return ref
|
||||
*/
|
||||
ConfigRef<Boolean> bool(String key);
|
||||
|
||||
/**
|
||||
* 获取 boolean 配置
|
||||
*
|
||||
* @param key key
|
||||
* @param defaultValue defaultValue
|
||||
* @return ref
|
||||
*/
|
||||
ConfigRef<Boolean> bool(String key, Boolean defaultValue);
|
||||
|
||||
/**
|
||||
* 获取配置
|
||||
*
|
||||
* @param key key
|
||||
* @param convert convert
|
||||
* @param <T> T
|
||||
* @return ref
|
||||
*/
|
||||
<T> ConfigRef<T> ref(String key, Function<String, T> convert);
|
||||
|
||||
/**
|
||||
* 获取配置
|
||||
*
|
||||
* @param key key
|
||||
* @param convert convert
|
||||
* @param defaultValue defaultValue
|
||||
* @param <T> T
|
||||
* @return ref
|
||||
*/
|
||||
<T> ConfigRef<T> ref(String key, Function<String, T> convert, T defaultValue);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* 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.common.configuration;
|
||||
|
||||
import cn.orionsec.kit.spring.SpringHolder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* spring 配置类
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/6/20 10:34
|
||||
*/
|
||||
@Configuration
|
||||
public class SpringConfiguration {
|
||||
|
||||
/**
|
||||
* @return spring 容器工具类
|
||||
*/
|
||||
@Bean
|
||||
public SpringHolder.ApplicationContextAwareStore springHolderAware() {
|
||||
return new SpringHolder.ApplicationContextAwareStore();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,9 +20,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.constant;
|
||||
package org.dromara.visor.common.constant;
|
||||
|
||||
import com.orion.lang.constant.OrionConst;
|
||||
import cn.orionsec.kit.lang.constant.OrionConst;
|
||||
|
||||
/**
|
||||
* 项目常量
|
||||
@@ -29,7 +36,7 @@ public interface AppConst extends OrionConst {
|
||||
/**
|
||||
* 同 ${orion.version} 迭代时候需要手动更改
|
||||
*/
|
||||
String VERSION = "2.1.8";
|
||||
String VERSION = "2.3.8";
|
||||
|
||||
/**
|
||||
* 同 ${spring.application.name}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.constant;
|
||||
package org.dromara.visor.common.constant;
|
||||
|
||||
/**
|
||||
* 自动装配排序常量
|
||||
@@ -26,14 +33,10 @@ package com.orion.visor.framework.common.constant;
|
||||
*/
|
||||
public interface AutoConfigureOrderConst {
|
||||
|
||||
int FRAMEWORK_COMMON = Integer.MIN_VALUE + 1000;
|
||||
|
||||
int FRAMEWORK_WEB = Integer.MIN_VALUE + 1100;
|
||||
|
||||
int FRAMEWORK_SECURITY = Integer.MIN_VALUE + 1200;
|
||||
|
||||
int FRAMEWORK_SECURITY_CRYPTO = Integer.MIN_VALUE + 1250;
|
||||
|
||||
int FRAMEWORK_WEBSOCKET = Integer.MIN_VALUE + 1300;
|
||||
|
||||
int FRAMEWORK_DESENSITIZE = Integer.MIN_VALUE + 1400;
|
||||
@@ -48,17 +51,23 @@ public interface AutoConfigureOrderConst {
|
||||
|
||||
int FRAMEWORK_REDIS = Integer.MIN_VALUE + 1900;
|
||||
|
||||
int FRAMEWORK_REDIS_CACHE = Integer.MIN_VALUE + 1950;
|
||||
int FRAMEWORK_REDIS_CACHE = Integer.MIN_VALUE + 2000;
|
||||
|
||||
int FRAMEWORK_STORAGE = Integer.MIN_VALUE + 2000;
|
||||
int FRAMEWORK_CONFIG = Integer.MIN_VALUE + 2100;
|
||||
|
||||
int FRAMEWORK_JOB = Integer.MIN_VALUE + 2100;
|
||||
int FRAMEWORK_ENCRYPT = Integer.MIN_VALUE + 2200;
|
||||
|
||||
int FRAMEWORK_JOB_QUARTZ = Integer.MIN_VALUE + 2150;
|
||||
int FRAMEWORK_STORAGE = Integer.MIN_VALUE + 2300;
|
||||
|
||||
int FRAMEWORK_MONITOR = Integer.MIN_VALUE + 2200;
|
||||
int FRAMEWORK_JOB = Integer.MIN_VALUE + 2400;
|
||||
|
||||
int FRAMEWORK_BIZ_OPERATOR_LOG = Integer.MIN_VALUE + 3000;
|
||||
int FRAMEWORK_JOB_QUARTZ = Integer.MIN_VALUE + 2500;
|
||||
|
||||
int FRAMEWORK_JOB_ASYNC = Integer.MIN_VALUE + 2600;
|
||||
|
||||
int FRAMEWORK_MONITOR = Integer.MIN_VALUE + 2700;
|
||||
|
||||
int FRAMEWORK_BIZ_OPERATOR_LOG = Integer.MIN_VALUE + 2800;
|
||||
|
||||
int FRAMEWORK_BANNER = Integer.MIN_VALUE + 10000;
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.constant;
|
||||
package org.dromara.visor.common.constant;
|
||||
|
||||
/**
|
||||
* bean 排序常量
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.constant;
|
||||
package org.dromara.visor.common.constant;
|
||||
|
||||
/**
|
||||
* 常量 - 中文
|
||||
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* 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.common.constant;
|
||||
|
||||
/**
|
||||
* 配置项常量
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2025/1/14 16:15
|
||||
*/
|
||||
public interface ConfigKeys {
|
||||
|
||||
/**
|
||||
* SFTP 文件预览大小
|
||||
*/
|
||||
String SFTP_PREVIEW_SIZE = "sftp_previewSize";
|
||||
|
||||
/**
|
||||
* SFTP 重复文件备份
|
||||
*/
|
||||
String SFTP_UPLOAD_PRESENT_BACKUP = "sftp_uploadPresentBackup";
|
||||
|
||||
/**
|
||||
* SFTP 备份文件名称
|
||||
*/
|
||||
String SFTP_UPLOAD_BACKUP_FILE_NAME = "sftp_uploadBackupFileName";
|
||||
|
||||
/**
|
||||
* 加密公钥
|
||||
*/
|
||||
String ENCRYPT_PUBLIC_KEY = "encrypt_publicKey";
|
||||
|
||||
/**
|
||||
* 加密私钥
|
||||
*/
|
||||
String ENCRYPT_PRIVATE_KEY = "encrypt_privateKey";
|
||||
|
||||
/**
|
||||
* 日志前端显示行数
|
||||
*/
|
||||
String LOG_WEB_SCROLL_LINES = "log_webScrollLines";
|
||||
|
||||
/**
|
||||
* 日志加载偏移行
|
||||
*/
|
||||
String LOG_TRACKER_LOAD_LINES = "log_trackerLoadLines";
|
||||
|
||||
/**
|
||||
* 日志加载间隔毫秒
|
||||
*/
|
||||
String LOG_TRACKER_LOAD_INTERVAL = "log_trackerLoadInterval";
|
||||
|
||||
/**
|
||||
* 是否生成详细的执行日志
|
||||
*/
|
||||
String LOG_EXEC_DETAIL_LOG = "log_execDetailLog";
|
||||
|
||||
/**
|
||||
* 凭证有效期分
|
||||
*/
|
||||
String LOGIN_LOGIN_SESSION_TIME = "login_loginSessionTime";
|
||||
|
||||
/**
|
||||
* 允许多端登录
|
||||
*/
|
||||
String LOGIN_ALLOW_MULTI_DEVICE = "login_allowMultiDevice";
|
||||
|
||||
/**
|
||||
* 允许凭证续签
|
||||
*/
|
||||
String LOGIN_ALLOW_REFRESH = "login_allowRefresh";
|
||||
|
||||
/**
|
||||
* 凭证续签最大次数
|
||||
*/
|
||||
String LOGIN_MAX_REFRESH_COUNT = "login_maxRefreshCount";
|
||||
|
||||
/**
|
||||
* 凭证续签间隔分
|
||||
*/
|
||||
String LOGIN_REFRESH_INTERVAL = "login_refreshInterval";
|
||||
|
||||
/**
|
||||
* 登录失败锁定
|
||||
*/
|
||||
String LOGIN_LOGIN_FAILED_LOCK = "login_loginFailedLock";
|
||||
|
||||
/**
|
||||
* 登录失败锁定阈值分
|
||||
*/
|
||||
String LOGIN_LOGIN_FAILED_LOCK_THRESHOLD = "login_loginFailedLockThreshold";
|
||||
|
||||
/**
|
||||
* 登录失败锁定时间分
|
||||
*/
|
||||
String LOGIN_LOGIN_FAILED_LOCK_TIME = "login_loginFailedLockTime";
|
||||
|
||||
/**
|
||||
* 登录失败发信
|
||||
*/
|
||||
String LOGIN_LOGIN_FAILED_SEND = "login_loginFailedSend";
|
||||
|
||||
/**
|
||||
* 登录失败发信阈值
|
||||
*/
|
||||
String LOGIN_LOGIN_FAILED_SEND_THRESHOLD = "login_loginFailedSendThreshold";
|
||||
|
||||
/**
|
||||
* 是否开启自动清理命令记录
|
||||
*/
|
||||
String AUTO_CLEAR_EXEC_LOG_ENABLED = "autoClear_execLogEnabled";
|
||||
|
||||
/**
|
||||
* 自动清理命令记录保留天数
|
||||
*/
|
||||
String AUTO_CLEAR_EXEC_LOG_KEEP_DAYS = "autoClear_execLogKeepDays";
|
||||
|
||||
/**
|
||||
* 是否开启自动清理终端连接记录
|
||||
*/
|
||||
String AUTO_CLEAR_TERMINAL_LOG_ENABLED = "autoClear_terminalLogEnabled";
|
||||
|
||||
/**
|
||||
* 自动清理终端连接记录保留天数
|
||||
*/
|
||||
String AUTO_CLEAR_TERMINAL_LOG_KEEP_DAYS = "autoClear_terminalLogKeepDays";
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.constant;
|
||||
package org.dromara.visor.common.constant;
|
||||
|
||||
/**
|
||||
* 常量
|
||||
@@ -22,7 +29,7 @@ package com.orion.visor.framework.common.constant;
|
||||
* @version 1.0.0
|
||||
* @since 2023/6/23 18:49
|
||||
*/
|
||||
public interface Const extends com.orion.lang.constant.Const, FieldConst, CnConst {
|
||||
public interface Const extends cn.orionsec.kit.lang.constant.Const, FieldConst, CnConst {
|
||||
|
||||
Integer NOT_DELETE = 0;
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,12 +20,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.constant;
|
||||
package org.dromara.visor.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;
|
||||
|
||||
/**
|
||||
* 用于定义错误码
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,10 +20,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.constant;
|
||||
package org.dromara.visor.common.constant;
|
||||
|
||||
import com.orion.lang.exception.ApplicationException;
|
||||
import com.orion.lang.exception.argument.InvalidArgumentException;
|
||||
import cn.orionsec.kit.lang.exception.ApplicationException;
|
||||
import cn.orionsec.kit.lang.exception.argument.InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
@@ -83,10 +90,14 @@ public interface ErrorMessage {
|
||||
|
||||
String HOST_NOT_ENABLED = "主机未启用";
|
||||
|
||||
String CONFIG_NOT_ENABLED = "配置未启用";
|
||||
|
||||
String UNABLE_OPERATE_ADMIN_ROLE = "无法操作管理员账号";
|
||||
|
||||
String UNSUPPORTED_CHARSET = "不支持的编码 [{}]";
|
||||
|
||||
String DECRYPT_ERROR = "数据解密失败";
|
||||
|
||||
String PASSWORD_MISSING = "请输入密码";
|
||||
|
||||
String BEFORE_PASSWORD_ERROR = "原密码错误";
|
||||
@@ -119,6 +130,8 @@ public interface ErrorMessage {
|
||||
|
||||
String AUTH_ERROR = "认证失败";
|
||||
|
||||
String FILE_UPLOAD_ERROR = "文件上传失败";
|
||||
|
||||
String SCRIPT_UPLOAD_ERROR = "脚本上传失败";
|
||||
|
||||
String EXEC_ERROR = "执行失败";
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.constant;
|
||||
package org.dromara.visor.common.constant;
|
||||
|
||||
/**
|
||||
* 额外字段常量
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.constant;
|
||||
package org.dromara.visor.common.constant;
|
||||
|
||||
/**
|
||||
* 字段常量
|
||||
@@ -98,4 +105,6 @@ public interface FieldConst {
|
||||
|
||||
String ALL = "all";
|
||||
|
||||
String CONFIG = "config";
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.constant;
|
||||
package org.dromara.visor.common.constant;
|
||||
|
||||
/**
|
||||
* 文件常量
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.constant;
|
||||
package org.dromara.visor.common.constant;
|
||||
|
||||
/**
|
||||
* 过滤器排序常量
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.constant;
|
||||
package org.dromara.visor.common.constant;
|
||||
|
||||
/**
|
||||
* 验证常量
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,8 +20,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.entity;
|
||||
package org.dromara.visor.common.entity;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -25,16 +33,13 @@ import lombok.Data;
|
||||
* @since 2024/6/24 15:03
|
||||
*/
|
||||
@Data
|
||||
@Schema(name = "AutoClearConfig", description = "自动清理配置")
|
||||
public class AutoClearConfig {
|
||||
|
||||
/**
|
||||
* 是否开启
|
||||
*/
|
||||
@Schema(description = "是否开启")
|
||||
private Boolean enabled;
|
||||
|
||||
/**
|
||||
* 保留周期 (天)
|
||||
*/
|
||||
@Schema(description = "保留周期 (天)")
|
||||
private Integer keepPeriod;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,26 +20,26 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.entity;
|
||||
package org.dromara.visor.common.entity;
|
||||
|
||||
import com.orion.visor.framework.common.validator.group.Page;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.dromara.visor.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 {
|
||||
@Schema(name = "BaseQueryRequest", description = "基本查询请求")
|
||||
public class BaseQueryRequest implements IPageRequest, IOrderRequest {
|
||||
|
||||
@NotNull(groups = Page.class)
|
||||
@Min(value = 1, groups = Page.class)
|
||||
@@ -46,4 +53,7 @@ public class PageRequest {
|
||||
@Schema(description = "大小")
|
||||
private Integer limit;
|
||||
|
||||
@Schema(description = "查询排序")
|
||||
private Integer order;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.entity;
|
||||
package org.dromara.visor.common.entity;
|
||||
|
||||
/**
|
||||
* 数据清理请求 定义
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* 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.common.entity;
|
||||
|
||||
/**
|
||||
* 查询排序请求
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2025/3/17 22:04
|
||||
*/
|
||||
public interface IOrderRequest {
|
||||
|
||||
/**
|
||||
* 查询排序
|
||||
*
|
||||
* @return sort 0DESC 1ASC 其他不排序
|
||||
*/
|
||||
Integer getOrder();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* 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.common.entity;
|
||||
|
||||
/**
|
||||
* 页码请求
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2025/3/17 22:02
|
||||
*/
|
||||
public interface IPageRequest {
|
||||
|
||||
/**
|
||||
* 页码
|
||||
*
|
||||
* @return page
|
||||
*/
|
||||
Integer getPage();
|
||||
|
||||
/**
|
||||
* 大小
|
||||
*
|
||||
* @return limit
|
||||
*/
|
||||
Integer getLimit();
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.entity;
|
||||
package org.dromara.visor.common.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,8 +20,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.entity;
|
||||
package org.dromara.visor.common.entity;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -25,21 +33,16 @@ import lombok.Data;
|
||||
* @since 2023/12/29 11:57
|
||||
*/
|
||||
@Data
|
||||
@Schema(name = "RequestIdentityModel", description = "请求留痕模型")
|
||||
public class RequestIdentityModel implements RequestIdentity {
|
||||
|
||||
/**
|
||||
* 请求地址
|
||||
*/
|
||||
@Schema(description = "请求地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 请求位置
|
||||
*/
|
||||
@Schema(description = "请求位置")
|
||||
private String location;
|
||||
|
||||
/**
|
||||
* userAgent
|
||||
*/
|
||||
@Schema(description = "userAgent")
|
||||
private String userAgent;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* 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.common.entity;
|
||||
|
||||
import cn.orionsec.kit.lang.utils.collect.Lists;
|
||||
import cn.orionsec.kit.lang.utils.time.DateStream;
|
||||
import cn.orionsec.kit.lang.utils.time.Dates;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 统计区间枚举
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/12/23 14:02
|
||||
*/
|
||||
public enum StatisticsRange {
|
||||
|
||||
/**
|
||||
* 当天
|
||||
*/
|
||||
TODAY {
|
||||
@Override
|
||||
public Date getRangeEndTime(Date startTime) {
|
||||
return DateStream.of(startTime)
|
||||
.dayEnd()
|
||||
.date();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDateRanges(Date startTime) {
|
||||
return Lists.singleton(Dates.format(startTime, Dates.YMD));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 日视图
|
||||
*/
|
||||
DAY {
|
||||
@Override
|
||||
public Date getRangeEndTime(Date startTime) {
|
||||
return DateStream.of(startTime)
|
||||
.dayEnd()
|
||||
.date();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDateRanges(Date startTime) {
|
||||
return Lists.singleton(Dates.format(startTime, Dates.YMD));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 周视图
|
||||
*/
|
||||
WEEK {
|
||||
@Override
|
||||
public Date getRangeEndTime(Date startTime) {
|
||||
return DateStream.of(startTime)
|
||||
.addDay(7)
|
||||
.dayEnd()
|
||||
.date();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDateRanges(Date startTime) {
|
||||
return Arrays.stream(Dates.getIncrementDayDates(startTime, 1, 7))
|
||||
.map(s -> Dates.format(s, Dates.YMD))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 月视图
|
||||
*/
|
||||
MONTH {
|
||||
@Override
|
||||
public Date getRangeEndTime(Date startTime) {
|
||||
return DateStream.of(startTime)
|
||||
.addMonth(1)
|
||||
.dayEnd()
|
||||
.date();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDateRanges(Date startTime) {
|
||||
int monthLastDay = Dates.getMonthLastDay(startTime);
|
||||
return Arrays.stream(Dates.getIncrementDayDates(startTime, 1, monthLastDay - 1))
|
||||
.map(s -> Dates.format(s, Dates.YMD))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
},
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* 获取区间结束时间
|
||||
*
|
||||
* @param startTime startTime
|
||||
* @return end
|
||||
*/
|
||||
public abstract Date getRangeEndTime(Date startTime);
|
||||
|
||||
/**
|
||||
* 获取时间区间
|
||||
*
|
||||
* @param startTime startTime
|
||||
* @return ranges
|
||||
*/
|
||||
public abstract List<String> getDateRanges(Date startTime);
|
||||
|
||||
public static StatisticsRange of(String type) {
|
||||
if (type == null) {
|
||||
return TODAY;
|
||||
}
|
||||
for (StatisticsRange value : values()) {
|
||||
if (value.name().equals(type)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return TODAY;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.entity;
|
||||
package org.dromara.visor.common.entity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* 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.common.entity.chart;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 柱状图图单系列数据
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/12/23 13:42
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(name = "BarSingleChartData", description = "柱状图图单系列数据")
|
||||
public class BarSingleChartData {
|
||||
|
||||
@Schema(description = "数据")
|
||||
private Map<String, Integer> data;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.module.asset.entity.request.exec;
|
||||
package org.dromara.visor.common.entity.chart;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -21,31 +28,27 @@ import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 执行日志查看 请求对象
|
||||
* 折线图多系列数据
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/3/11 11:46
|
||||
* @since 2024/12/23 13:41
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(name = "ExecLogTailRequest", description = "执行日志查看 请求对象")
|
||||
public class ExecLogTailRequest {
|
||||
@Schema(name = "LineChartData", description = "折线图多系列数据")
|
||||
public class LineChartData {
|
||||
|
||||
@Schema(description = "执行来源")
|
||||
private String source;
|
||||
@Schema(description = "x轴")
|
||||
private List<String> x;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "执行id")
|
||||
private Long execId;
|
||||
|
||||
@Schema(description = "执行主机id")
|
||||
private List<Long> hostExecIdList;
|
||||
@Schema(description = "数据")
|
||||
private Map<String, List<Integer>> data;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* 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.common.entity.chart;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 折线图单系列数据
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/12/23 13:42
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(name = "LineSingleChartData", description = "折线图单系列数据")
|
||||
public class LineSingleChartData {
|
||||
|
||||
@Schema(description = "x轴")
|
||||
private List<String> x;
|
||||
|
||||
@Schema(description = "数据")
|
||||
private List<Integer> data;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.module.asset.entity.vo;
|
||||
package org.dromara.visor.common.entity.chart;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -24,26 +31,20 @@ import lombok.NoArgsConstructor;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 主机配置 视图响应对象
|
||||
* 饼图数据
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/9/11 17:58
|
||||
* @since 2024/12/23 13:42
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(name = "HostConfigVO", description = "主机配置 视图响应对象")
|
||||
public class HostConfigVO {
|
||||
@Schema(name = "PieChartData", description = "饼图数据")
|
||||
public class PieChartData {
|
||||
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "type")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "config")
|
||||
private Map<String, Object> config;
|
||||
@Schema(description = "数据")
|
||||
private Map<String, Integer> data;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.enums;
|
||||
package org.dromara.visor.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.enums;
|
||||
package org.dromara.visor.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,9 +20,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.enums;
|
||||
package org.dromara.visor.common.enums;
|
||||
|
||||
import com.orion.lang.utils.Strings;
|
||||
import cn.orionsec.kit.lang.utils.Strings;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.enums;
|
||||
package org.dromara.visor.common.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,11 +20,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.handler.data;
|
||||
package org.dromara.visor.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.common.handler.data.model.GenericsDataModel;
|
||||
import org.dromara.visor.common.handler.data.strategy.GenericsDataStrategy;
|
||||
|
||||
/**
|
||||
* 标准数据定义
|
||||
@@ -27,7 +34,7 @@ import com.orion.visor.framework.common.handler.data.strategy.GenericsDataStrate
|
||||
* @since 2023/12/21 0:07
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public interface GenericsDataDefinition {
|
||||
public interface GenericsStrategyDefinition {
|
||||
|
||||
/**
|
||||
* 获取数据处理策略
|
||||
@@ -47,12 +54,32 @@ public interface GenericsDataDefinition {
|
||||
return (S) SpringHolder.getBean(this.getStrategyClass());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取默认值
|
||||
*
|
||||
* @param <M> model
|
||||
* @return model
|
||||
*/
|
||||
default <M extends GenericsDataModel> M getDefault() {
|
||||
return (M) this.getStrategy().getDefault();
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行完整验证链
|
||||
*
|
||||
* @param beforeModel beforeModel
|
||||
* @param afterModel afterModel
|
||||
*/
|
||||
default void doValid(GenericsDataModel beforeModel, GenericsDataModel afterModel) {
|
||||
this.getStrategy().doValid(beforeModel, afterModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 反序列化对象
|
||||
*
|
||||
* @param serialModel serialModel
|
||||
* @param <M> Model
|
||||
* @return object
|
||||
* @param <M> model
|
||||
* @return model
|
||||
*/
|
||||
default <M extends GenericsDataModel> M parse(String serialModel) {
|
||||
return (M) this.getStrategy().parse(serialModel);
|
||||
@@ -62,14 +89,11 @@ public interface GenericsDataDefinition {
|
||||
* 转为视图对象
|
||||
*
|
||||
* @param serialModel serialModel
|
||||
* @param <M> Model
|
||||
* @param <M> model
|
||||
* @return viewModel
|
||||
*/
|
||||
default <M extends GenericsDataModel> M toView(String serialModel) {
|
||||
GenericsDataStrategy<GenericsDataModel> strategy = this.getStrategy();
|
||||
GenericsDataModel model = strategy.parse(serialModel);
|
||||
strategy.toView(model);
|
||||
return (M) model;
|
||||
return (M) this.getStrategy().toView(serialModel);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.handler.data.model;
|
||||
package org.dromara.visor.common.handler.data.model;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,10 +20,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.handler.data.strategy;
|
||||
package org.dromara.visor.common.handler.data.strategy;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.orion.visor.framework.common.handler.data.model.GenericsDataModel;
|
||||
import org.dromara.visor.common.handler.data.model.GenericsDataModel;
|
||||
|
||||
/**
|
||||
* 标准数据处理策略 基类
|
||||
@@ -77,4 +84,13 @@ public abstract class AbstractGenericsDataStrategy<M extends GenericsDataModel>
|
||||
public void toView(M model) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public M toView(String serialModel) {
|
||||
// 解析
|
||||
M parse = this.parse(serialModel);
|
||||
// 转为视图对象
|
||||
this.toView(parse);
|
||||
return parse;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,9 +20,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.handler.data.strategy;
|
||||
package org.dromara.visor.common.handler.data.strategy;
|
||||
|
||||
import com.orion.visor.framework.common.handler.data.model.GenericsDataModel;
|
||||
import org.dromara.visor.common.handler.data.model.GenericsDataModel;
|
||||
|
||||
/**
|
||||
* 标准数据处理策略
|
||||
@@ -58,4 +65,12 @@ public interface GenericsDataStrategy<M extends GenericsDataModel> {
|
||||
*/
|
||||
void toView(M model);
|
||||
|
||||
/**
|
||||
* 转为视图配置
|
||||
*
|
||||
* @param serialModel serialModel
|
||||
* @return model
|
||||
*/
|
||||
M toView(String serialModel);
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,24 +20,19 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.crypto;
|
||||
package org.dromara.visor.common.interfaces;
|
||||
|
||||
import com.orion.lang.utils.codec.Base62s;
|
||||
import com.orion.lang.utils.crypto.symmetric.SymmetricCrypto;
|
||||
import cn.orionsec.kit.lang.utils.codec.Base62s;
|
||||
import cn.orionsec.kit.lang.utils.crypto.symmetric.SymmetricCrypto;
|
||||
|
||||
/**
|
||||
* 数据加密器
|
||||
* aes 加密器
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/7/8 0:20
|
||||
*/
|
||||
public interface ValueCrypto extends SymmetricCrypto {
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
void init();
|
||||
public interface AesEncryptor extends SymmetricCrypto {
|
||||
|
||||
/**
|
||||
* 加密后 base62 编码
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.file;
|
||||
package org.dromara.visor.common.interfaces;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
@@ -107,6 +114,25 @@ public interface FileClient {
|
||||
*/
|
||||
byte[] getContent(String path) throws Exception;
|
||||
|
||||
/**
|
||||
* 获取文件内容
|
||||
*
|
||||
* @param path path
|
||||
* @return content
|
||||
* @throws Exception Exception
|
||||
*/
|
||||
String getContentAsString(String path) throws Exception;
|
||||
|
||||
/**
|
||||
* 获取文件内容
|
||||
*
|
||||
* @param path path
|
||||
* @param charset charset
|
||||
* @return content
|
||||
* @throws Exception Exception
|
||||
*/
|
||||
String getContentAsString(String path, String charset) throws Exception;
|
||||
|
||||
/**
|
||||
* 获取文件输入流
|
||||
*
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.lock;
|
||||
package org.dromara.visor.common.interfaces;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* 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.common.interfaces;
|
||||
|
||||
/**
|
||||
* rsa 解密器
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2025/1/5 20:58
|
||||
*/
|
||||
public interface RsaDecryptor {
|
||||
|
||||
/**
|
||||
* 解密
|
||||
*
|
||||
* @param value value
|
||||
* @return value
|
||||
*/
|
||||
String decrypt(String value);
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,12 +20,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.json.filter;
|
||||
package org.dromara.visor.common.json;
|
||||
|
||||
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;
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,10 +20,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.json.filter;
|
||||
package org.dromara.visor.common.json;
|
||||
|
||||
import cn.orionsec.kit.lang.utils.collect.Lists;
|
||||
import com.alibaba.fastjson.serializer.PropertyFilter;
|
||||
import com.orion.lang.utils.collect.Lists;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* 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.common.mapstruct;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* json 转换器
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2025/3/7 17:43
|
||||
*/
|
||||
public class JsonConversion {
|
||||
|
||||
private JsonConversion() {
|
||||
}
|
||||
|
||||
/**
|
||||
* JSONString > JSONObject
|
||||
*
|
||||
* @param json json
|
||||
* @return JSONObject
|
||||
*/
|
||||
public static JSONObject stringToJsonObject(String json) {
|
||||
return json != null ? JSON.parseObject(json) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* JSONString > JSONArray.
|
||||
*
|
||||
* @param json json
|
||||
* @return JSONArray
|
||||
*/
|
||||
public static JSONArray stringToJsonArray(String json) {
|
||||
return json != null ? JSON.parseArray(json) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* JSONObject > JSONString.
|
||||
*
|
||||
* @param jsonObject JSONObject
|
||||
* @return JSONString
|
||||
*/
|
||||
public static String jsonObjectToString(JSONObject jsonObject) {
|
||||
return jsonObject != null ? jsonObject.toJSONString() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* JSONArray > JSONString.
|
||||
*
|
||||
* @param jsonArray JSONArray
|
||||
* @return JSONString
|
||||
*/
|
||||
public static String jsonArrayToString(JSONArray jsonArray) {
|
||||
return jsonArray != null ? jsonArray.toJSONString() : null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* 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.common.mapstruct;
|
||||
|
||||
import cn.orionsec.kit.lang.utils.Strings;
|
||||
import cn.orionsec.kit.lang.utils.collect.Lists;
|
||||
import org.dromara.visor.common.constant.Const;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* string 转换器
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2025/3/7 17:35
|
||||
*/
|
||||
public class StringConversion {
|
||||
|
||||
private StringConversion() {
|
||||
}
|
||||
|
||||
/**
|
||||
* String > List<Integer>
|
||||
*
|
||||
* @param str str
|
||||
* @return list
|
||||
*/
|
||||
public static List<Integer> stringToIntegerList(String str) {
|
||||
if (Strings.isBlank(str)) {
|
||||
return Lists.newList();
|
||||
}
|
||||
return Arrays.stream(str.split(Const.COMMA))
|
||||
.map(Integer::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* String > List<String>
|
||||
*
|
||||
* @param str str
|
||||
* @return list
|
||||
*/
|
||||
public static List<Long> stringToLongList(String str) {
|
||||
if (Strings.isBlank(str)) {
|
||||
return Lists.newList();
|
||||
}
|
||||
return Arrays.stream(str.split(Const.COMMA))
|
||||
.map(Long::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* String > List<String>
|
||||
*
|
||||
* @param str str
|
||||
* @return list
|
||||
*/
|
||||
public static List<String> stringToStringList(String str) {
|
||||
if (Strings.isBlank(str)) {
|
||||
return Lists.newList();
|
||||
}
|
||||
return Lists.of(str.split(Const.COMMA));
|
||||
}
|
||||
|
||||
/**
|
||||
* List<Integer> String
|
||||
*
|
||||
* @param list list
|
||||
* @return str
|
||||
*/
|
||||
public static String integerListToString(List<Integer> list) {
|
||||
if (list != null) {
|
||||
return list.stream()
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.joining(Const.COMMA));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* List<Long> String
|
||||
*
|
||||
* @param list list
|
||||
* @return str
|
||||
*/
|
||||
public static String longListToString(List<Long> list) {
|
||||
if (list != null) {
|
||||
return list.stream()
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.joining(Const.COMMA));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* List<String> String
|
||||
*
|
||||
* @param list list
|
||||
* @return str
|
||||
*/
|
||||
public static String stringListToString(List<String> list) {
|
||||
return list != null ? String.join(Const.COMMA, list) : null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.security;
|
||||
package org.dromara.visor.common.security;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,12 +20,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.security;
|
||||
package org.dromara.visor.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;
|
||||
import cn.orionsec.kit.lang.utils.Booleans;
|
||||
import cn.orionsec.kit.lang.utils.Strings;
|
||||
import org.dromara.visor.common.constant.Const;
|
||||
import org.dromara.visor.common.utils.AesEncryptUtils;
|
||||
|
||||
/**
|
||||
* 密码修改器
|
||||
@@ -45,7 +52,7 @@ public class PasswordModifier {
|
||||
if (Strings.isBlank(password)) {
|
||||
return Const.EMPTY;
|
||||
} else {
|
||||
return CryptoUtils.encryptAsString(password);
|
||||
return AesEncryptUtils.encryptAsString(password);
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.security;
|
||||
package org.dromara.visor.common.security;
|
||||
|
||||
/**
|
||||
* SecurityUtils 的 bean 对象
|
||||
@@ -38,4 +45,11 @@ public interface SecurityHolder {
|
||||
*/
|
||||
Long getLoginUserId();
|
||||
|
||||
/**
|
||||
* 获取当前用户名
|
||||
*
|
||||
* @return username
|
||||
*/
|
||||
String getLoginUsername();
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.security;
|
||||
package org.dromara.visor.common.security;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -40,4 +47,11 @@ public interface UpdatePasswordAction extends Serializable {
|
||||
*/
|
||||
String getPassword();
|
||||
|
||||
/**
|
||||
* 设置密码
|
||||
*
|
||||
* @param password password
|
||||
*/
|
||||
void setPassword(String password);
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.security;
|
||||
package org.dromara.visor.common.security;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,9 +20,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.thread;
|
||||
package org.dromara.visor.common.thread;
|
||||
|
||||
import com.orion.visor.framework.common.utils.ThreadMdcUtils;
|
||||
import org.dromara.visor.common.utils.ThreadMdcUtils;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,10 +20,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.meta;
|
||||
package org.dromara.visor.common.trace;
|
||||
|
||||
import cn.orionsec.kit.lang.id.UUIds;
|
||||
import com.alibaba.ttl.TransmittableThreadLocal;
|
||||
import com.orion.lang.id.UUIds;
|
||||
import org.slf4j.MDC;
|
||||
|
||||
/**
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,25 +20,23 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.utils;
|
||||
package org.dromara.visor.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.common.interfaces.AesEncryptor;
|
||||
|
||||
/**
|
||||
* 加密工具类
|
||||
* <p>
|
||||
* PrimaryValueCrypto 代理类工具
|
||||
* aes 数据加密工具类
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/7/8 0:05
|
||||
*/
|
||||
public class CryptoUtils {
|
||||
public class AesEncryptUtils {
|
||||
|
||||
private static ValueCrypto delegate;
|
||||
private static AesEncryptor delegate;
|
||||
|
||||
private CryptoUtils() {
|
||||
private AesEncryptUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -156,12 +161,12 @@ public class CryptoUtils {
|
||||
return delegate.decryptBase62(text);
|
||||
}
|
||||
|
||||
public static void setDelegate(ValueCrypto delegate) {
|
||||
if (CryptoUtils.delegate != null) {
|
||||
public static void setDelegate(AesEncryptor delegate) {
|
||||
if (AesEncryptUtils.delegate != null) {
|
||||
// unmodified
|
||||
throw Exceptions.state();
|
||||
}
|
||||
CryptoUtils.delegate = delegate;
|
||||
AesEncryptUtils.delegate = delegate;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,9 +20,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.utils;
|
||||
package org.dromara.visor.common.utils;
|
||||
|
||||
import com.orion.lang.constant.Const;
|
||||
import cn.orionsec.kit.lang.constant.Const;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,10 +20,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.utils;
|
||||
package org.dromara.visor.common.utils;
|
||||
|
||||
import com.orion.lang.utils.time.Dates;
|
||||
import com.orion.visor.framework.common.constant.Const;
|
||||
import cn.orionsec.kit.lang.utils.time.Dates;
|
||||
import org.dromara.visor.common.constant.Const;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,12 +20,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.utils;
|
||||
package org.dromara.visor.common.utils;
|
||||
|
||||
import com.orion.ext.location.Region;
|
||||
import com.orion.ext.location.region.LocationRegions;
|
||||
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.common.constant.Const;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,11 +20,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.utils;
|
||||
package org.dromara.visor.common.utils;
|
||||
|
||||
import com.orion.lang.utils.Exceptions;
|
||||
import com.orion.visor.framework.common.lock.Locker;
|
||||
import cn.orionsec.kit.lang.utils.Exceptions;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.visor.common.interfaces.Locker;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,13 +20,13 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.utils;
|
||||
package org.dromara.visor.common.utils;
|
||||
|
||||
import com.orion.lang.utils.Objects1;
|
||||
import com.orion.lang.utils.Systems;
|
||||
import com.orion.lang.utils.io.Files1;
|
||||
import com.orion.visor.framework.common.constant.AppConst;
|
||||
import com.orion.visor.framework.common.constant.Const;
|
||||
import cn.orionsec.kit.lang.utils.Objects1;
|
||||
import cn.orionsec.kit.lang.utils.Systems;
|
||||
import cn.orionsec.kit.lang.utils.io.Files1;
|
||||
import org.dromara.visor.common.constant.AppConst;
|
||||
import org.dromara.visor.common.constant.Const;
|
||||
|
||||
/**
|
||||
* 路径工具类
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,11 +20,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.utils;
|
||||
package org.dromara.visor.common.utils;
|
||||
|
||||
import com.orion.visor.framework.common.entity.RequestIdentity;
|
||||
import com.orion.visor.framework.common.entity.RequestIdentityModel;
|
||||
import com.orion.web.servlet.web.Servlets;
|
||||
import cn.orionsec.kit.web.servlet.web.Servlets;
|
||||
import org.dromara.visor.common.entity.RequestIdentity;
|
||||
import org.dromara.visor.common.entity.RequestIdentityModel;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* 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.common.utils;
|
||||
|
||||
import cn.orionsec.kit.lang.utils.Exceptions;
|
||||
import org.dromara.visor.common.interfaces.RsaDecryptor;
|
||||
|
||||
/**
|
||||
* rsa 参数解密工具类
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2025/1/5 21:13
|
||||
*/
|
||||
public class RsaParamDecryptUtils {
|
||||
|
||||
private static RsaDecryptor delegate;
|
||||
|
||||
private RsaParamDecryptUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 解密
|
||||
*
|
||||
* @param value value
|
||||
* @return value
|
||||
*/
|
||||
public static String decrypt(String value) {
|
||||
return delegate.decrypt(value);
|
||||
}
|
||||
|
||||
public static void setDelegate(RsaDecryptor delegate) {
|
||||
if (RsaParamDecryptUtils.delegate != null) {
|
||||
// unmodified
|
||||
throw Exceptions.state();
|
||||
}
|
||||
RsaParamDecryptUtils.delegate = delegate;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,9 +20,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.utils;
|
||||
package org.dromara.visor.common.utils;
|
||||
|
||||
import com.orion.visor.framework.common.constant.Const;
|
||||
import org.dromara.visor.common.constant.Const;
|
||||
|
||||
/**
|
||||
* sql 工具类
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,12 +20,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.utils;
|
||||
package org.dromara.visor.common.utils;
|
||||
|
||||
import com.orion.lang.utils.collect.Maps;
|
||||
import com.orion.lang.utils.reflect.Annotations;
|
||||
import com.orion.visor.framework.common.constant.Const;
|
||||
import cn.orionsec.kit.lang.utils.collect.Maps;
|
||||
import cn.orionsec.kit.lang.utils.reflect.Annotations;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.dromara.visor.common.constant.Const;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,9 +20,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.utils;
|
||||
package org.dromara.visor.common.utils;
|
||||
|
||||
import com.orion.visor.framework.common.meta.TraceIdHolder;
|
||||
import org.dromara.visor.common.trace.TraceIdHolder;
|
||||
import org.slf4j.MDC;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,11 +20,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.utils;
|
||||
package org.dromara.visor.common.utils;
|
||||
|
||||
import com.orion.lang.utils.collect.Lists;
|
||||
import com.orion.visor.framework.common.constant.Const;
|
||||
import com.orion.visor.framework.common.entity.TreeNode;
|
||||
import cn.orionsec.kit.lang.utils.collect.Lists;
|
||||
import org.dromara.visor.common.constant.Const;
|
||||
import org.dromara.visor.common.entity.TreeNode;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,12 +20,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.utils;
|
||||
package org.dromara.visor.common.utils;
|
||||
|
||||
import com.orion.lang.utils.Arrays1;
|
||||
import com.orion.lang.utils.io.Files1;
|
||||
import com.orion.spring.SpringHolder;
|
||||
import com.orion.visor.framework.common.constant.ErrorMessage;
|
||||
import cn.orionsec.kit.lang.utils.Arrays1;
|
||||
import cn.orionsec.kit.lang.utils.io.Files1;
|
||||
import cn.orionsec.kit.spring.SpringHolder;
|
||||
import org.dromara.visor.common.constant.ErrorMessage;
|
||||
|
||||
import javax.validation.ConstraintViolation;
|
||||
import javax.validation.ConstraintViolationException;
|
||||
@@ -35,9 +42,9 @@ import java.util.function.Function;
|
||||
* @version 1.0.0
|
||||
* @since 2023/7/18 11:23
|
||||
*/
|
||||
public class Valid extends com.orion.lang.utils.Valid {
|
||||
public class Valid extends cn.orionsec.kit.lang.utils.Valid {
|
||||
|
||||
private static final Validator VALIDATOR = SpringHolder.getBean(Validator.class);
|
||||
private static final Validator validator = SpringHolder.getBean(Validator.class);
|
||||
|
||||
public static <T> T notNull(T object) {
|
||||
return notNull(object, ErrorMessage.PARAM_MISSING);
|
||||
@@ -123,7 +130,7 @@ public class Valid extends com.orion.lang.utils.Valid {
|
||||
public static <T> T valid(T obj, Class<?>... groups) {
|
||||
notNull(obj, ErrorMessage.PARAM_MISSING);
|
||||
// 验证对象
|
||||
Set<ConstraintViolation<T>> set = VALIDATOR.validate(obj, groups);
|
||||
Set<ConstraintViolation<T>> set = validator.validate(obj, groups);
|
||||
if (!set.isEmpty()) {
|
||||
throw new ConstraintViolationException(set);
|
||||
}
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.validator.group;
|
||||
package org.dromara.visor.common.validator.group;
|
||||
|
||||
/**
|
||||
* 批量验证分组
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.validator.group;
|
||||
package org.dromara.visor.common.validator.group;
|
||||
|
||||
/**
|
||||
* 清理验证分组
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.validator.group;
|
||||
package org.dromara.visor.common.validator.group;
|
||||
|
||||
/**
|
||||
* 导出验证分组
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.validator.group;
|
||||
package org.dromara.visor.common.validator.group;
|
||||
|
||||
/**
|
||||
* 分页验证分组
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.validator.group;
|
||||
package org.dromara.visor.common.validator.group;
|
||||
|
||||
/**
|
||||
* 导出验证分组
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.validator.group;
|
||||
package org.dromara.visor.common.validator.group;
|
||||
|
||||
/**
|
||||
* 分页验证分组
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +20,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.common.web.filter;
|
||||
package org.dromara.visor.common.web;
|
||||
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
|
||||
@@ -26,9 +33,9 @@ import javax.servlet.Filter;
|
||||
* @version 1.0.0
|
||||
* @since 2023/6/25 15:05
|
||||
*/
|
||||
public class FilterCreator {
|
||||
public class WebFilterCreator {
|
||||
|
||||
private FilterCreator() {
|
||||
private WebFilterCreator() {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -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.1.8</revision>
|
||||
<revision>2.3.8</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.9</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,105 @@
|
||||
|
||||
<!-- 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>
|
||||
<artifactId>orion-visor-framework-common</artifactId>
|
||||
<groupId>org.dromara.visor</groupId>
|
||||
<artifactId>orion-visor-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-config</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<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-encrypt</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<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>
|
||||
|
||||
@@ -1,198 +0,0 @@
|
||||
/*
|
||||
* 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 com.orion.visor.framework.common.utils;
|
||||
|
||||
import com.orion.lang.utils.Exceptions;
|
||||
import com.orion.visor.framework.common.file.FileClient;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/**
|
||||
* 文件客户端工具
|
||||
* <p>
|
||||
* PrimaryFileClient 代理类工具
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/7/21 12:05
|
||||
*/
|
||||
public class FileClientUtils {
|
||||
|
||||
private static FileClient delegate;
|
||||
|
||||
private FileClientUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param path 文件路径
|
||||
* @param content 文件内容
|
||||
* @return 路径
|
||||
* @throws Exception Exception
|
||||
*/
|
||||
public static String upload(String path, byte[] content) throws Exception {
|
||||
return delegate.upload(path, content);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param path 文件路径
|
||||
* @param content 文件内容
|
||||
* @param overrideIfExist 文件存在是否覆盖
|
||||
* @return 路径
|
||||
* @throws Exception Exception
|
||||
*/
|
||||
public static String upload(String path, byte[] content, boolean overrideIfExist) throws Exception {
|
||||
return delegate.upload(path, content, overrideIfExist);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param path 文件路径
|
||||
* @param in in
|
||||
* @return 路径
|
||||
* @throws Exception Exception
|
||||
*/
|
||||
public static String upload(String path, InputStream in) throws Exception {
|
||||
return delegate.upload(path, in);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param path 文件路径
|
||||
* @param in in
|
||||
* @param autoClose autoClose
|
||||
* @return 路径
|
||||
* @throws Exception Exception
|
||||
*/
|
||||
public static String upload(String path, InputStream in, boolean autoClose) throws Exception {
|
||||
return delegate.upload(path, in, autoClose);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param path 文件路径
|
||||
* @param in in
|
||||
* @param autoClose autoClose
|
||||
* @param overrideIfExist 文件存在是否覆盖
|
||||
* @return 路径
|
||||
* @throws Exception Exception
|
||||
*/
|
||||
public static String upload(String path, InputStream in, boolean autoClose, boolean overrideIfExist) throws Exception {
|
||||
return delegate.upload(path, in, autoClose, overrideIfExist);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查文件是否存在
|
||||
*
|
||||
* @param path path
|
||||
* @return 是否存在
|
||||
*/
|
||||
public static boolean isExists(String path) {
|
||||
return delegate.isExists(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件
|
||||
*
|
||||
* @param path 路径
|
||||
* @return 是否删除
|
||||
* @throws Exception Exception
|
||||
*/
|
||||
public static boolean delete(String path) throws Exception {
|
||||
return delegate.delete(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件内容
|
||||
*
|
||||
* @param path path
|
||||
* @return bytes
|
||||
* @throws Exception Exception
|
||||
*/
|
||||
public static byte[] getContent(String path) throws Exception {
|
||||
return delegate.getContent(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件输入流
|
||||
*
|
||||
* @param path path
|
||||
* @return stream
|
||||
* @throws Exception Exception
|
||||
*/
|
||||
public static InputStream getContentInputStream(String path) throws Exception {
|
||||
return delegate.getContentInputStream(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件输出流
|
||||
*
|
||||
* @param path path
|
||||
* @return stream
|
||||
* @throws Exception Exception
|
||||
*/
|
||||
public static OutputStream getContentOutputStream(String path) throws Exception {
|
||||
return delegate.getContentOutputStream(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件输出流
|
||||
*
|
||||
* @param path path
|
||||
* @param append append
|
||||
* @return stream
|
||||
* @throws Exception Exception
|
||||
*/
|
||||
public static OutputStream getContentOutputStream(String path, boolean append) throws Exception {
|
||||
return delegate.getContentOutputStream(path, append);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取返回路径 用于客户端返回
|
||||
*
|
||||
* @param path path
|
||||
* @return returnPath
|
||||
*/
|
||||
public static String getReturnPath(String path) {
|
||||
return delegate.getReturnPath(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实际存储路径 用于服务端的存储
|
||||
*
|
||||
* @param returnPath returnPath
|
||||
* @return absolutePath
|
||||
*/
|
||||
public static String getAbsolutePath(String returnPath) {
|
||||
return delegate.getAbsolutePath(returnPath);
|
||||
}
|
||||
|
||||
public static void setDelegate(FileClient delegate) {
|
||||
if (FileClientUtils.delegate != null) {
|
||||
// unmodified
|
||||
throw Exceptions.state();
|
||||
}
|
||||
FileClientUtils.delegate = delegate;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
com.orion.visor.framework.common.configuration.OrionCommonAutoConfiguration
|
||||
@@ -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,8 +18,8 @@
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.orion.visor</groupId>
|
||||
<artifactId>orion-visor-framework-common</artifactId>
|
||||
<groupId>org.dromara.visor</groupId>
|
||||
<artifactId>orion-visor-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,10 +20,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.banner.configuration;
|
||||
package org.dromara.visor.framework.banner.configuration;
|
||||
|
||||
import com.orion.visor.framework.banner.core.runner.BannerApplicationRunner;
|
||||
import com.orion.visor.framework.common.constant.AutoConfigureOrderConst;
|
||||
import org.dromara.visor.common.constant.AutoConfigureOrderConst;
|
||||
import org.dromara.visor.framework.banner.core.runner.BannerApplicationRunner;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,11 +20,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.banner.core.runner;
|
||||
package org.dromara.visor.framework.banner.core.runner;
|
||||
|
||||
import com.orion.lang.utils.Threads;
|
||||
import com.orion.lang.utils.ansi.AnsiAppender;
|
||||
import com.orion.lang.utils.ansi.style.color.AnsiForeground;
|
||||
import cn.orionsec.kit.lang.utils.Threads;
|
||||
import cn.orionsec.kit.lang.utils.ansi.AnsiAppender;
|
||||
import cn.orionsec.kit.lang.utils.ansi.style.color.AnsiForeground;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
@@ -1 +1 @@
|
||||
com.orion.visor.framework.banner.configuration.OrionBannerAutoConfiguration
|
||||
org.dromara.visor.framework.banner.configuration.OrionBannerAutoConfiguration
|
||||
@@ -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,8 +18,8 @@
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.orion.visor</groupId>
|
||||
<artifactId>orion-visor-framework-common</artifactId>
|
||||
<groupId>org.dromara.visor</groupId>
|
||||
<artifactId>orion-visor-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - present Jiahang Li (visor.orionsec.cn ljh1553488six@139.com).
|
||||
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||
*
|
||||
* https://visor.dromara.org
|
||||
* https://visor.dromara.org.cn
|
||||
* https://visor.orionsec.cn
|
||||
*
|
||||
* Members:
|
||||
* Jiahang Li - ljh1553488six@139.com - author
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,19 +20,19 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.orion.visor.framework.biz.operator.log.configuration;
|
||||
package org.dromara.visor.framework.biz.operator.log.configuration;
|
||||
|
||||
import com.alibaba.fastjson.serializer.SerializeFilter;
|
||||
import com.alibaba.fastjson.serializer.ValueFilter;
|
||||
import com.orion.visor.framework.biz.operator.log.configuration.config.OperatorLogConfig;
|
||||
import com.orion.visor.framework.biz.operator.log.core.aspect.OperatorLogAspect;
|
||||
import com.orion.visor.framework.biz.operator.log.core.service.OperatorLogFrameworkService;
|
||||
import com.orion.visor.framework.biz.operator.log.core.service.OperatorLogFrameworkServiceDelegate;
|
||||
import com.orion.visor.framework.biz.operator.log.core.utils.OperatorLogFiller;
|
||||
import com.orion.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
||||
import com.orion.visor.framework.common.constant.AutoConfigureOrderConst;
|
||||
import com.orion.visor.framework.common.json.filter.FieldDesensitizeFilter;
|
||||
import com.orion.visor.framework.common.json.filter.FieldIgnoreFilter;
|
||||
import org.dromara.visor.common.constant.AutoConfigureOrderConst;
|
||||
import org.dromara.visor.common.json.FieldDesensitizeFilter;
|
||||
import org.dromara.visor.common.json.FieldIgnoreFilter;
|
||||
import org.dromara.visor.framework.biz.operator.log.configuration.config.OperatorLogConfig;
|
||||
import org.dromara.visor.framework.biz.operator.log.core.aspect.OperatorLogAspect;
|
||||
import org.dromara.visor.framework.biz.operator.log.core.service.OperatorLogFrameworkService;
|
||||
import org.dromara.visor.framework.biz.operator.log.core.service.OperatorLogFrameworkServiceDelegate;
|
||||
import org.dromara.visor.framework.biz.operator.log.core.utils.OperatorLogFiller;
|
||||
import org.dromara.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user