Compare commits
337 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
988528ccca | ||
|
|
029a46c07d | ||
|
|
8ace3ddd1f | ||
|
|
2c705f0b67 | ||
|
|
3ec43bd8a5 | ||
|
|
b33abd3196 | ||
|
|
d82f5b4bfb | ||
|
|
3e41e17367 | ||
|
|
6e3abab232 | ||
|
|
6306baa51a | ||
|
|
7ceb7e162a | ||
|
|
2243d3cf5b | ||
|
|
e6937d67c1 | ||
|
|
6e977dabf6 | ||
|
|
c229029c1d | ||
|
|
76aa64fe75 | ||
|
|
3b1d6ab8a4 | ||
|
|
7015468e04 | ||
|
|
ef57040e1d | ||
|
|
2a6537c604 | ||
|
|
541a9790ad | ||
|
|
011e8ad089 | ||
|
|
3918d36c24 | ||
|
|
37f452c7c3 | ||
|
|
fc885bc0ad | ||
|
|
44c226092d | ||
|
|
14cf8c2492 | ||
|
|
d6f5898e61 | ||
|
|
0ab8e405cc | ||
|
|
4e4231d5a5 | ||
|
|
2df3f2fa1a | ||
|
|
d6048f78f0 | ||
|
|
f73fa14bfd | ||
|
|
fd88c725d3 | ||
|
|
3a16f9d9ab | ||
|
|
de9b89d805 | ||
|
|
a05c387ba1 | ||
|
|
3cb6e5a2d4 | ||
|
|
104a9a0aa3 | ||
|
|
d7b747eac4 | ||
|
|
d2949c11f3 | ||
|
|
cd05f71173 | ||
|
|
e0dca73369 | ||
|
|
b8599a6693 | ||
|
|
a0adb415fa | ||
|
|
6c60756e54 | ||
|
|
ee9f51ce7d | ||
|
|
924b46b41a | ||
|
|
1fca5a1912 | ||
|
|
120eb1ee69 | ||
|
|
252c538571 | ||
|
|
1eec373b7e | ||
|
|
aa9b96a9c1 | ||
|
|
059fb30aa4 | ||
|
|
2afaf7ad34 | ||
|
|
076a0956c5 | ||
|
|
4a91ec47bf | ||
|
|
1066b43b3d | ||
|
|
3f78125c43 | ||
|
|
144a44673b | ||
|
|
777f7b3758 | ||
|
|
947fa0fea3 | ||
|
|
7109e89fb4 | ||
|
|
70e7b1d544 | ||
|
|
613f86155c | ||
|
|
8d0b58e48f | ||
|
|
8cea9dc977 | ||
|
|
471acfdf00 | ||
|
|
8ed42131d0 | ||
|
|
18c605354a | ||
|
|
8c04411458 | ||
|
|
9a8d1d05cd | ||
|
|
1cbaf9c424 | ||
|
|
537c2fc108 | ||
|
|
122b568cf5 | ||
|
|
8b97c02d15 | ||
|
|
dcfb016ce5 | ||
|
|
c842de9e23 | ||
|
|
1b2753a2b7 | ||
|
|
29b44b8b77 | ||
|
|
7290b1364c | ||
|
|
3851ead8bb | ||
|
|
305312cc26 | ||
|
|
b4217555d2 | ||
|
|
87b8e405f5 | ||
|
|
3513196a78 | ||
|
|
0240a12321 | ||
|
|
3a8eac4d4a | ||
|
|
4bd2de4ce2 | ||
|
|
b7608fccb3 | ||
|
|
bb925d354d | ||
|
|
3a476d41d2 | ||
|
|
1927b10bcc | ||
|
|
0664eff151 | ||
|
|
a71456b209 | ||
|
|
48d308b1a8 | ||
|
|
f75d097d8a | ||
|
|
0d46d81c4e | ||
|
|
c20c83245f | ||
|
|
849e010bc3 | ||
|
|
95c299eea4 | ||
|
|
ad3edd4ccd | ||
|
|
81b7b3505e | ||
|
|
1522a6f3ad | ||
|
|
04bae45955 | ||
|
|
873e910eb1 | ||
|
|
a7f86bf62a | ||
|
|
7ba278d210 | ||
|
|
e9ac9b9f13 | ||
|
|
d34843f90c | ||
|
|
374d0bdd9c | ||
|
|
5d3dc83bab | ||
|
|
05d0f75cdc | ||
|
|
711a4a6bab | ||
|
|
08895ba170 | ||
|
|
c2c8b108ac | ||
|
|
318e9f30b8 | ||
|
|
39a1001510 | ||
|
|
5e7b7ebfa7 | ||
|
|
8d85cdf173 | ||
|
|
79d95d1997 | ||
|
|
1eb07d0b24 | ||
|
|
601564b573 | ||
|
|
41384fab17 | ||
|
|
f0a122d862 | ||
|
|
b08d75be62 | ||
|
|
02f5bef6b4 | ||
|
|
ef10c8b8b6 | ||
|
|
6c4e9cd5c6 | ||
|
|
8dec40553d | ||
|
|
9ae5a6c627 | ||
|
|
2ec1678f01 | ||
|
|
f9e436e885 | ||
|
|
2a49e7670d | ||
|
|
95d8988f11 | ||
|
|
e04a972df5 | ||
|
|
1ca9311625 | ||
|
|
630a1fd3cd | ||
|
|
0f6d84dab2 | ||
|
|
f64eb395a8 | ||
|
|
2e69c67de0 | ||
|
|
7747b4e52e | ||
|
|
830622aafb | ||
|
|
2919950c5b | ||
|
|
d56cfbba82 | ||
|
|
cfe1924f11 | ||
|
|
dfd2ec45f4 | ||
|
|
19c7e31f53 | ||
|
|
f618aef988 | ||
|
|
af97f752f5 | ||
|
|
bfb80afee2 |
17
.env.example
Normal file
17
.env.example
Normal file
@@ -0,0 +1,17 @@
|
||||
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
|
||||
MYSQL_USER=orion
|
||||
MYSQL_PASSWORD=Data@123456
|
||||
MYSQL_ROOT_PASSWORD=Data@123456
|
||||
|
||||
REDIS_HOST=redis
|
||||
REDIS_PASSWORD=Data@123456
|
||||
|
||||
DEMO_MODE=false
|
||||
21
.github/workflows/e2e.yaml
vendored
Normal file
21
.github/workflows/e2e.yaml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: E2E
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
concurrency:
|
||||
group: ${{github.workflow}} - ${{github.ref}}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
testing:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: E2E Testing
|
||||
run: |
|
||||
sudo curl -L https://github.com/docker/compose/releases/download/v2.23.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
|
||||
sudo chmod u+x /usr/local/bin/docker-compose
|
||||
docker compose -f docker-compose-testing.yml up --build testing --exit-code-from testing --remove-orphans
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -33,3 +33,4 @@ build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
.env
|
||||
|
||||
87
LICENSE
87
LICENSE
@@ -200,90 +200,3 @@
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
Apache Dubbo Submodules:
|
||||
|
||||
Apache Dubbo includes a number of submodules with separate copyright notices
|
||||
and license terms. Your use of these submodules is subject to the terms and
|
||||
conditions of the following licenses.
|
||||
|
||||
For the package org.apache.dubbo.common.threadlocal and org.apache.dubbo.common.timer:
|
||||
|
||||
This product contains a modified portion of 'Netty', an event-driven asynchronous network application framework also
|
||||
under a "Apache License 2.0" license, see https://github.com/netty/netty/blob/4.1/LICENSE.txt:
|
||||
|
||||
* io.netty.util.concurrent.FastThreadLocal
|
||||
* io.netty.util.internal.InternalThreadLocalMap
|
||||
* io.netty.util.Timer
|
||||
* io.netty.util.TimerTask
|
||||
* io.netty.util.Timeout
|
||||
* io.netty.util.HashedWheelTimer
|
||||
|
||||
For the org.apache.dubbo.common.utils.CIDRUtils :
|
||||
|
||||
This product contains a modified portion of 'edazdarevic.commons.net.CIDRUtils' published at
|
||||
https://github.com/edazdarevic/CIDRUtils. The project is licensed under a MIT License:
|
||||
* The MIT License
|
||||
*
|
||||
* Copyright (c) 2013 Edin Dazdarevic (edin.dazdarevic@gmail.com)
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
|
||||
For the file org.apache.dubbo.common.utils.Utf8Utils.java:
|
||||
|
||||
This product contains a portion of the Protocol Buffers project, which is published at
|
||||
https://developers.google.com/protocol-buffers/ and is licensed under the following License:
|
||||
|
||||
Copyright 2008 Google Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Google Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Code generated by the Protocol Buffer compiler is owned by the owner
|
||||
of the input file used when generating it. This code is not
|
||||
standalone and requires a support library to be linked with it. This
|
||||
support library is itself covered by the above license.
|
||||
|
||||
For the ca.proto in dubbo-registry-xds:
|
||||
|
||||
This product contains a modified portion of 'Istio', an open platform to connect, manage, and secure microservices also
|
||||
under a "Apache License 2.0" license, see https://github.com/istio/api/blob/master/LICENSE:
|
||||
|
||||
* security/v1alpha1/ca.proto
|
||||
|
||||
9
NOTICE
Normal file
9
NOTICE
Normal file
@@ -0,0 +1,9 @@
|
||||
* 在使用本项目前,请您仔细阅读使用须知及免责声明,确保您已充分理解其中的内容
|
||||
|
||||
* 本项目采用 APACHE LICENSE 2.0 开源协议,如您需要源码的开发方式,需要遵循以下几点
|
||||
|
||||
1. 禁止修改或删除 LICENSE 文件。
|
||||
2. 禁止修改或删除源码头部的版权声明。
|
||||
3. 本项目可免费商业使用,商业使用请保留项目源码、出处、描述文件和作者声明等。
|
||||
4. 分发源码时候,请注明软件出处 https://visor.dromara.org/
|
||||
5. 不可二次开发或参与同类竞品的开发。
|
||||
85
README.md
85
README.md
@@ -1,5 +1,5 @@
|
||||
<div align="center"><img src="https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/5/29/cec03bbd-0eab-464d-9caf-d0b5a7ffc5a6.png" alt="logo" width="32" /></div>
|
||||
<p style="margin-top: 12px" align="center"><b>一款高颜值、现代化的智能运维&轻量堡垒机平台。</b></p>
|
||||
<div align="center"><img src="https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/9/11/11e7e78e-2af0-4c68-9811-db8a4c4400f4.png" alt="logo" width="520" /></div>
|
||||
<p style="margin-top: 12px" align="center"><b>【Dromara】 一款高颜值、现代化的自动化运维&轻量堡垒机平台。</b></p>
|
||||
<p align="center">
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
@@ -9,38 +9,43 @@
|
||||
<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/lijiahangmax/orion-visor/releases">
|
||||
<img src="https://img.shields.io/github/v/release/lijiahangmax/orion-visor" alt="release" />
|
||||
href="https://github.com/dromara/orion-visor/releases">
|
||||
<img src="https://img.shields.io/github/v/release/dromara/orion-visor" alt="release" />
|
||||
</a>
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
href="https://gitee.com/lijiahangmax/orion-visor/stargazers">
|
||||
<img src="https://gitee.com/lijiahangmax/orion-visor/badge/star.svg?theme=dark" alt="star" />
|
||||
href="https://gitee.com/dromara/orion-visor/stargazers">
|
||||
<img src="https://gitee.com/dromara/orion-visor/badge/star.svg?theme=gvp" alt="star" />
|
||||
</a>
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
href="https://gitee.com/lijiahangmax/orion-visor/members">
|
||||
<img src="https://gitee.com/lijiahangmax/orion-visor/badge/fork.svg?theme=dark" alt="fork" />
|
||||
href="https://gitee.com/dromara/orion-visor/members">
|
||||
<img src="https://gitee.com/dromara/orion-visor/badge/fork.svg?theme=gvp" alt="fork" />
|
||||
</a>
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
href="https://github.com/lijiahangmax/orion-visor">
|
||||
<img src="https://img.shields.io/github/stars/lijiahangmax/orion-visor" alt="star" />
|
||||
href="https://github.com/dromara/orion-visor">
|
||||
<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/lijiahangmax/orion-visor">
|
||||
<img src="https://img.shields.io/github/forks/lijiahangmax/orion-visor" alt="star" />
|
||||
href="https://github.com/dromara/orion-visor">
|
||||
<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>
|
||||
|
||||
------------------------------
|
||||
|
||||
**`orion-visor`** 提供一站式服务器运维解决方案。
|
||||
**`orion-visor`** 提供一站式自动化运维解决方案。
|
||||
|
||||
* **资产管理**:支持对资产进行分组,实现对主机、密钥和身份的统一管理和授权。
|
||||
* **在线终端**:提供在线终端 SSH 服务,支持快捷命令、自定义快捷键和主题风格。
|
||||
@@ -51,19 +56,21 @@
|
||||
|
||||
## 演示环境
|
||||
|
||||
* 🔗 演示地址: http://101.43.254.243:1081/
|
||||
* 🔗 演示地址: [https://dv.orionsec.cn/](https://dv.orionsec.cn/)
|
||||
* 🔏 演示账号: admin/admin
|
||||
* ⭐ 体验后可以点一下 `star` 这对我很重要! [github](https://github.com/lijiahangmax/orion-visor) [gitee](https://gitee.com/lijiahangmax/orion-visor)
|
||||
* ⭐ 体验后可以点一下 `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`
|
||||
|
||||
## 快速开始
|
||||
|
||||
```bash
|
||||
# clone
|
||||
git clone https://github.com/lijiahangmax/orion-visor
|
||||
git clone --depth=1 https://github.com/dromara/orion-visor
|
||||
cd orion-visor
|
||||
# 启动
|
||||
docker compose up -d
|
||||
@@ -72,19 +79,19 @@ docker compose up -d
|
||||
|
||||
## 项目文档
|
||||
|
||||
* [文档地址](https://lijiahangmax.github.io/open-orion/orion-visor/)
|
||||
* [安装文档](https://lijiahangmax.github.io/open-orion/orion-visor/quickstart/docker.html)
|
||||
* [更新日志](https://lijiahangmax.github.io/open-orion/orion-visor/update/change-log.html)
|
||||
* [操作手册](https://lijiahangmax.github.io/open-orion/orion-visor/operator/asset.html)
|
||||
* [常见问题](https://lijiahangmax.github.io/open-orion/orion-visor/support/faq.html)
|
||||
* [文档地址](https://visor.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,18 +116,20 @@ docker compose up -d
|
||||
|
||||
## Star History
|
||||
|
||||
[](https://star-history.com/#lijiahangmax/orion-visor&Date)
|
||||
[](https://star-history.com/#dromara/orion-visor&Date)
|
||||
|
||||
## 关于我
|
||||
|
||||
本人专注于使用 Java 和 Vue 进行全栈开发, 并在系统自动化运维方面拥有丰富开发的经验。如果您在这些领域有需求或遇到痛点, 请随时联系我, 并备注“合作”。
|
||||
|
||||
## 联系我
|
||||
|
||||
<div style="display: flex;">
|
||||
<img src="https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/5/17/d42d91f3-f0ee-4c63-adab-a35809e0804c.jpg" alt="wx" width="298px" height="398px"/>
|
||||
</div>
|
||||
<img src="https://bjuimg.obs.cn-north-4.myhuaweicloud.com/images/2024/10/11/cf72c603-3951-4171-95b4-06271dda1c80.jpg" alt="wx" width="628px"/>
|
||||
|
||||

|
||||

|
||||
微信: ljh1553488
|
||||
QQ群: 755242157
|
||||
|
||||
📧 咨询问题微信备注: vis
|
||||
📧 问题/加群微信备注: ops
|
||||
📧 合作/功能定制备注: 合作
|
||||
|
||||
## 支持一下
|
||||
@@ -131,8 +140,12 @@ docker compose up -d
|
||||
|
||||
## 免责声明
|
||||
|
||||
在使用本项目之前, 请确保您已经了解并同意相关的使用协议和隐私政策。[免责声明](https://github.com/lijiahangmax/orion-visor/blob/main/DISCLAIMER.md)
|
||||
在使用本项目之前, 请确保您已经了解并同意相关的使用协议和隐私政策。[免责声明](https://github.com/dromara/orion-visor/blob/main/DISCLAIMER.md)
|
||||
|
||||
## License
|
||||
|
||||
本项目遵循 [Apache-2.0](https://github.com/lijiahangmax/orion-visor/blob/main/LICENSE) 开源许可证。
|
||||
本项目遵循 [Apache-2.0](https://github.com/dromara/orion-visor/blob/main/LICENSE) 开源许可证。
|
||||
|
||||
## Gitee 最有价值开源项目 GVP
|
||||
|
||||

|
||||
|
||||
90
docker-compose-testing.yml
Normal file
90
docker-compose-testing.yml
Normal file
@@ -0,0 +1,90 @@
|
||||
version: '3.3'
|
||||
|
||||
services:
|
||||
service:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:latest
|
||||
privileged: true
|
||||
ports:
|
||||
- 9200:9200
|
||||
environment:
|
||||
- SPRING_PROFILES_ACTIVE=prod
|
||||
- MYSQL_HOST=mysql
|
||||
- MYSQL_PORT=3306
|
||||
- MYSQL_DATABASE=orion_visor
|
||||
- MYSQL_USER=root
|
||||
- MYSQL_PASSWORD=Data@123456
|
||||
- REDIS_HOST=redis
|
||||
- REDIS_PASSWORD=Data@123456
|
||||
- SECRET_KEY=uQeacXV8b3isvKLK
|
||||
- DEMO_MODE=false
|
||||
volumes:
|
||||
- /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: 15s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 15s
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- orion-visor-net
|
||||
|
||||
mysql:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:latest
|
||||
privileged: true
|
||||
ports:
|
||||
- 3307:3306
|
||||
environment:
|
||||
- MYSQL_DATABASE=orion_visor
|
||||
- MYSQL_USER=orion
|
||||
- MYSQL_PASSWORD=Data@123456
|
||||
- MYSQL_ROOT_PASSWORD=Data@123456
|
||||
volumes:
|
||||
- /data/orion-visor-space/docker-volumes/mysql/var-lib-mysql:/var/lib/mysql
|
||||
- /data/orion-visor-space/docker-volumes/mysql/var-lib-mysql-files:/var/lib/mysql-files
|
||||
healthcheck:
|
||||
test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/3306" ]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 5s
|
||||
networks:
|
||||
- orion-visor-net
|
||||
|
||||
redis:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:latest
|
||||
privileged: true
|
||||
ports:
|
||||
- 6380:6379
|
||||
environment:
|
||||
- REDIS_PASSWORD=Data@123456
|
||||
volumes:
|
||||
- /data/orion-visor-space/docker-volumes/redis/data:/data
|
||||
command: sh -c "redis-server /usr/local/redis.conf --requirepass $${REDIS_PASSWORD}"
|
||||
healthcheck:
|
||||
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 5s
|
||||
networks:
|
||||
- orion-visor-net
|
||||
|
||||
testing:
|
||||
build:
|
||||
context: ./docker/e2e
|
||||
environment:
|
||||
SERVER: http://service:80
|
||||
depends_on:
|
||||
service:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- orion-visor-net
|
||||
|
||||
networks:
|
||||
orion-visor-net:
|
||||
driver: bridge
|
||||
@@ -1,49 +1,105 @@
|
||||
version: '3.3'
|
||||
|
||||
services:
|
||||
orion-visor-service:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-service:2.0.7
|
||||
ui:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-ui:latest
|
||||
ports:
|
||||
- 1081:80
|
||||
environment:
|
||||
- MYSQL_HOST=orion-visor-mysql
|
||||
- MYSQL_PORT=3306
|
||||
- MYSQL_DATABASE=orion_visor
|
||||
- MYSQL_USER=root
|
||||
- MYSQL_PASSWORD=Data@123456
|
||||
- REDIS_HOST=orion-visor-redis
|
||||
- REDIS_PASSWORD=Data@123456
|
||||
- SECRET_KEY=uQeacXV8b3isvKLK
|
||||
- DEMO_MODE=false
|
||||
volumes:
|
||||
- /data/orion-visor-space/docker-volumes/orion-visor-service/root-orion:/root/orion
|
||||
- ${SERVICE_PORT:-1081}:80
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- orion-visor-mysql
|
||||
- orion-visor-redis
|
||||
orion-visor-mysql:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:2.0.7
|
||||
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}
|
||||
- MYSQL_USER=${MYSQL_USER:-root}
|
||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-Data@123456}
|
||||
- REDIS_HOST=${REDIS_HOST:-redis}
|
||||
- REDIS_PASSWORD=${REDIS_PASSWORD:-Data@123456}
|
||||
- SECRET_KEY=${SECRET_KEY:-uQeacXV8b3isvKLK}
|
||||
- DEMO_MODE=${DEMO_MODE:-false}
|
||||
volumes:
|
||||
- ${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: 5s
|
||||
retries: 15
|
||||
start_period: 30s
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- orion-visor-net
|
||||
|
||||
mysql:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:latest
|
||||
privileged: true
|
||||
ports:
|
||||
- 3307:3306
|
||||
environment:
|
||||
- MYSQL_DATABASE=orion_visor
|
||||
- MYSQL_USER=orion
|
||||
- MYSQL_PASSWORD=Data@123456
|
||||
- MYSQL_ROOT_PASSWORD=Data@123456
|
||||
- MYSQL_DATABASE=${MYSQL_DATABASE:-orion_visor}
|
||||
- MYSQL_USER=${MYSQL_USER:-orion}
|
||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-Data@123456}
|
||||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-Data@123456}
|
||||
volumes:
|
||||
- /data/orion-visor-space/docker-volumes/orion-visor-mysql/var-lib-mysql:/var/lib/mysql
|
||||
- /data/orion-visor-space/docker-volumes/orion-visor-mysql/var-lib-mysql-files:/var/lib/mysql-files
|
||||
- /data/orion-visor-space/docker-volumes/orion-visor-mysql/etc-mysql:/etc/mysql
|
||||
orion-visor-redis:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:2.0.7
|
||||
- ${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
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/3306" ]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
networks:
|
||||
- orion-visor-net
|
||||
|
||||
redis:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:latest
|
||||
privileged: true
|
||||
ports:
|
||||
- 6380:6379
|
||||
environment:
|
||||
- REDIS_PASSWORD=Data@123456
|
||||
- REDIS_PASSWORD=${REDIS_PASSWORD:-Data@123456}
|
||||
volumes:
|
||||
- /data/orion-visor-space/docker-volumes/orion-visor-redis/data:/data
|
||||
- ${VOLUME_BASE:-/data/orion-visor-space/docker-volumes}/redis/data:/data
|
||||
command: sh -c "redis-server /usr/local/redis.conf --requirepass $${REDIS_PASSWORD}"
|
||||
orion-visor-adminer:
|
||||
image: adminer
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
networks:
|
||||
- orion-visor-net
|
||||
|
||||
adminer:
|
||||
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
|
||||
networks:
|
||||
- orion-visor-net
|
||||
|
||||
networks:
|
||||
orion-visor-net:
|
||||
driver: bridge
|
||||
@@ -1,8 +1,7 @@
|
||||
#/bin/bash
|
||||
docker compose down
|
||||
sh ./pull.sh
|
||||
# demo 启动
|
||||
if [ "$1" == "demo" ]; then
|
||||
sed -i 's/DEMO_MODE=false/DEMO_MODE=true/g' docker-compose.yml
|
||||
sed -i 's/\${DEMO_MODE:-false}/true/g' docker-compose.yml
|
||||
fi
|
||||
docker compose up -d
|
||||
docker compose up -d --remove-orphans
|
||||
|
||||
1
docker/adminer/Dockerfile
Normal file
1
docker/adminer/Dockerfile
Normal file
@@ -0,0 +1 @@
|
||||
FROM adminer:latest
|
||||
6
docker/adminer/build.sh
Normal file
6
docker/adminer/build.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#/bin/bash
|
||||
set -e
|
||||
version=2.3.6
|
||||
docker build -t 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
|
||||
7
docker/e2e/Dockerfile
Normal file
7
docker/e2e/Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
||||
FROM ghcr.io/linuxsuren/api-testing:v0.0.17
|
||||
|
||||
WORKDIR /workspace
|
||||
COPY . .
|
||||
RUN chmod 777 *
|
||||
|
||||
CMD [ "/workspace/entrypoint.sh" ]
|
||||
3
docker/e2e/entrypoint.sh
Normal file
3
docker/e2e/entrypoint.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
atest run -p testsuite.yaml --report md
|
||||
49
docker/e2e/testsuite.yaml
Normal file
49
docker/e2e/testsuite.yaml
Normal file
@@ -0,0 +1,49 @@
|
||||
#!api-testing
|
||||
# yaml-language-server: $schema=https://linuxsuren.github.io/api-testing/api-testing-schema.json
|
||||
name: orion-visor
|
||||
api: |
|
||||
{{default "http://orion-visor-service:9200" (env "SERVER")}}
|
||||
items:
|
||||
- name: login
|
||||
request:
|
||||
api: /orion-visor/api/infra/auth/login
|
||||
method: POST
|
||||
header:
|
||||
Content-type: application/json
|
||||
body: |
|
||||
{"username":"admin","password":"21232f297a57a5a743894a0e4a801fc3"}
|
||||
expect:
|
||||
bodyFieldsExpect:
|
||||
code: 200
|
||||
- name: user
|
||||
request:
|
||||
api: /orion-visor/api/infra/user-aggregate/user
|
||||
header:
|
||||
Authorization: Bearer {{.login.data.token}}
|
||||
expect:
|
||||
bodyFieldsExpect:
|
||||
code: 200
|
||||
msg: "success"
|
||||
- name: menu
|
||||
request:
|
||||
api: /orion-visor/api/infra/user-aggregate/menu
|
||||
header:
|
||||
Authorization: Bearer {{.login.data.token}}
|
||||
expect:
|
||||
bodyFieldsExpect:
|
||||
code: 200
|
||||
msg: "success"
|
||||
- name: haveUnRead
|
||||
request:
|
||||
api: /orion-visor/api/infra/system-message/has-unread
|
||||
- name: queryOperatorLog
|
||||
request:
|
||||
api: /orion-visor/api/infra/mine/query-operator-log
|
||||
method: POST
|
||||
- name: hostList
|
||||
request:
|
||||
api: /orion-visor/api/infra/tag/list?type=HOST
|
||||
- name: queryHost
|
||||
request:
|
||||
api: /orion-visor/api/asset/host/query
|
||||
method: POST
|
||||
8
docker/mysql/build.sh
Normal file
8
docker/mysql/build.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
#/bin/bash
|
||||
set -e
|
||||
version=2.3.6
|
||||
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/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,7 +0,0 @@
|
||||
#/bin/bash
|
||||
version=2.0.7
|
||||
cp -r ../../sql ./sql
|
||||
docker build -t orion-visor-mysql:${version} .
|
||||
rm -rf ./sql
|
||||
docker tag orion-visor-mysql:${version} registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:${version}
|
||||
docker push registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-mysql:${version}
|
||||
@@ -1,5 +0,0 @@
|
||||
#/bin/bash
|
||||
version=2.0.7
|
||||
docker build -t orion-visor-redis:${version} .
|
||||
docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version}
|
||||
docker push registry.cn-hangzhou.aliyuncs.com/lijiahangmax/orion-visor-redis:${version}
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/bash
|
||||
cd /app
|
||||
nohup java -jar app.jar --spring.profiles.active=prod 2>&1 &
|
||||
nginx -g 'daemon off;'
|
||||
13
docker/push.sh
Normal file
13
docker/push.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#/bin/bash
|
||||
set -e
|
||||
version=2.3.6
|
||||
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
|
||||
6
docker/redis/build.sh
Normal file
6
docker/redis/build.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#/bin/bash
|
||||
set -e
|
||||
version=2.3.6
|
||||
docker build -t 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
|
||||
20
docker/service/Dockerfile
Normal file
20
docker/service/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
FROM openjdk:8-jdk-alpine
|
||||
USER root
|
||||
WORKDIR /app
|
||||
# 系统时区
|
||||
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
|
||||
# 设置时区
|
||||
RUN ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
|
||||
echo '${TZ}' > /etc/timezone
|
||||
# 复制包
|
||||
COPY ./orion-visor-launch.jar /app/app.jar
|
||||
# 启动
|
||||
CMD ["java", "-jar", "/app/app.jar"]
|
||||
@@ -1,9 +1,8 @@
|
||||
#/bin/bash
|
||||
version=2.0.7
|
||||
set -e
|
||||
version=2.3.6
|
||||
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 push 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,23 +1,18 @@
|
||||
FROM nginx:alpine
|
||||
USER root
|
||||
WORKDIR /app
|
||||
# 系统时区
|
||||
ARG TZ=Asia/Shanghai
|
||||
# 添加包
|
||||
RUN \
|
||||
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
|
||||
apk update && \
|
||||
apk add tzdata && \
|
||||
apk add openjdk8
|
||||
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 ./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 ["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.6
|
||||
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,15 +27,15 @@ 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-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
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";
|
||||
@@ -19,12 +19,12 @@
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
href="https://gitee.com/lijiahangmax/orion-visor/stargazers">
|
||||
<img src="https://gitee.com/lijiahangmax/orion-visor/badge/star.svg?theme=dark" alt="star" />
|
||||
<img src="https://gitee.com/lijiahangmax/orion-visor/badge/star.svg?theme=gvp" alt="star" />
|
||||
</a>
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
href="https://gitee.com/lijiahangmax/orion-visor/members">
|
||||
<img src="https://gitee.com/lijiahangmax/orion-visor/badge/fork.svg?theme=dark" alt="fork" />
|
||||
<img src="https://gitee.com/lijiahangmax/orion-visor/badge/fork.svg?theme=gvp" alt="fork" />
|
||||
</a>
|
||||
<a target="_blank"
|
||||
style="text-decoration: none !important;"
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -21,22 +21,35 @@ Dashboard 修改)
|
||||
|
||||
```shell
|
||||
# github
|
||||
git clone https://github.com/lijiahangmax/orion-visor
|
||||
git clone --depth=1 https://github.com/lijiahangmax/orion-visor
|
||||
# gitee
|
||||
git clone https://gitee.com/lijiahangmax/orion-visor
|
||||
git clone --depth=1 https://gitee.com/lijiahangmax/orion-visor
|
||||
```
|
||||
|
||||
### 构建镜像
|
||||
### 拉取镜像
|
||||
|
||||
```
|
||||
# 进入仓库目录
|
||||
cd orion-visor
|
||||
# 修改 docker-compose.yml (建议修改)
|
||||
# MYSQL_USER mysql 用户名
|
||||
# MYSQL_PASSWORD mysql 用户密码
|
||||
# MYSQL_ROOT_PASSWORD mysql root 密码
|
||||
# REDIS_PASSWORD redis 密码
|
||||
# SECRET_KEY 加密密钥
|
||||
# 创建名为 .env 的 .env.example 副本
|
||||
cp .env.example .env
|
||||
# 将其中的值删除以保持默认或将其修改为你喜欢的值
|
||||
# SERVICE_PORT 你希望服务监听的端口
|
||||
# VOLUME_BASE 你希望数据持久化保存的目录, 如果不提前创建将以 docker 进程宿主身份创建(通常是 root)
|
||||
|
||||
# MYSQL_HOST mysql 服务所在的主机, 如果你没有现有的 MySQL 请保持值为 mysql, 如果你有自部署的请在 docker-compose.yml 中移除 services.mysql 以节约性能
|
||||
# MYSQL_PORT mysql 监听的端口
|
||||
# MYSQL_DATABASE mysql 数据库
|
||||
# MYSQL_USER mysql 用户名
|
||||
# MYSQL_PASSWORD mysql 用户密码
|
||||
# MYSQL_ROOT_PASSWORD mysql root 密码
|
||||
|
||||
# REDIS_HOST redis 服务所在的主机, 如果你没有现有的 Redis 请保持值为 redis, 如果你有自部署的请在 docker-compose.yml 中移除 services.redis 以节约性能
|
||||
# REDIS_PASSWORD redis 密码
|
||||
|
||||
# SECRET_KEY 加密密钥
|
||||
# 拉取远程镜像
|
||||
docker compose pull
|
||||
```
|
||||
|
||||
### 启动
|
||||
@@ -45,7 +58,7 @@ cd orion-visor
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
### 修改加密方式
|
||||
### 修改 MySQL 账户的加密方式
|
||||
|
||||
```
|
||||
访问 adminer: http://localhost:8081
|
||||
|
||||
@@ -3,22 +3,22 @@
|
||||
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>
|
||||
|
||||
<description>项目公共基准包</description>
|
||||
<url>https://github.com/lijiahangmax/orion-visor</url>
|
||||
<url>https://github.com/dromara/orion-visor</url>
|
||||
|
||||
<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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import cn.orionsec.kit.lang.constant.OrionConst;
|
||||
|
||||
/**
|
||||
* 项目常量
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/6/19 18:56
|
||||
*/
|
||||
public interface AppConst extends OrionConst {
|
||||
|
||||
/**
|
||||
* 同 ${orion.version} 迭代时候需要手动更改
|
||||
*/
|
||||
String VERSION = "2.3.6";
|
||||
|
||||
/**
|
||||
* 同 ${spring.application.name}
|
||||
*/
|
||||
String APP_NAME = "orion-visor";
|
||||
|
||||
String GITHUB = "https://github.com/dromara/orion-visor";
|
||||
|
||||
String GITEE = "https://gitee.com/dromara/orion-visor";
|
||||
|
||||
String ISSUES = "https://github.com/dromara/orion-visor/issues";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* 自动装配排序常量
|
||||
* <p>
|
||||
* 实际遵循 DependsOn
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/7/11 17:55
|
||||
*/
|
||||
public interface AutoConfigureOrderConst {
|
||||
|
||||
int FRAMEWORK_WEB = Integer.MIN_VALUE + 1100;
|
||||
|
||||
int FRAMEWORK_SECURITY = Integer.MIN_VALUE + 1200;
|
||||
|
||||
int FRAMEWORK_WEBSOCKET = Integer.MIN_VALUE + 1300;
|
||||
|
||||
int FRAMEWORK_DESENSITIZE = Integer.MIN_VALUE + 1400;
|
||||
|
||||
int FRAMEWORK_LOG = Integer.MIN_VALUE + 1500;
|
||||
|
||||
int FRAMEWORK_SWAGGER = Integer.MIN_VALUE + 1600;
|
||||
|
||||
int FRAMEWORK_DATASOURCE = Integer.MIN_VALUE + 1700;
|
||||
|
||||
int FRAMEWORK_MYBATIS = Integer.MIN_VALUE + 1800;
|
||||
|
||||
int FRAMEWORK_REDIS = Integer.MIN_VALUE + 1900;
|
||||
|
||||
int FRAMEWORK_REDIS_CACHE = Integer.MIN_VALUE + 2000;
|
||||
|
||||
int FRAMEWORK_CONFIG = Integer.MIN_VALUE + 2100;
|
||||
|
||||
int FRAMEWORK_ENCRYPT = Integer.MIN_VALUE + 2200;
|
||||
|
||||
int FRAMEWORK_STORAGE = Integer.MIN_VALUE + 2300;
|
||||
|
||||
int FRAMEWORK_JOB = Integer.MIN_VALUE + 2400;
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* bean 排序常量
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/6/29 16:09
|
||||
*/
|
||||
public interface BeanOrderConst {
|
||||
|
||||
/**
|
||||
* 公共返回值包装处理器
|
||||
*/
|
||||
int RESPONSE_ADVICE_WRAPPER = Integer.MIN_VALUE + 1000;
|
||||
|
||||
/**
|
||||
* 演示模式切面
|
||||
*/
|
||||
int DEMO_DISABLE_API_ASPECT = Integer.MIN_VALUE + 10;
|
||||
|
||||
/**
|
||||
* 全局日志打印
|
||||
*/
|
||||
int LOG_PRINT_ASPECT = Integer.MIN_VALUE + 20;
|
||||
|
||||
/**
|
||||
* 操作日志切面
|
||||
*/
|
||||
int OPERATOR_LOG_ASPECT = Integer.MIN_VALUE + 30;
|
||||
|
||||
}
|
||||
@@ -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.constant;
|
||||
|
||||
/**
|
||||
* 常量 - 中文
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/11/30 21:00
|
||||
*/
|
||||
public interface CnConst {
|
||||
|
||||
String CN_USER = "用户";
|
||||
|
||||
String CN_ROLE = "角色";
|
||||
|
||||
String CN_UNKNOWN = "未知";
|
||||
|
||||
String CN_INTRANET_IP = "内网IP";
|
||||
|
||||
}
|
||||
@@ -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";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* 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 2023/6/23 18:49
|
||||
*/
|
||||
public interface Const extends cn.orionsec.kit.lang.constant.Const, FieldConst, CnConst {
|
||||
|
||||
Integer NOT_DELETE = 0;
|
||||
|
||||
Integer IS_DELETED = 1;
|
||||
|
||||
int BEARER_PREFIX_LEN = 7;
|
||||
|
||||
int MD5_LEN = 32;
|
||||
|
||||
Long ROOT_PARENT_ID = 0L;
|
||||
|
||||
Integer DEFAULT_SORT = 10;
|
||||
|
||||
Long NONE_ID = -1L;
|
||||
|
||||
Integer DEFAULT_VERSION = 1;
|
||||
|
||||
Long SYSTEM_USER_ID = 0L;
|
||||
|
||||
String SYSTEM_USERNAME = "system";
|
||||
|
||||
int BATCH_COUNT = 500;
|
||||
|
||||
}
|
||||
@@ -1,9 +1,31 @@
|
||||
package com.orion.visor.framework.common.constant;
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 用于定义错误码
|
||||
@@ -0,0 +1,188 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import cn.orionsec.kit.lang.exception.ApplicationException;
|
||||
import cn.orionsec.kit.lang.exception.argument.InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/7/7 18:51
|
||||
*/
|
||||
public interface ErrorMessage {
|
||||
|
||||
String MISSING = "{} 不能为空";
|
||||
|
||||
String PARAM_MISSING = "参数不能为空";
|
||||
|
||||
String PARAM_ERROR = "参数错误";
|
||||
|
||||
String ID_MISSING = "id 不能为空";
|
||||
|
||||
String INVALID_PARAM = "参数验证失败";
|
||||
|
||||
String DATA_MODIFIED = "数据发生变更, 请刷新后重试";
|
||||
|
||||
String DATA_ABSENT = "数据不存在";
|
||||
|
||||
String KEY_ABSENT = "主机密钥不存在";
|
||||
|
||||
String IDENTITY_ABSENT = "主机身份不存在";
|
||||
|
||||
String CONFIG_ABSENT = "配置不存在";
|
||||
|
||||
String CONFIG_PRESENT = "配置已存在";
|
||||
|
||||
String DATA_PRESENT = "数据已存在";
|
||||
|
||||
String NAME_PRESENT = "名称已存在";
|
||||
|
||||
String CODE_PRESENT = "编码已存在";
|
||||
|
||||
String NICKNAME_PRESENT = "花名已存在";
|
||||
|
||||
String USERNAME_PRESENT = "用户名已存在";
|
||||
|
||||
String ROLE_ABSENT = "角色不存在";
|
||||
|
||||
String ROLE_CODE_ABSENT = "角色 [{}] 不存在";
|
||||
|
||||
String INVALID_PARENT_MENU = "所选父菜单不合法";
|
||||
|
||||
String PARENT_MENU_ABSENT = "父菜单不存在";
|
||||
|
||||
String USERNAME_PASSWORD_ERROR = "用户名或密码错误";
|
||||
|
||||
String MAX_LOGIN_FAILED = "登录失败次数已上限";
|
||||
|
||||
String HISTORY_ABSENT = "历史值不存在";
|
||||
|
||||
String USER_ABSENT = "用户不存在";
|
||||
|
||||
String HOST_ABSENT = "主机不存在";
|
||||
|
||||
String GROUP_ABSENT = "分组不存在";
|
||||
|
||||
String HOST_TYPE_ERROR = "主机类型错误";
|
||||
|
||||
String HOST_NOT_ENABLED = "主机未启用";
|
||||
|
||||
String UNABLE_OPERATE_ADMIN_ROLE = "无法操作管理员账号";
|
||||
|
||||
String UNSUPPORTED_CHARSET = "不支持的编码 [{}]";
|
||||
|
||||
String DECRYPT_ERROR = "数据解密失败";
|
||||
|
||||
String PASSWORD_MISSING = "请输入密码";
|
||||
|
||||
String BEFORE_PASSWORD_ERROR = "原密码错误";
|
||||
|
||||
String DATA_NO_PERMISSION = "数据无权限";
|
||||
|
||||
String ANY_NO_PERMISSION = "{}无权限";
|
||||
|
||||
String SESSION_PRESENT = "会话已存在";
|
||||
|
||||
String SESSION_ABSENT = "会话不存在";
|
||||
|
||||
String PATH_NOT_NORMALIZE = "路径不合法";
|
||||
|
||||
String OPERATE_ERROR = "操作失败";
|
||||
|
||||
String UNKNOWN_TYPE = "未知类型";
|
||||
|
||||
String ERROR_TYPE = "错误的类型";
|
||||
|
||||
String FILE_ABSENT = "文件不存在";
|
||||
|
||||
String FILE_ABSENT_CLEAR = "文件不存在 (可能已被清理)";
|
||||
|
||||
String LOG_ABSENT = "日志不存在";
|
||||
|
||||
String TASK_ABSENT = "任务不存在";
|
||||
|
||||
String CONNECT_ERROR = "连接失败";
|
||||
|
||||
String AUTH_ERROR = "认证失败";
|
||||
|
||||
String FILE_UPLOAD_ERROR = "文件上传失败";
|
||||
|
||||
String SCRIPT_UPLOAD_ERROR = "脚本上传失败";
|
||||
|
||||
String EXEC_ERROR = "执行失败";
|
||||
|
||||
String ILLEGAL_STATUS = "当前状态不支持此操作";
|
||||
|
||||
String CHECK_AUTHORIZED_HOST = "请选择已授权的主机";
|
||||
|
||||
String FILE_READ_ERROR = "文件读取失败";
|
||||
|
||||
String FILE_READ_ERROR_CLEAR = "文件读取失败 (可能已被清理)";
|
||||
|
||||
String PLEASE_CHECK_HOST_SSH = "请检查主机 {} 是否存在/权限/SSH配置";
|
||||
|
||||
String CLIENT_ABORT = "手动中断";
|
||||
|
||||
String UNABLE_DOWNLOAD_FOLDER = "无法下载文件夹";
|
||||
|
||||
/**
|
||||
* 是否为业务异常
|
||||
*
|
||||
* @param ex ex
|
||||
* @return biz exception
|
||||
*/
|
||||
static boolean isBizException(Exception ex) {
|
||||
if (ex == null) {
|
||||
return false;
|
||||
}
|
||||
return ex instanceof InvalidArgumentException
|
||||
|| ex instanceof IllegalArgumentException
|
||||
|| ex instanceof ApplicationException;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取错误信息
|
||||
*
|
||||
* @param ex ex
|
||||
* @param defaultMsg defaultMsg
|
||||
* @return message
|
||||
*/
|
||||
static String getErrorMessage(Exception ex, String defaultMsg) {
|
||||
if (ex == null) {
|
||||
return null;
|
||||
}
|
||||
String message = ex.getMessage();
|
||||
if (message == null) {
|
||||
return defaultMsg;
|
||||
}
|
||||
// 业务异常
|
||||
if (isBizException(ex)) {
|
||||
return message;
|
||||
}
|
||||
return defaultMsg;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 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 2023/12/28 18:34
|
||||
*/
|
||||
public interface ExtraFieldConst extends FieldConst {
|
||||
|
||||
String USER_ID = "userId";
|
||||
|
||||
String TRACE_ID = "traceId";
|
||||
|
||||
String IDENTITY = "identity";
|
||||
|
||||
String GROUP_NAME = "groupName";
|
||||
|
||||
String ID_LIST = "idList";
|
||||
|
||||
String USERNAME = "username";
|
||||
|
||||
String HOME = "home";
|
||||
|
||||
String STATUS_NAME = "statusName";
|
||||
|
||||
String KEY_NAME = "keyName";
|
||||
|
||||
String POSITION_NAME = "positionName";
|
||||
|
||||
String GRANT_TYPE = "grantType";
|
||||
|
||||
String GRANT_NAME = "grantName";
|
||||
|
||||
String CHANNEL_ID = "channelId";
|
||||
|
||||
String SESSION_ID = "sessionId";
|
||||
|
||||
String CONNECT_TYPE = "connectType";
|
||||
|
||||
String HOST_ID = "hostId";
|
||||
|
||||
String HOST_NAME = "hostName";
|
||||
|
||||
String LOG_ID = "logId";
|
||||
|
||||
String DARK = "dark";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* 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 2023/10/17 12:44
|
||||
*/
|
||||
public interface FieldConst {
|
||||
|
||||
String ID = "id";
|
||||
|
||||
String KEY = "key";
|
||||
|
||||
String CODE = "code";
|
||||
|
||||
String NAME = "name";
|
||||
|
||||
String TITLE = "title";
|
||||
|
||||
String VALUE = "value";
|
||||
|
||||
String LABEL = "label";
|
||||
|
||||
String TYPE = "type";
|
||||
|
||||
String COLOR = "color";
|
||||
|
||||
String STATUS = "status";
|
||||
|
||||
String INFO = "info";
|
||||
|
||||
String EXTRA = "extra";
|
||||
|
||||
String REL_ID = "relId";
|
||||
|
||||
String BEFORE = "before";
|
||||
|
||||
String AFTER = "after";
|
||||
|
||||
String SOURCE = "source";
|
||||
|
||||
String TARGET = "target";
|
||||
|
||||
String CHARSET = "charset";
|
||||
|
||||
String TOKEN = "token";
|
||||
|
||||
String SEQ = "seq";
|
||||
|
||||
String PATH = "path";
|
||||
|
||||
String ADDRESS = "address";
|
||||
|
||||
String MOD = "mod";
|
||||
|
||||
String COUNT = "count";
|
||||
|
||||
String DATE = "date";
|
||||
|
||||
String TIME = "time";
|
||||
|
||||
String TEXT = "text";
|
||||
|
||||
String ISSUE = "issue";
|
||||
|
||||
String EXPIRE = "expire";
|
||||
|
||||
String LOCATION = "location";
|
||||
|
||||
String USER_AGENT = "userAgent";
|
||||
|
||||
String ERROR_MESSAGE = "errorMessage";
|
||||
|
||||
String UUID = "uuid";
|
||||
|
||||
String REDIRECT = "redirect";
|
||||
|
||||
String SCHEMA = "schema";
|
||||
|
||||
String FILTER = "filter";
|
||||
|
||||
String ALL = "all";
|
||||
|
||||
String CONFIG = "config";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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 2024/4/17 10:35
|
||||
*/
|
||||
public interface FileConst {
|
||||
|
||||
String ERROR_LOG = "error.log";
|
||||
|
||||
String EXEC = "exec";
|
||||
|
||||
String SCRIPT = "script";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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 2023/6/16 17:04
|
||||
*/
|
||||
public interface FilterOrderConst {
|
||||
|
||||
int TRICE_ID_FILTER = Integer.MIN_VALUE + 1000;
|
||||
|
||||
int CORS_FILTER = Integer.MIN_VALUE + 2000;
|
||||
|
||||
}
|
||||
@@ -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.constant;
|
||||
|
||||
/**
|
||||
* 验证常量
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/10/20 11:45
|
||||
*/
|
||||
public interface ValidConst {
|
||||
|
||||
String USERNAME_4_32_PATTERN = "^[a-zA-Z0-9_]{4,32}$";
|
||||
|
||||
String USERNAME_4_32_MESSAGE = "只能为 4-32 位的数字,字母或下滑线";
|
||||
|
||||
String DICT_1_32_PATTERN = "^[a-zA-Z0-9_]{1,32}$";
|
||||
|
||||
String DICT_1_32_MESSAGE = "只能为 1-32 位的数字,字母或下滑线";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 自动清理配置
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/6/24 15:03
|
||||
*/
|
||||
@Data
|
||||
@Schema(name = "AutoClearConfig", description = "自动清理配置")
|
||||
public class AutoClearConfig {
|
||||
|
||||
@Schema(description = "是否开启")
|
||||
private Boolean enabled;
|
||||
|
||||
@Schema(description = "保留周期 (天)")
|
||||
private Integer keepPeriod;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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 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(name = "BaseQueryRequest", description = "基本查询请求")
|
||||
public class BaseQueryRequest implements IPageRequest, IOrderRequest {
|
||||
|
||||
@NotNull(groups = Page.class)
|
||||
@Min(value = 1, groups = Page.class)
|
||||
@Max(value = 10000, groups = Page.class)
|
||||
@Schema(description = "页码")
|
||||
private Integer page;
|
||||
|
||||
@NotNull(groups = Page.class)
|
||||
@Min(value = 1, groups = Page.class)
|
||||
@Max(value = 200, groups = Page.class)
|
||||
@Schema(description = "大小")
|
||||
private Integer limit;
|
||||
|
||||
@Schema(description = "查询排序")
|
||||
private Integer order;
|
||||
|
||||
}
|
||||
@@ -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 2024/8/29 11:26
|
||||
*/
|
||||
public interface DataClearRequest {
|
||||
|
||||
/**
|
||||
* 获取清理数量限制
|
||||
*
|
||||
* @return 清理限制
|
||||
*/
|
||||
Integer getLimit();
|
||||
|
||||
/**
|
||||
* 设置清理数量限制
|
||||
*
|
||||
* @param limit limit
|
||||
*/
|
||||
void setLimit(Integer limit);
|
||||
|
||||
}
|
||||
@@ -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,4 +1,26 @@
|
||||
package com.orion.visor.framework.common.entity;
|
||||
/*
|
||||
* 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 java.io.Serializable;
|
||||
|
||||
@@ -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;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 请求留痕模型
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @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;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* 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 java.util.List;
|
||||
|
||||
/**
|
||||
* 树节点
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/11/23 16:52
|
||||
*/
|
||||
public interface TreeNode<T extends TreeNode<T>> {
|
||||
|
||||
/**
|
||||
* id
|
||||
*
|
||||
* @return id
|
||||
*/
|
||||
Long getId();
|
||||
|
||||
/**
|
||||
* parentId
|
||||
*
|
||||
* @return parentId
|
||||
*/
|
||||
Long getParentId();
|
||||
|
||||
/**
|
||||
* sort
|
||||
*
|
||||
* @return sort
|
||||
*/
|
||||
Integer getSort();
|
||||
|
||||
/**
|
||||
* children
|
||||
*
|
||||
* @return children
|
||||
*/
|
||||
List<T> getChildren();
|
||||
|
||||
/**
|
||||
* 设置 children
|
||||
*
|
||||
* @param children children
|
||||
*/
|
||||
void setChildren(List<T> children);
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 折线图多系列数据
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/12/23 13:41
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(name = "LineChartData", description = "折线图多系列数据")
|
||||
public class LineChartData {
|
||||
|
||||
@Schema(description = "x轴")
|
||||
private List<String> x;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -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 = "PieChartData", description = "饼图数据")
|
||||
public class PieChartData {
|
||||
|
||||
@Schema(description = "数据")
|
||||
private Map<String, Integer> data;
|
||||
|
||||
}
|
||||
@@ -1,4 +1,26 @@
|
||||
package com.orion.visor.framework.common.enums;
|
||||
/*
|
||||
* 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.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 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.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 启用状态
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/10/12 16:02
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum EnableStatus {
|
||||
|
||||
/**
|
||||
* 停用
|
||||
*/
|
||||
DISABLED(0),
|
||||
|
||||
/**
|
||||
* 启用
|
||||
*/
|
||||
ENABLED(1),
|
||||
|
||||
;
|
||||
|
||||
private final Integer value;
|
||||
|
||||
public static EnableStatus of(Integer value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
for (EnableStatus e : values()) {
|
||||
if (e.value.equals(value)) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* 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.enums;
|
||||
|
||||
import cn.orionsec.kit.lang.utils.Strings;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 端点定义
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/6/21 19:15
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum EndpointDefine {
|
||||
|
||||
/**
|
||||
* 上传临时分区
|
||||
*/
|
||||
UPLOAD_SWAP("/upload/swap/{}"),
|
||||
|
||||
/**
|
||||
* 批量执行日志
|
||||
*/
|
||||
EXEC_LOG("/exec/{}/{}.log"),
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* 端点
|
||||
*/
|
||||
private final String endpoint;
|
||||
|
||||
/**
|
||||
* 格式化
|
||||
*
|
||||
* @param params params
|
||||
* @return path
|
||||
*/
|
||||
public String format(Object... params) {
|
||||
return Strings.format(this.endpoint, params);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* 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.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 移动位置
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/11/13 17:26
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum MovePosition {
|
||||
|
||||
/**
|
||||
* 拖拽到目标元素上
|
||||
*/
|
||||
TOP(-1),
|
||||
|
||||
/**
|
||||
* 拖拽到目标元素中
|
||||
*/
|
||||
IN(0),
|
||||
|
||||
/**
|
||||
* 拖拽到目标元素下
|
||||
*/
|
||||
BOTTOM(1),
|
||||
|
||||
;
|
||||
|
||||
private final Integer position;
|
||||
|
||||
public static MovePosition of(Integer position) {
|
||||
if (position == null) {
|
||||
return null;
|
||||
}
|
||||
for (MovePosition value : values()) {
|
||||
if (value.position.equals(position)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* 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.handler.data;
|
||||
|
||||
import cn.orionsec.kit.spring.SpringHolder;
|
||||
import org.dromara.visor.common.handler.data.model.GenericsDataModel;
|
||||
import org.dromara.visor.common.handler.data.strategy.GenericsDataStrategy;
|
||||
|
||||
/**
|
||||
* 标准数据定义
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/12/21 0:07
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public interface GenericsStrategyDefinition {
|
||||
|
||||
/**
|
||||
* 获取数据处理策略
|
||||
*
|
||||
* @return class
|
||||
*/
|
||||
Class<? extends GenericsDataStrategy<? extends GenericsDataModel>> getStrategyClass();
|
||||
|
||||
/**
|
||||
* 获取数据模型策略处理器
|
||||
*
|
||||
* @param <M> Model
|
||||
* @param <S> Strategy
|
||||
* @return Strategy Bean
|
||||
*/
|
||||
default <M extends GenericsDataModel, S extends GenericsDataStrategy<M>> S getStrategy() {
|
||||
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 model
|
||||
*/
|
||||
default <M extends GenericsDataModel> M parse(String serialModel) {
|
||||
return (M) this.getStrategy().parse(serialModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转为视图对象
|
||||
*
|
||||
* @param serialModel serialModel
|
||||
* @param <M> model
|
||||
* @return viewModel
|
||||
*/
|
||||
default <M extends GenericsDataModel> M toView(String serialModel) {
|
||||
return (M) this.getStrategy().toView(serialModel);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* 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.handler.data.model;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 标准数据模型
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/12/20 22:07
|
||||
*/
|
||||
public interface GenericsDataModel {
|
||||
|
||||
/**
|
||||
* 序列化
|
||||
*
|
||||
* @return json
|
||||
*/
|
||||
default String serial() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 转为 map
|
||||
*
|
||||
* @return map
|
||||
*/
|
||||
default Map<String, Object> toMap() {
|
||||
return JSON.parseObject(this.serial());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* 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.handler.data.strategy;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import org.dromara.visor.common.handler.data.model.GenericsDataModel;
|
||||
|
||||
/**
|
||||
* 标准数据处理策略 基类
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/6/11 21:44
|
||||
*/
|
||||
public abstract class AbstractGenericsDataStrategy<M extends GenericsDataModel> implements GenericsDataStrategy<M> {
|
||||
|
||||
protected final Class<M> modelClass;
|
||||
|
||||
public AbstractGenericsDataStrategy(Class<M> modelClass) {
|
||||
this.modelClass = modelClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新填充
|
||||
*
|
||||
* @param beforeModel 修改前的配置
|
||||
* @param afterModel 修改后的配置
|
||||
*/
|
||||
protected void updateFill(M beforeModel, M afterModel) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 预校验参数
|
||||
*
|
||||
* @param model model
|
||||
*/
|
||||
protected void preValid(M model) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数
|
||||
*
|
||||
* @param model model
|
||||
*/
|
||||
protected void valid(M model) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doValid(M beforeModel, M afterModel) {
|
||||
// 预校验参数
|
||||
this.preValid(afterModel);
|
||||
// 更新填充
|
||||
this.updateFill(beforeModel, afterModel);
|
||||
// 校验参数
|
||||
this.valid(afterModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public M parse(String serialModel) {
|
||||
return JSON.parseObject(serialModel, modelClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toView(M model) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public M toView(String serialModel) {
|
||||
// 解析
|
||||
M parse = this.parse(serialModel);
|
||||
// 转为视图对象
|
||||
this.toView(parse);
|
||||
return parse;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* 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.handler.data.strategy;
|
||||
|
||||
import org.dromara.visor.common.handler.data.model.GenericsDataModel;
|
||||
|
||||
/**
|
||||
* 标准数据处理策略
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/12/20 22:09
|
||||
*/
|
||||
public interface GenericsDataStrategy<M extends GenericsDataModel> {
|
||||
|
||||
/**
|
||||
* 获取默认值
|
||||
*
|
||||
* @return 默认值
|
||||
*/
|
||||
M getDefault();
|
||||
|
||||
/**
|
||||
* 执行完整验证链
|
||||
* <p>
|
||||
* preValid > updateFill > valid
|
||||
*
|
||||
* @param beforeModel beforeModel
|
||||
* @param afterModel afterModel
|
||||
*/
|
||||
void doValid(M beforeModel, M afterModel);
|
||||
|
||||
/**
|
||||
* 解析数据
|
||||
*
|
||||
* @param serialModel serialModel
|
||||
* @return model
|
||||
*/
|
||||
M parse(String serialModel);
|
||||
|
||||
/**
|
||||
* 转为视图配置
|
||||
*
|
||||
* @param model model
|
||||
*/
|
||||
void toView(M model);
|
||||
|
||||
/**
|
||||
* 转为视图配置
|
||||
*
|
||||
* @param serialModel serialModel
|
||||
* @return model
|
||||
*/
|
||||
M toView(String serialModel);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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 AesEncryptor extends SymmetricCrypto {
|
||||
|
||||
/**
|
||||
* 加密后 base62 编码
|
||||
*
|
||||
* @param plain 明文
|
||||
* @return 密文
|
||||
*/
|
||||
default String encryptBase62(String plain) {
|
||||
return new String(Base62s.encode(this.encrypt(plain)));
|
||||
}
|
||||
|
||||
/**
|
||||
* base62 解码后解密
|
||||
*
|
||||
* @param text 密文
|
||||
* @return 明文
|
||||
*/
|
||||
default String decryptBase62(String text) {
|
||||
return new String(this.decrypt(Base62s.decode(text)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,26 @@
|
||||
package com.orion.visor.framework.common.file;
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
@@ -92,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;
|
||||
|
||||
/**
|
||||
* 获取文件输入流
|
||||
*
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 分布式锁
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/5/16 12:24
|
||||
*/
|
||||
public interface Locker {
|
||||
|
||||
/**
|
||||
* 尝试获取锁
|
||||
*
|
||||
* @param key key
|
||||
* @param run run
|
||||
* @return 是否获取到锁
|
||||
*/
|
||||
boolean tryLock(String key, Runnable run);
|
||||
|
||||
/**
|
||||
* 尝试获取锁
|
||||
*
|
||||
* @param key key
|
||||
* @param call call
|
||||
* @param <T> T
|
||||
* @return 执行结果
|
||||
*/
|
||||
<T> T tryLock(String key, Supplier<T> call);
|
||||
|
||||
}
|
||||
@@ -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,9 +1,31 @@
|
||||
package com.orion.visor.framework.common.json.filter;
|
||||
/*
|
||||
* 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.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;
|
||||
|
||||
@@ -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.json;
|
||||
|
||||
import cn.orionsec.kit.lang.utils.collect.Lists;
|
||||
import com.alibaba.fastjson.serializer.PropertyFilter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字段忽略过滤器
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/10/12 11:21
|
||||
*/
|
||||
public class FieldIgnoreFilter implements PropertyFilter {
|
||||
|
||||
private final List<String> ignoreFields;
|
||||
|
||||
public FieldIgnoreFilter(List<String> ignoreFields) {
|
||||
this.ignoreFields = ignoreFields;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Object object, String name, Object value) {
|
||||
return Lists.isEmpty(ignoreFields) || !ignoreFields.contains(name);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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.security;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 当前登录用户
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/7/6 18:36
|
||||
*/
|
||||
@Data
|
||||
@Schema(name = "LoginUser", description = "当前登录用户对象")
|
||||
public class LoginUser {
|
||||
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "花名")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "用户状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "头像地址")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "登录时间戳")
|
||||
private Long timestamp;
|
||||
|
||||
@Schema(description = "角色")
|
||||
private List<UserRole> roles;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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.security;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 密码修改器
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/9/21 11:35
|
||||
*/
|
||||
public class PasswordModifier {
|
||||
|
||||
private PasswordModifier() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取新密码
|
||||
*
|
||||
* @param action action
|
||||
* @return password
|
||||
*/
|
||||
public static String getEncryptNewPassword(UpdatePasswordAction action) {
|
||||
if (Booleans.isTrue(action.getUseNewPassword())) {
|
||||
// 使用新密码
|
||||
String password = action.getPassword();
|
||||
if (Strings.isBlank(password)) {
|
||||
return Const.EMPTY;
|
||||
} else {
|
||||
return AesEncryptUtils.encryptAsString(password);
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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.security;
|
||||
|
||||
/**
|
||||
* SecurityUtils 的 bean 对象
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/7/7 15:20
|
||||
*/
|
||||
public interface SecurityHolder {
|
||||
|
||||
/**
|
||||
* 获取当前用户
|
||||
*
|
||||
* @return 当前用户
|
||||
*/
|
||||
LoginUser getLoginUser();
|
||||
|
||||
/**
|
||||
* 获取当前用户id
|
||||
*
|
||||
* @return id
|
||||
*/
|
||||
Long getLoginUserId();
|
||||
|
||||
/**
|
||||
* 获取当前用户名
|
||||
*
|
||||
* @return username
|
||||
*/
|
||||
String getLoginUsername();
|
||||
|
||||
}
|
||||
@@ -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.security;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 更新密码操作
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/9/21 11:32
|
||||
*/
|
||||
public interface UpdatePasswordAction extends Serializable {
|
||||
|
||||
/**
|
||||
* 是否使用新密码
|
||||
*
|
||||
* @return use
|
||||
*/
|
||||
Boolean getUseNewPassword();
|
||||
|
||||
/**
|
||||
* 获取密码
|
||||
*
|
||||
* @return password
|
||||
*/
|
||||
String getPassword();
|
||||
|
||||
}
|
||||
@@ -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.security;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 用户角色
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/11/20 23:39
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
|
||||
@Schema(name = "UserRole", description = "用户角色")
|
||||
public class UserRole {
|
||||
|
||||
@EqualsAndHashCode.Include
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "角色")
|
||||
private String code;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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.thread;
|
||||
|
||||
import org.dromara.visor.common.utils.ThreadMdcUtils;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
/**
|
||||
* 自动注入 MDC 异步线程池
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/7/10 15:16
|
||||
*/
|
||||
public class ThreadPoolMdcTaskExecutor extends ThreadPoolTaskExecutor {
|
||||
|
||||
@Override
|
||||
public void execute(Runnable task) {
|
||||
super.execute(ThreadMdcUtils.wrap(task));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Future<T> submit(Callable<T> task) {
|
||||
return super.submit(ThreadMdcUtils.wrap(task));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Future<?> submit(Runnable task) {
|
||||
return super.submit(ThreadMdcUtils.wrap(task));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* 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.trace;
|
||||
|
||||
import cn.orionsec.kit.lang.id.UUIds;
|
||||
import com.alibaba.ttl.TransmittableThreadLocal;
|
||||
import org.slf4j.MDC;
|
||||
|
||||
/**
|
||||
* traceId 持有者
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/6/16 17:35
|
||||
*/
|
||||
public class TraceIdHolder {
|
||||
|
||||
public static final String TRACE_ID_HEADER = "trace-id";
|
||||
|
||||
public static final String TRACE_ID_MDC = "tid";
|
||||
|
||||
private TraceIdHolder() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求序列
|
||||
*/
|
||||
private static final ThreadLocal<String> HOLDER = new TransmittableThreadLocal<>();
|
||||
|
||||
/**
|
||||
* 获取 traceId
|
||||
*
|
||||
* @return traceId
|
||||
*/
|
||||
public static String get() {
|
||||
return HOLDER.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 traceId
|
||||
*/
|
||||
public static void set() {
|
||||
set(createTraceId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 traceId
|
||||
*
|
||||
* @param traceId traceId
|
||||
*/
|
||||
public static void set(String traceId) {
|
||||
// 设置应用上下文
|
||||
HOLDER.set(traceId);
|
||||
// 设置日志上下文
|
||||
setMdc(traceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除 traceId
|
||||
*/
|
||||
public static void remove() {
|
||||
// 移除应用上下文
|
||||
HOLDER.remove();
|
||||
// 移除日志上下文
|
||||
removeMdc();
|
||||
}
|
||||
|
||||
/**
|
||||
* 从应用上下文 设置到日志上下文
|
||||
*/
|
||||
public static void setMdc() {
|
||||
setMdc(HOLDER.get());
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置到日志上下文
|
||||
*
|
||||
* @param traceId traceId
|
||||
*/
|
||||
public static void setMdc(String traceId) {
|
||||
MDC.put(TRACE_ID_MDC, traceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除日志上下文
|
||||
*/
|
||||
public static void removeMdc() {
|
||||
MDC.remove(TRACE_ID_MDC);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建 traceId
|
||||
*
|
||||
* @return traceId
|
||||
*/
|
||||
public static String createTraceId() {
|
||||
return UUIds.random32();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,22 +1,42 @@
|
||||
package com.orion.visor.framework.common.utils;
|
||||
/*
|
||||
* 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 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() {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,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,6 +1,28 @@
|
||||
package com.orion.visor.framework.common.utils;
|
||||
/*
|
||||
* 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 com.orion.lang.constant.Const;
|
||||
import cn.orionsec.kit.lang.constant.Const;
|
||||
|
||||
import java.util.Arrays;
|
||||
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.utils;
|
||||
|
||||
import cn.orionsec.kit.lang.utils.time.Dates;
|
||||
import org.dromara.visor.common.constant.Const;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/8/31 17:57
|
||||
*/
|
||||
public class FileNames {
|
||||
|
||||
private FileNames() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出文件名称
|
||||
*
|
||||
* @param title title
|
||||
* @return name
|
||||
*/
|
||||
public static String exportName(String title) {
|
||||
return title + "-" + Dates.current(Dates.YMD_HMS2) + "." + Const.SUFFIX_XLSX;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* 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.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;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* ip 工具类
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/7/14 16:26
|
||||
*/
|
||||
public class IpUtils {
|
||||
|
||||
private static final Map<String, String> CACHE = new HashMap<>();
|
||||
|
||||
private IpUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取请求地址
|
||||
*
|
||||
* @param request request
|
||||
* @return addr
|
||||
*/
|
||||
public static String getRemoteAddr(HttpServletRequest request) {
|
||||
// 获取实际地址 X_REAL_IP 在多代理情况下会有问题
|
||||
// String realIp = request.getHeader(StandardHttpHeader.X_REAL_IP);
|
||||
// if (!Strings.isBlank(realIp)) {
|
||||
// return realIp;
|
||||
// }
|
||||
// 获取请求地址
|
||||
return Servlets.getRemoteAddr(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 ip 位置
|
||||
*
|
||||
* @param ip ip
|
||||
* @return ip 位置
|
||||
*/
|
||||
public static String getLocation(String ip) {
|
||||
if (ip == null) {
|
||||
return Const.CN_UNKNOWN;
|
||||
}
|
||||
// 查询缓存
|
||||
return CACHE.computeIfAbsent(ip, IpUtils::queryLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询 ip 位置
|
||||
*
|
||||
* @param ip ip
|
||||
* @return ip 位置
|
||||
*/
|
||||
private static String queryLocation(String ip) {
|
||||
if (ip == null) {
|
||||
return Const.CN_UNKNOWN;
|
||||
}
|
||||
Region region;
|
||||
try {
|
||||
region = LocationRegions.getRegion(ip, 3);
|
||||
} catch (Exception e) {
|
||||
return Const.CN_UNKNOWN;
|
||||
}
|
||||
if (region != null) {
|
||||
String net = region.getNet();
|
||||
String province = region.getProvince();
|
||||
if (net.equals(Const.CN_INTRANET_IP)) {
|
||||
return net;
|
||||
}
|
||||
if (province.equals(Const.CN_UNKNOWN)) {
|
||||
return province;
|
||||
}
|
||||
StringBuilder location = new StringBuilder()
|
||||
.append(region.getCountry())
|
||||
.append(Const.DASHED)
|
||||
.append(province)
|
||||
.append(Const.DASHED)
|
||||
.append(region.getCity());
|
||||
location.append(" (").append(net).append(')');
|
||||
return location.toString();
|
||||
}
|
||||
return Const.CN_UNKNOWN;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,8 +1,30 @@
|
||||
package com.orion.visor.framework.common.utils;
|
||||
/*
|
||||
* 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 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;
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* 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.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;
|
||||
|
||||
/**
|
||||
* 路径工具类
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/4/17 10:28
|
||||
*/
|
||||
public class PathUtils {
|
||||
|
||||
private PathUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户根目录
|
||||
*
|
||||
* @param isWindows isWindows
|
||||
* @param username 用户名
|
||||
* @return 用户目录
|
||||
*/
|
||||
public static String getHomePath(boolean isWindows, String username) {
|
||||
return getHomePath(isWindows, username, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户根目录
|
||||
*
|
||||
* @param isWindows isWindows
|
||||
* @param username 用户名
|
||||
* @param prependSeparator 是否在头部添加分隔符
|
||||
* @return 用户目录
|
||||
*/
|
||||
public static String getHomePath(boolean isWindows, String username, boolean prependSeparator) {
|
||||
if (isWindows) {
|
||||
// windows
|
||||
if (prependSeparator) {
|
||||
return "/C:/Users/" + username;
|
||||
} else {
|
||||
return "C:/Users/" + username;
|
||||
}
|
||||
} else {
|
||||
// linux
|
||||
if (Const.ROOT.equals(username)) {
|
||||
return "/" + Const.ROOT;
|
||||
} else {
|
||||
return "/home/" + username;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取应用路径
|
||||
*
|
||||
* @param isWindows isWindows
|
||||
* @param username username
|
||||
* @return path
|
||||
*/
|
||||
public static String getAppPath(boolean isWindows, String username) {
|
||||
return getHomePath(isWindows, username)
|
||||
+ "/" + AppConst.ORION
|
||||
+ "/" + AppConst.APP_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建应用路径
|
||||
*
|
||||
* @param isWindows isWindows,
|
||||
* @param username username
|
||||
* @param paths paths
|
||||
* @return path
|
||||
*/
|
||||
public static String buildAppPath(boolean isWindows, String username, Object... paths) {
|
||||
StringBuilder path = new StringBuilder(getAppPath(isWindows, username));
|
||||
for (Object o : paths) {
|
||||
path.append("/").append(Objects1.toString(o));
|
||||
}
|
||||
return path.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 头部添加分隔符
|
||||
*
|
||||
* @param path path
|
||||
* @return path
|
||||
*/
|
||||
public static String prependSeparator(String path) {
|
||||
if (path.startsWith("/")) {
|
||||
return path;
|
||||
}
|
||||
return "/" + path;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 orion path
|
||||
*
|
||||
* @param path path
|
||||
* @return path
|
||||
*/
|
||||
public static String getOrionPath(String path) {
|
||||
path = Systems.HOME_DIR
|
||||
+ Files1.SEPARATOR
|
||||
+ AppConst.ORION
|
||||
+ Files1.SEPARATOR
|
||||
+ AppConst.APP_NAME
|
||||
+ Files1.SEPARATOR
|
||||
+ path;
|
||||
return Files1.getPath(path);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,8 +1,30 @@
|
||||
package com.orion.visor.framework.common.utils;
|
||||
/*
|
||||
* 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 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;
|
||||
|
||||
@@ -41,7 +63,7 @@ public class Requests {
|
||||
.map(s -> (ServletRequestAttributes) s)
|
||||
.map(ServletRequestAttributes::getRequest)
|
||||
.ifPresent(request -> {
|
||||
String address = Servlets.getRemoteAddr(request);
|
||||
String address = IpUtils.getRemoteAddr(request);
|
||||
identity.setAddress(address);
|
||||
identity.setLocation(IpUtils.getLocation(address));
|
||||
identity.setUserAgent(Servlets.getUserAgent(request));
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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 org.dromara.visor.common.constant.Const;
|
||||
|
||||
/**
|
||||
* sql 工具类
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2024/8/26 16:03
|
||||
*/
|
||||
public class SqlUtils {
|
||||
|
||||
private SqlUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* limit n
|
||||
*
|
||||
* @param limit limit
|
||||
* @return limit
|
||||
*/
|
||||
public static String limit(Number limit) {
|
||||
return Const.LIMIT + Const.SPACE + limit;
|
||||
}
|
||||
|
||||
/**
|
||||
* limit offset limit
|
||||
*
|
||||
* @param offset offset
|
||||
* @param limit limit
|
||||
* @return limit
|
||||
*/
|
||||
public static String limit(Number offset, Number limit) {
|
||||
return Const.LIMIT + Const.SPACE + offset + Const.COMMA + limit;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +1,31 @@
|
||||
package com.orion.visor.framework.common.utils;
|
||||
/*
|
||||
* 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 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,6 +1,28 @@
|
||||
package com.orion.visor.framework.common.utils;
|
||||
/*
|
||||
* 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 com.orion.visor.framework.common.meta.TraceIdHolder;
|
||||
import org.dromara.visor.common.trace.TraceIdHolder;
|
||||
import org.slf4j.MDC;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -1,8 +1,30 @@
|
||||
package com.orion.visor.framework.common.utils;
|
||||
/*
|
||||
* 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 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,14 +1,37 @@
|
||||
package com.orion.visor.framework.common.utils;
|
||||
/*
|
||||
* 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 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;
|
||||
import javax.validation.Validator;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
@@ -19,18 +42,26 @@ 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);
|
||||
}
|
||||
|
||||
public static <T> T isNull(T object) {
|
||||
return isNull(object, ErrorMessage.PARAM_ERROR);
|
||||
}
|
||||
|
||||
public static String notBlank(String s) {
|
||||
return notBlank(s, ErrorMessage.PARAM_MISSING);
|
||||
}
|
||||
|
||||
public static <T extends Map<?, ?>> T notEmpty(T map) {
|
||||
return notEmpty(map, ErrorMessage.PARAM_MISSING);
|
||||
}
|
||||
|
||||
public static <T extends Collection<?>> T notEmpty(T object) {
|
||||
return notEmpty(object, ErrorMessage.PARAM_MISSING);
|
||||
}
|
||||
@@ -99,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);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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.validator.group;
|
||||
|
||||
/**
|
||||
* 批量验证分组
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/9/1 19:13
|
||||
*/
|
||||
public interface Batch {
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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.validator.group;
|
||||
|
||||
/**
|
||||
* 清理验证分组
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/9/1 19:13
|
||||
*/
|
||||
public interface Clear {
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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.validator.group;
|
||||
|
||||
/**
|
||||
* 导出验证分组
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/9/1 19:13
|
||||
*/
|
||||
public interface Export {
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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.validator.group;
|
||||
|
||||
/**
|
||||
* 分页验证分组
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/9/1 19:13
|
||||
*/
|
||||
public interface Id {
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user