Compare commits
57 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f79d89def9 | ||
|
|
fd535f00c8 | ||
|
|
2c07551b88 | ||
|
|
86914321a6 | ||
|
|
f64c15a01b | ||
|
|
8265cc3cfd | ||
|
|
84c8bc98af | ||
|
|
858ca1becc | ||
|
|
0e0c9cc628 | ||
|
|
cdc3c88507 | ||
|
|
10624b42c4 | ||
|
|
6479694b4b | ||
|
|
d2e72aea56 | ||
|
|
986f0974db | ||
|
|
6b5c7fd409 | ||
|
|
ca803e4e5a | ||
|
|
5de22e4b41 | ||
|
|
b8e81ee100 | ||
|
|
0b53924dbd | ||
|
|
3359d163fb | ||
|
|
2ef1517338 | ||
|
|
a5bee66afa | ||
|
|
88fd0e31e0 | ||
|
|
226dfb2c25 | ||
|
|
94ed071897 | ||
|
|
4efd2b5ec2 | ||
|
|
76e766367f | ||
|
|
b3009bb65e | ||
|
|
819520ef73 | ||
|
|
a2acbc0c3a | ||
|
|
2e8a7c40d9 | ||
|
|
94c0b6a785 | ||
|
|
9752dfa680 | ||
|
|
bc776e4186 | ||
|
|
cdce5a0dc1 | ||
|
|
0db732fc19 | ||
|
|
69f331c048 | ||
|
|
032f1763f6 | ||
|
|
d071ef64d8 | ||
|
|
c820443a3b | ||
|
|
14c4e77445 | ||
|
|
79d9f69ed4 | ||
|
|
6c9065072d | ||
|
|
05bc6c1fbb | ||
|
|
a1dd9eec01 | ||
|
|
660df7c110 | ||
|
|
093501a400 | ||
|
|
7943deb924 | ||
|
|
490167e649 | ||
|
|
8635f6bb05 | ||
|
|
9e31d820e0 | ||
|
|
92353d859a | ||
|
|
bef8d69e59 | ||
|
|
ac46dd6703 | ||
|
|
b3ab78e063 | ||
|
|
95d2c6cb65 | ||
|
|
7017c7502b |
@@ -1,6 +1,9 @@
|
|||||||
SERVICE_PORT=1081
|
|
||||||
VOLUME_BASE=/data/orion-visor-space/docker-volumes
|
VOLUME_BASE=/data/orion-visor-space/docker-volumes
|
||||||
|
|
||||||
|
SERVICE_PORT=1081
|
||||||
|
SPRING_PROFILES_ACTIVE=prod
|
||||||
|
SECRET_KEY=uQeacXV8b3isvKLK
|
||||||
|
|
||||||
MYSQL_HOST=mysql
|
MYSQL_HOST=mysql
|
||||||
MYSQL_PORT=3306
|
MYSQL_PORT=3306
|
||||||
MYSQL_DATABASE=orion_visor
|
MYSQL_DATABASE=orion_visor
|
||||||
@@ -11,5 +14,4 @@ MYSQL_ROOT_PASSWORD=Data@123456
|
|||||||
REDIS_HOST=redis
|
REDIS_HOST=redis
|
||||||
REDIS_PASSWORD=Data@123456
|
REDIS_PASSWORD=Data@123456
|
||||||
|
|
||||||
SECRET_KEY=uQeacXV8b3isvKLK
|
|
||||||
DEMO_MODE=false
|
DEMO_MODE=false
|
||||||
|
|||||||
@@ -64,6 +64,7 @@
|
|||||||
* 🎭 演示环境部分功能不可用, 完整功能请本地部署!
|
* 🎭 演示环境部分功能不可用, 完整功能请本地部署!
|
||||||
* 📛 演示环境请不要随便删除数据!
|
* 📛 演示环境请不要随便删除数据!
|
||||||
* 📧 如果演示环境不可用请联系我!
|
* 📧 如果演示环境不可用请联系我!
|
||||||
|
* 📨 **作者已被毕(cai)业(yuan) 寻java高级内推 望京/5号/10号线 有坑位的联系我哦** 微信: `ljh1553488`
|
||||||
|
|
||||||
## 快速开始
|
## 快速开始
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
version: '3.3'
|
version: '3.3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
service:
|
service:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:latest
|
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:latest
|
||||||
privileged: true
|
privileged: true
|
||||||
ports:
|
ports:
|
||||||
- 1081:80
|
- 9200:9200
|
||||||
environment:
|
environment:
|
||||||
|
- SPRING_PROFILES_ACTIVE=prod
|
||||||
- MYSQL_HOST=mysql
|
- MYSQL_HOST=mysql
|
||||||
- MYSQL_PORT=3306
|
- MYSQL_PORT=3306
|
||||||
- MYSQL_DATABASE=orion_visor
|
- MYSQL_DATABASE=orion_visor
|
||||||
@@ -19,18 +21,18 @@ services:
|
|||||||
- /data/orion-visor-space/docker-volumes/service/root-orion:/root/orion
|
- /data/orion-visor-space/docker-volumes/service/root-orion:/root/orion
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "curl", "http://127.0.0.1:9200/orion-visor/api/server/bootstrap/health" ]
|
test: [ "CMD", "curl", "http://127.0.0.1:9200/orion-visor/api/server/bootstrap/health" ]
|
||||||
interval: 3s
|
interval: 15s
|
||||||
timeout: 300s
|
timeout: 5s
|
||||||
retries: 200
|
retries: 10
|
||||||
start_period: 3s
|
start_period: 15s
|
||||||
depends_on:
|
depends_on:
|
||||||
mysql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
redis:
|
redis:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
links:
|
networks:
|
||||||
- mysql
|
- orion-visor-net
|
||||||
- redis
|
|
||||||
mysql:
|
mysql:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:latest
|
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:latest
|
||||||
privileged: true
|
privileged: true
|
||||||
@@ -44,13 +46,15 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- /data/orion-visor-space/docker-volumes/mysql/var-lib-mysql:/var/lib/mysql
|
- /data/orion-visor-space/docker-volumes/mysql/var-lib-mysql:/var/lib/mysql
|
||||||
- /data/orion-visor-space/docker-volumes/mysql/var-lib-mysql-files:/var/lib/mysql-files
|
- /data/orion-visor-space/docker-volumes/mysql/var-lib-mysql-files:/var/lib/mysql-files
|
||||||
- /data/orion-visor-space/docker-volumes/mysql/etc-mysql:/etc/mysql
|
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/3306" ]
|
test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/3306" ]
|
||||||
interval: 3s
|
interval: 15s
|
||||||
timeout: 60s
|
timeout: 5s
|
||||||
retries: 10
|
retries: 10
|
||||||
start_period: 3s
|
start_period: 5s
|
||||||
|
networks:
|
||||||
|
- orion-visor-net
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:latest
|
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:latest
|
||||||
privileged: true
|
privileged: true
|
||||||
@@ -63,17 +67,24 @@ services:
|
|||||||
command: sh -c "redis-server /usr/local/redis.conf --requirepass $${REDIS_PASSWORD}"
|
command: sh -c "redis-server /usr/local/redis.conf --requirepass $${REDIS_PASSWORD}"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
||||||
interval: 3s
|
interval: 15s
|
||||||
timeout: 60s
|
timeout: 5s
|
||||||
retries: 10
|
retries: 10
|
||||||
start_period: 3s
|
start_period: 5s
|
||||||
|
networks:
|
||||||
|
- orion-visor-net
|
||||||
|
|
||||||
testing:
|
testing:
|
||||||
build:
|
build:
|
||||||
context: ./docker/e2e
|
context: ./docker/e2e
|
||||||
environment:
|
environment:
|
||||||
SERVER: http://service:80
|
SERVER: http://service:9200
|
||||||
depends_on:
|
depends_on:
|
||||||
service:
|
service:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
links:
|
networks:
|
||||||
- service
|
- orion-visor-net
|
||||||
|
|
||||||
|
networks:
|
||||||
|
orion-visor-net:
|
||||||
|
driver: bridge
|
||||||
@@ -1,11 +1,24 @@
|
|||||||
version: '3.3'
|
version: '3.3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
ui:
|
||||||
|
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-ui:latest
|
||||||
|
ports:
|
||||||
|
- ${SERVICE_PORT:-1081}:80
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
service:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- orion-visor-net
|
||||||
|
|
||||||
service:
|
service:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:latest
|
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:latest
|
||||||
privileged: true
|
privileged: true
|
||||||
ports:
|
ports:
|
||||||
- ${SERVICE_PORT:-1081}:80
|
- 9200:9200
|
||||||
environment:
|
environment:
|
||||||
|
- SPRING_PROFILES_ACTIVE=${SPRING_PROFILES_ACTIVE:-prod}
|
||||||
- MYSQL_HOST=${MYSQL_HOST:-mysql}
|
- MYSQL_HOST=${MYSQL_HOST:-mysql}
|
||||||
- MYSQL_PORT=${MYSQL_PORT:-3306}
|
- MYSQL_PORT=${MYSQL_PORT:-3306}
|
||||||
- MYSQL_DATABASE=${MYSQL_DATABASE:-orion_visor}
|
- MYSQL_DATABASE=${MYSQL_DATABASE:-orion_visor}
|
||||||
@@ -17,20 +30,21 @@ services:
|
|||||||
- DEMO_MODE=${DEMO_MODE:-false}
|
- DEMO_MODE=${DEMO_MODE:-false}
|
||||||
volumes:
|
volumes:
|
||||||
- ${VOLUME_BASE:-/data/orion-visor-space/docker-volumes}/service/root-orion:/root/orion
|
- ${VOLUME_BASE:-/data/orion-visor-space/docker-volumes}/service/root-orion:/root/orion
|
||||||
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "curl", "http://127.0.0.1:9200/orion-visor/api/server/bootstrap/health" ]
|
test: [ "CMD", "curl", "http://127.0.0.1:9200/orion-visor/api/server/bootstrap/health" ]
|
||||||
interval: 15s
|
interval: 15s
|
||||||
timeout: 300s
|
timeout: 5s
|
||||||
retries: 15
|
retries: 15
|
||||||
start_period: 3s
|
start_period: 30s
|
||||||
depends_on:
|
depends_on:
|
||||||
mysql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
redis:
|
redis:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
links:
|
networks:
|
||||||
- mysql
|
- orion-visor-net
|
||||||
- redis
|
|
||||||
mysql:
|
mysql:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:latest
|
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:latest
|
||||||
privileged: true
|
privileged: true
|
||||||
@@ -44,13 +58,16 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ${VOLUME_BASE:-/data/orion-visor-space/docker-volumes}/mysql/var-lib-mysql:/var/lib/mysql
|
- ${VOLUME_BASE:-/data/orion-visor-space/docker-volumes}/mysql/var-lib-mysql:/var/lib/mysql
|
||||||
- ${VOLUME_BASE:-/data/orion-visor-space/docker-volumes}/mysql/var-lib-mysql-files:/var/lib/mysql-files
|
- ${VOLUME_BASE:-/data/orion-visor-space/docker-volumes}/mysql/var-lib-mysql-files:/var/lib/mysql-files
|
||||||
- ${VOLUME_BASE:-/data/orion-visor-space/docker-volumes}/mysql/etc-mysql:/etc/mysql
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/3306" ]
|
test: [ "CMD", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/3306" ]
|
||||||
interval: 15s
|
interval: 15s
|
||||||
timeout: 60s
|
timeout: 5s
|
||||||
retries: 15
|
retries: 10
|
||||||
start_period: 3s
|
start_period: 10s
|
||||||
|
networks:
|
||||||
|
- orion-visor-net
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:latest
|
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:latest
|
||||||
privileged: true
|
privileged: true
|
||||||
@@ -61,18 +78,28 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ${VOLUME_BASE:-/data/orion-visor-space/docker-volumes}/redis/data:/data
|
- ${VOLUME_BASE:-/data/orion-visor-space/docker-volumes}/redis/data:/data
|
||||||
command: sh -c "redis-server /usr/local/redis.conf --requirepass $${REDIS_PASSWORD}"
|
command: sh -c "redis-server /usr/local/redis.conf --requirepass $${REDIS_PASSWORD}"
|
||||||
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
||||||
interval: 15s
|
interval: 15s
|
||||||
timeout: 60s
|
timeout: 5s
|
||||||
retries: 15
|
retries: 10
|
||||||
start_period: 3s
|
start_period: 10s
|
||||||
|
networks:
|
||||||
|
- orion-visor-net
|
||||||
|
|
||||||
adminer:
|
adminer:
|
||||||
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:latest
|
image: registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:latest
|
||||||
ports:
|
ports:
|
||||||
- 8081:8080
|
- 8081:8080
|
||||||
|
environment:
|
||||||
|
- ADMINER_DEFAULT_SERVER=${MYSQL_HOST:-mysql}
|
||||||
depends_on:
|
depends_on:
|
||||||
mysql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
links:
|
networks:
|
||||||
- mysql
|
- orion-visor-net
|
||||||
|
|
||||||
|
networks:
|
||||||
|
orion-visor-net:
|
||||||
|
driver: bridge
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#/bin/bash
|
#/bin/bash
|
||||||
version=2.3.3
|
set -e
|
||||||
|
version=2.3.8
|
||||||
docker build -t orion-visor-adminer:${version} .
|
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:${version}
|
||||||
docker tag orion-visor-adminer:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:latest
|
docker tag orion-visor-adminer:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:latest
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# yaml-language-server: $schema=https://linuxsuren.github.io/api-testing/api-testing-schema.json
|
# yaml-language-server: $schema=https://linuxsuren.github.io/api-testing/api-testing-schema.json
|
||||||
name: orion-visor
|
name: orion-visor
|
||||||
api: |
|
api: |
|
||||||
{{default "http://orion-visor-service:80" (env "SERVER")}}
|
{{default "http://service:9200" (env "SERVER")}}
|
||||||
items:
|
items:
|
||||||
- name: login
|
- name: login
|
||||||
request:
|
request:
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#/bin/bash
|
#/bin/bash
|
||||||
version=2.3.3
|
set -e
|
||||||
|
version=2.3.8
|
||||||
cp -r ../../sql ./sql
|
cp -r ../../sql ./sql
|
||||||
docker build -t orion-visor-mysql:${version} .
|
docker build -t orion-visor-mysql:${version} .
|
||||||
rm -rf ./sql
|
rm -rf ./sql
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ socket=/var/run/mysqld/mysqld.sock
|
|||||||
# 数据目录
|
# 数据目录
|
||||||
datadir=/var/lib/mysql
|
datadir=/var/lib/mysql
|
||||||
# 不区分大小 0区分 1不区分
|
# 不区分大小 0区分 1不区分
|
||||||
lower_case_table_names=1
|
lower_case_table_names=0
|
||||||
# 服务器时区
|
# 服务器时区
|
||||||
default-time_zone='+8:00'
|
default-time_zone='+8:00'
|
||||||
# 服务端字符集
|
# 服务端字符集
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
#/bin/bash
|
#/bin/bash
|
||||||
version=2.3.3
|
set -e
|
||||||
|
version=2.3.8
|
||||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:${version}
|
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-adminer:${version}
|
||||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql:${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-redis:${version}
|
||||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:${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-adminer:latest
|
||||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-mysql: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-redis:latest
|
||||||
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:latest
|
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:latest
|
||||||
|
docker push registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-ui:latest
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#/bin/bash
|
#/bin/bash
|
||||||
version=2.3.3
|
set -e
|
||||||
|
version=2.3.8
|
||||||
docker build -t orion-visor-redis:${version} .
|
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:${version}
|
||||||
docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:latest
|
docker tag orion-visor-redis:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-redis:latest
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM nginx:alpine
|
FROM openjdk:8-jdk-alpine
|
||||||
USER root
|
USER root
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
# 系统时区
|
# 系统时区
|
||||||
@@ -7,18 +7,14 @@ ARG TZ=Asia/Shanghai
|
|||||||
RUN \
|
RUN \
|
||||||
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
|
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
|
||||||
apk update && \
|
apk update && \
|
||||||
|
apk add curl && \
|
||||||
|
apk add udev && \
|
||||||
apk add tzdata && \
|
apk add tzdata && \
|
||||||
apk add dmidecode && \
|
apk add dmidecode
|
||||||
apk add openjdk8
|
|
||||||
# 设置时区
|
# 设置时区
|
||||||
RUN ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
|
RUN ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
|
||||||
echo '${TZ}' > /etc/timezone
|
echo '${TZ}' > /etc/timezone
|
||||||
# 删除原 nginx 配置
|
|
||||||
RUN rm -rf /etc/nginx/conf.d/*
|
|
||||||
# 复制包
|
# 复制包
|
||||||
COPY ./orion-visor-launch.jar /app/app.jar
|
COPY ./orion-visor-launch.jar /app/app.jar
|
||||||
COPY ./dist /usr/share/nginx/html
|
|
||||||
COPY ./entrypoint.sh /app/entrypoint.sh
|
|
||||||
COPY ./nginx.conf /etc/nginx/conf.d
|
|
||||||
# 启动
|
# 启动
|
||||||
ENTRYPOINT [ "sh", "/app/entrypoint.sh" ]
|
CMD ["java", "-jar", "/app/app.jar"]
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
#/bin/bash
|
#/bin/bash
|
||||||
version=2.3.3
|
set -e
|
||||||
|
version=2.3.8
|
||||||
mv ../../orion-visor-launch/target/orion-visor-launch.jar ./orion-visor-launch.jar
|
mv ../../orion-visor-launch/target/orion-visor-launch.jar ./orion-visor-launch.jar
|
||||||
mv ../../orion-visor-ui/dist ./dist
|
|
||||||
docker build -t orion-visor-service:${version} .
|
docker build -t orion-visor-service:${version} .
|
||||||
rm -rf ./orion-visor-launch.jar
|
rm -rf ./orion-visor-launch.jar
|
||||||
rm -rf ./dist
|
|
||||||
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:${version}
|
||||||
docker tag orion-visor-service:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:latest
|
docker tag orion-visor-service:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-service:latest
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
cd /app
|
|
||||||
nohup java -jar app.jar --spring.profiles.active=prod 2>&1 &
|
|
||||||
nginx -g 'daemon off;'
|
|
||||||
18
docker/ui/Dockerfile
Normal file
18
docker/ui/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
FROM nginx:alpine
|
||||||
|
# 系统时区
|
||||||
|
ARG TZ=Asia/Shanghai
|
||||||
|
# 添加包
|
||||||
|
RUN \
|
||||||
|
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
|
||||||
|
apk update && \
|
||||||
|
apk add tzdata
|
||||||
|
# 设置时区
|
||||||
|
RUN ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
|
||||||
|
echo '${TZ}' > /etc/timezone
|
||||||
|
# 删除原 nginx 配置
|
||||||
|
RUN rm -rf /etc/nginx/conf.d/*
|
||||||
|
# 复制包
|
||||||
|
COPY ./dist /usr/share/nginx/html
|
||||||
|
COPY ./nginx.conf /etc/nginx/conf.d
|
||||||
|
# 启动
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
9
docker/ui/build.sh
Normal file
9
docker/ui/build.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#/bin/bash
|
||||||
|
set -e
|
||||||
|
version=2.3.8
|
||||||
|
mv ../../orion-visor-ui/dist ./dist
|
||||||
|
docker build -t orion-visor-ui:${version} .
|
||||||
|
rm -rf ./orion-visor-launch.jar
|
||||||
|
rm -rf ./dist
|
||||||
|
docker tag orion-visor-ui:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-ui:${version}
|
||||||
|
docker tag orion-visor-ui:${version} registry.cn-hangzhou.aliyuncs.com/orionsec/orion-visor-ui:latest
|
||||||
@@ -19,7 +19,7 @@ server {
|
|||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
proxy_set_header Host $host;
|
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-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
# web history 模式 404
|
# web history 模式 404
|
||||||
@@ -27,7 +27,7 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
location /orion-visor/api {
|
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 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-For $proxy_add_x_forwarded_for;
|
||||||
@@ -35,7 +35,7 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
location /orion-visor/keep-alive {
|
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_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
@@ -20,21 +20,21 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.dromara.visor.launch.configuration;
|
package org.dromara.visor.common.configuration;
|
||||||
|
|
||||||
import cn.orionsec.kit.spring.SpringHolder;
|
import cn.orionsec.kit.spring.SpringHolder;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应用配置类
|
* spring 配置类
|
||||||
*
|
*
|
||||||
* @author Jiahang Li
|
* @author Jiahang Li
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @since 2023/6/20 10:34
|
* @since 2023/6/20 10:34
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class LaunchApplicationConfiguration {
|
public class SpringConfiguration {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return spring 容器工具类
|
* @return spring 容器工具类
|
||||||
@@ -36,7 +36,7 @@ public interface AppConst extends OrionConst {
|
|||||||
/**
|
/**
|
||||||
* 同 ${orion.version} 迭代时候需要手动更改
|
* 同 ${orion.version} 迭代时候需要手动更改
|
||||||
*/
|
*/
|
||||||
String VERSION = "2.3.3";
|
String VERSION = "2.3.8";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同 ${spring.application.name}
|
* 同 ${spring.application.name}
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ public interface ErrorMessage {
|
|||||||
|
|
||||||
String HOST_NOT_ENABLED = "主机未启用";
|
String HOST_NOT_ENABLED = "主机未启用";
|
||||||
|
|
||||||
|
String CONFIG_NOT_ENABLED = "配置未启用";
|
||||||
|
|
||||||
String UNABLE_OPERATE_ADMIN_ROLE = "无法操作管理员账号";
|
String UNABLE_OPERATE_ADMIN_ROLE = "无法操作管理员账号";
|
||||||
|
|
||||||
String UNSUPPORTED_CHARSET = "不支持的编码 [{}]";
|
String UNSUPPORTED_CHARSET = "不支持的编码 [{}]";
|
||||||
|
|||||||
@@ -31,15 +31,15 @@ import javax.validation.constraints.Min;
|
|||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公共页码请求
|
* 基本查询请求
|
||||||
*
|
*
|
||||||
* @author Jiahang Li
|
* @author Jiahang Li
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @since 2023/7/12 23:14
|
* @since 2023/7/12 23:14
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Schema(name = "PageRequest", description = "公共页码请求")
|
@Schema(name = "BaseQueryRequest", description = "基本查询请求")
|
||||||
public class PageRequest {
|
public class BaseQueryRequest implements IPageRequest, IOrderRequest {
|
||||||
|
|
||||||
@NotNull(groups = Page.class)
|
@NotNull(groups = Page.class)
|
||||||
@Min(value = 1, groups = Page.class)
|
@Min(value = 1, groups = Page.class)
|
||||||
@@ -53,4 +53,7 @@ public class PageRequest {
|
|||||||
@Schema(description = "大小")
|
@Schema(description = "大小")
|
||||||
private Integer limit;
|
private Integer limit;
|
||||||
|
|
||||||
|
@Schema(description = "查询排序")
|
||||||
|
private Integer order;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||||
|
*
|
||||||
|
* https://visor.dromara.org
|
||||||
|
* https://visor.dromara.org.cn
|
||||||
|
* https://visor.orionsec.cn
|
||||||
|
*
|
||||||
|
* Members:
|
||||||
|
* Jiahang Li - ljh1553488six@139.com - author
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.dromara.visor.common.mapstruct;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* json 转换器
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2025/3/7 17:43
|
||||||
|
*/
|
||||||
|
public class JsonConversion {
|
||||||
|
|
||||||
|
private JsonConversion() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JSONString > JSONObject
|
||||||
|
*
|
||||||
|
* @param json json
|
||||||
|
* @return JSONObject
|
||||||
|
*/
|
||||||
|
public static JSONObject stringToJsonObject(String json) {
|
||||||
|
return json != null ? JSON.parseObject(json) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JSONString > JSONArray.
|
||||||
|
*
|
||||||
|
* @param json json
|
||||||
|
* @return JSONArray
|
||||||
|
*/
|
||||||
|
public static JSONArray stringToJsonArray(String json) {
|
||||||
|
return json != null ? JSON.parseArray(json) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JSONObject > JSONString.
|
||||||
|
*
|
||||||
|
* @param jsonObject JSONObject
|
||||||
|
* @return JSONString
|
||||||
|
*/
|
||||||
|
public static String jsonObjectToString(JSONObject jsonObject) {
|
||||||
|
return jsonObject != null ? jsonObject.toJSONString() : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JSONArray > JSONString.
|
||||||
|
*
|
||||||
|
* @param jsonArray JSONArray
|
||||||
|
* @return JSONString
|
||||||
|
*/
|
||||||
|
public static String jsonArrayToString(JSONArray jsonArray) {
|
||||||
|
return jsonArray != null ? jsonArray.toJSONString() : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||||
|
*
|
||||||
|
* https://visor.dromara.org
|
||||||
|
* https://visor.dromara.org.cn
|
||||||
|
* https://visor.orionsec.cn
|
||||||
|
*
|
||||||
|
* Members:
|
||||||
|
* Jiahang Li - ljh1553488six@139.com - author
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.dromara.visor.common.mapstruct;
|
||||||
|
|
||||||
|
import cn.orionsec.kit.lang.utils.Strings;
|
||||||
|
import cn.orionsec.kit.lang.utils.collect.Lists;
|
||||||
|
import org.dromara.visor.common.constant.Const;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* string 转换器
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2025/3/7 17:35
|
||||||
|
*/
|
||||||
|
public class StringConversion {
|
||||||
|
|
||||||
|
private StringConversion() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* String > List<Integer>
|
||||||
|
*
|
||||||
|
* @param str str
|
||||||
|
* @return list
|
||||||
|
*/
|
||||||
|
public static List<Integer> stringToIntegerList(String str) {
|
||||||
|
if (Strings.isBlank(str)) {
|
||||||
|
return Lists.newList();
|
||||||
|
}
|
||||||
|
return Arrays.stream(str.split(Const.COMMA))
|
||||||
|
.map(Integer::valueOf)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* String > List<String>
|
||||||
|
*
|
||||||
|
* @param str str
|
||||||
|
* @return list
|
||||||
|
*/
|
||||||
|
public static List<Long> stringToLongList(String str) {
|
||||||
|
if (Strings.isBlank(str)) {
|
||||||
|
return Lists.newList();
|
||||||
|
}
|
||||||
|
return Arrays.stream(str.split(Const.COMMA))
|
||||||
|
.map(Long::valueOf)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* String > List<String>
|
||||||
|
*
|
||||||
|
* @param str str
|
||||||
|
* @return list
|
||||||
|
*/
|
||||||
|
public static List<String> stringToStringList(String str) {
|
||||||
|
if (Strings.isBlank(str)) {
|
||||||
|
return Lists.newList();
|
||||||
|
}
|
||||||
|
return Lists.of(str.split(Const.COMMA));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List<Integer> String
|
||||||
|
*
|
||||||
|
* @param list list
|
||||||
|
* @return str
|
||||||
|
*/
|
||||||
|
public static String integerListToString(List<Integer> list) {
|
||||||
|
if (list != null) {
|
||||||
|
return list.stream()
|
||||||
|
.map(String::valueOf)
|
||||||
|
.collect(Collectors.joining(Const.COMMA));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List<Long> String
|
||||||
|
*
|
||||||
|
* @param list list
|
||||||
|
* @return str
|
||||||
|
*/
|
||||||
|
public static String longListToString(List<Long> list) {
|
||||||
|
if (list != null) {
|
||||||
|
return list.stream()
|
||||||
|
.map(String::valueOf)
|
||||||
|
.collect(Collectors.joining(Const.COMMA));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List<String> String
|
||||||
|
*
|
||||||
|
* @param list list
|
||||||
|
* @return str
|
||||||
|
*/
|
||||||
|
public static String stringListToString(List<String> list) {
|
||||||
|
return list != null ? String.join(Const.COMMA, list) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -45,4 +45,11 @@ public interface SecurityHolder {
|
|||||||
*/
|
*/
|
||||||
Long getLoginUserId();
|
Long getLoginUserId();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前用户名
|
||||||
|
*
|
||||||
|
* @return username
|
||||||
|
*/
|
||||||
|
String getLoginUsername();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,4 +47,11 @@ public interface UpdatePasswordAction extends Serializable {
|
|||||||
*/
|
*/
|
||||||
String getPassword();
|
String getPassword();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置密码
|
||||||
|
*
|
||||||
|
* @param password password
|
||||||
|
*/
|
||||||
|
void setPassword(String password);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<url>https://github.com/dromara/orion-visor</url>
|
<url>https://github.com/dromara/orion-visor</url>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<revision>2.3.3</revision>
|
<revision>2.3.8</revision>
|
||||||
<spring.boot.version>2.7.17</spring.boot.version>
|
<spring.boot.version>2.7.17</spring.boot.version>
|
||||||
<spring.boot.admin.version>2.7.15</spring.boot.admin.version>
|
<spring.boot.admin.version>2.7.15</spring.boot.admin.version>
|
||||||
<flatten.maven.plugin.version>1.5.0</flatten.maven.plugin.version>
|
<flatten.maven.plugin.version>1.5.0</flatten.maven.plugin.version>
|
||||||
|
|||||||
@@ -22,11 +22,12 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.framework.mybatis.core.domain;
|
package org.dromara.visor.framework.mybatis.core.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.apache.ibatis.type.JdbcType;
|
import org.apache.ibatis.type.JdbcType;
|
||||||
import org.dromara.visor.common.constant.Const;
|
import org.dromara.visor.common.constant.Const;
|
||||||
|
|
||||||
@@ -41,10 +42,17 @@ import java.util.Date;
|
|||||||
* @since 2023/6/23 18:42
|
* @since 2023/6/23 18:42
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class BaseDO implements Serializable {
|
public class BaseDO implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "id")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
@Schema(description = "创建时间")
|
||||||
@TableField(fill = FieldFill.INSERT)
|
@TableField(fill = FieldFill.INSERT)
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
@@ -70,4 +78,4 @@ public class BaseDO implements Serializable {
|
|||||||
@TableField(fill = FieldFill.INSERT, jdbcType = JdbcType.TINYINT)
|
@TableField(fill = FieldFill.INSERT, jdbcType = JdbcType.TINYINT)
|
||||||
private Boolean deleted;
|
private Boolean deleted;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -23,6 +23,8 @@
|
|||||||
package org.dromara.visor.framework.mybatis.core.generator;
|
package org.dromara.visor.framework.mybatis.core.generator;
|
||||||
|
|
||||||
import cn.orionsec.kit.lang.constant.Const;
|
import cn.orionsec.kit.lang.constant.Const;
|
||||||
|
import cn.orionsec.kit.lang.utils.Strings;
|
||||||
|
import cn.orionsec.kit.lang.utils.Systems;
|
||||||
import cn.orionsec.kit.lang.utils.ansi.AnsiAppender;
|
import cn.orionsec.kit.lang.utils.ansi.AnsiAppender;
|
||||||
import cn.orionsec.kit.lang.utils.ansi.style.AnsiFont;
|
import cn.orionsec.kit.lang.utils.ansi.style.AnsiFont;
|
||||||
import cn.orionsec.kit.lang.utils.ansi.style.color.AnsiForeground;
|
import cn.orionsec.kit.lang.utils.ansi.style.color.AnsiForeground;
|
||||||
@@ -32,6 +34,8 @@ import org.dromara.visor.framework.mybatis.core.generator.template.Table;
|
|||||||
import org.dromara.visor.framework.mybatis.core.generator.template.Template;
|
import org.dromara.visor.framework.mybatis.core.generator.template.Template;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代码生成器
|
* 代码生成器
|
||||||
@@ -42,6 +46,8 @@ import java.io.File;
|
|||||||
*/
|
*/
|
||||||
public class CodeGenerators {
|
public class CodeGenerators {
|
||||||
|
|
||||||
|
private static final Pattern ENV_VAR_PATTERN = Pattern.compile("\\$\\{([^:]+):([^}]+)\\}");
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// 输出路径
|
// 输出路径
|
||||||
String outputDir = "D:/MP/";
|
String outputDir = "D:/MP/";
|
||||||
@@ -76,11 +82,6 @@ public class CodeGenerators {
|
|||||||
.disableUnitTest()
|
.disableUnitTest()
|
||||||
.enableProviderApi()
|
.enableProviderApi()
|
||||||
.vue("system", "message")
|
.vue("system", "message")
|
||||||
.dict("messageClassify", "classify", "messageClassify")
|
|
||||||
.comment("消息分类")
|
|
||||||
.fields("NOTICE", "TODO")
|
|
||||||
.labels("通知", "待办")
|
|
||||||
.valueUseFields()
|
|
||||||
.dict("messageType", "type", "messageType")
|
.dict("messageType", "type", "messageType")
|
||||||
.comment("消息类型")
|
.comment("消息类型")
|
||||||
.fields("EXEC_FAILED", "UPLOAD_FAILED")
|
.fields("EXEC_FAILED", "UPLOAD_FAILED")
|
||||||
@@ -94,9 +95,9 @@ public class CodeGenerators {
|
|||||||
// jdbc 配置 - 使用配置文件
|
// jdbc 配置 - 使用配置文件
|
||||||
File yamlFile = new File("orion-visor-launch/src/main/resources/application-dev.yaml");
|
File yamlFile = new File("orion-visor-launch/src/main/resources/application-dev.yaml");
|
||||||
YmlExt yaml = YmlExt.load(yamlFile);
|
YmlExt yaml = YmlExt.load(yamlFile);
|
||||||
String url = yaml.getValue("spring.datasource.druid.url");
|
String url = resolveConfigValue(yaml.getValue("spring.datasource.druid.url"));
|
||||||
String username = yaml.getValue("spring.datasource.druid.username");
|
String username = resolveConfigValue(yaml.getValue("spring.datasource.druid.username"));
|
||||||
String password = yaml.getValue("spring.datasource.druid.password");
|
String password = resolveConfigValue(yaml.getValue("spring.datasource.druid.password"));
|
||||||
|
|
||||||
// 执行
|
// 执行
|
||||||
runGenerator(outputDir, author,
|
runGenerator(outputDir, author,
|
||||||
@@ -147,4 +148,31 @@ public class CodeGenerators {
|
|||||||
System.out.print(line);
|
System.out.print(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析实际的配置
|
||||||
|
*
|
||||||
|
* @param value value
|
||||||
|
* @return value
|
||||||
|
*/
|
||||||
|
private static String resolveConfigValue(String value) {
|
||||||
|
if (Strings.isBlank(value)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
Matcher matcher = ENV_VAR_PATTERN.matcher(value);
|
||||||
|
StringBuffer resultString = new StringBuffer();
|
||||||
|
while (matcher.find()) {
|
||||||
|
// 环境变量名
|
||||||
|
String envVar = matcher.group(1);
|
||||||
|
// 默认值
|
||||||
|
String defaultValue = matcher.group(2);
|
||||||
|
// 获取环境变量的值
|
||||||
|
String envValue = Systems.getEnv(envVar, defaultValue);
|
||||||
|
// 替换占位符
|
||||||
|
matcher.appendReplacement(resultString, Matcher.quoteReplacement(envValue));
|
||||||
|
}
|
||||||
|
// 处理结尾的剩余部分
|
||||||
|
matcher.appendTail(resultString);
|
||||||
|
return resultString.toString();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
package org.dromara.visor.framework.mybatis.core.query;
|
package org.dromara.visor.framework.mybatis.core.query;
|
||||||
|
|
||||||
import cn.orionsec.kit.lang.define.wrapper.DataGrid;
|
import cn.orionsec.kit.lang.define.wrapper.DataGrid;
|
||||||
import cn.orionsec.kit.lang.define.wrapper.IPageRequest;
|
|
||||||
import cn.orionsec.kit.lang.define.wrapper.PageRequest;
|
import cn.orionsec.kit.lang.define.wrapper.PageRequest;
|
||||||
import cn.orionsec.kit.lang.define.wrapper.Pager;
|
import cn.orionsec.kit.lang.define.wrapper.Pager;
|
||||||
import cn.orionsec.kit.lang.utils.Exceptions;
|
import cn.orionsec.kit.lang.utils.Exceptions;
|
||||||
@@ -33,11 +32,16 @@ import cn.orionsec.kit.lang.utils.collect.Lists;
|
|||||||
import cn.orionsec.kit.lang.utils.reflect.Classes;
|
import cn.orionsec.kit.lang.utils.reflect.Classes;
|
||||||
import cn.orionsec.kit.spring.SpringHolder;
|
import cn.orionsec.kit.spring.SpringHolder;
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.interfaces.Func;
|
||||||
import com.baomidou.mybatisplus.core.conditions.interfaces.Join;
|
import com.baomidou.mybatisplus.core.conditions.interfaces.Join;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
||||||
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
|
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||||
import org.dromara.visor.common.constant.Const;
|
import org.dromara.visor.common.constant.Const;
|
||||||
|
import org.dromara.visor.common.entity.IOrderRequest;
|
||||||
|
import org.dromara.visor.common.entity.IPageRequest;
|
||||||
|
import org.dromara.visor.common.enums.BooleanBit;
|
||||||
import org.dromara.visor.common.utils.SqlUtils;
|
import org.dromara.visor.common.utils.SqlUtils;
|
||||||
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
||||||
|
|
||||||
@@ -96,9 +100,9 @@ public class DataQuery<T> {
|
|||||||
return new DataQuery<>(dao, wrapper);
|
return new DataQuery<>(dao, wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataQuery<T> page(org.dromara.visor.common.entity.PageRequest page) {
|
public DataQuery<T> page(IPageRequest request) {
|
||||||
org.dromara.visor.common.entity.PageRequest pr = Valid.notNull(page, "page is null");
|
Valid.notNull(request, "page is null");
|
||||||
this.page = new PageRequest(pr.getPage(), pr.getLimit());
|
this.page = new PageRequest(request.getPage(), request.getLimit());
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,15 +134,30 @@ public class DataQuery<T> {
|
|||||||
return then;
|
return then;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataQuery<T> limit(IPageRequest page) {
|
public DataQuery<T> order(IOrderRequest request, SFunction<T, ?> column) {
|
||||||
return this.last(Pager.of(page).getSql());
|
BooleanBit sorted = BooleanBit.of(request.getOrder());
|
||||||
|
if (sorted == null) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
return this.order(sorted.booleanValue(), column);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataQuery<T> limit(int limit) {
|
@SuppressWarnings("unchecked")
|
||||||
|
public DataQuery<T> order(boolean asc, SFunction<T, ?> column) {
|
||||||
|
// 设置排序
|
||||||
|
if (wrapper instanceof Func) {
|
||||||
|
((Func<? extends T, SFunction<? extends T, ?>>) wrapper).orderBy(true, asc, column);
|
||||||
|
return this;
|
||||||
|
} else {
|
||||||
|
throw Exceptions.argument("wrapper not implements Func");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataQuery<T> limit(Number limit) {
|
||||||
return this.last(SqlUtils.limit(limit));
|
return this.last(SqlUtils.limit(limit));
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataQuery<T> limit(int offset, int limit) {
|
public DataQuery<T> limit(Number offset, Number limit) {
|
||||||
return this.last(SqlUtils.limit(offset, limit));
|
return this.last(SqlUtils.limit(offset, limit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public class DomainFillUtils {
|
|||||||
*/
|
*/
|
||||||
public static void fillInsert(BaseDO baseDO) {
|
public static void fillInsert(BaseDO baseDO) {
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
|
String username = securityHolder.getLoginUsername();
|
||||||
// 创建时间
|
// 创建时间
|
||||||
if (Objects.isNull(baseDO.getCreateTime())) {
|
if (Objects.isNull(baseDO.getCreateTime())) {
|
||||||
baseDO.setCreateTime(now);
|
baseDO.setCreateTime(now);
|
||||||
@@ -58,15 +59,13 @@ public class DomainFillUtils {
|
|||||||
if (Objects.isNull(baseDO.getUpdateTime())) {
|
if (Objects.isNull(baseDO.getUpdateTime())) {
|
||||||
baseDO.setUpdateTime(now);
|
baseDO.setUpdateTime(now);
|
||||||
}
|
}
|
||||||
|
|
||||||
Long userId = securityHolder.getLoginUserId();
|
|
||||||
// 创建人
|
// 创建人
|
||||||
if (Objects.nonNull(userId) && Objects.isNull(baseDO.getCreator())) {
|
if (Objects.nonNull(username) && Objects.isNull(baseDO.getCreator())) {
|
||||||
baseDO.setCreator(userId.toString());
|
baseDO.setCreator(username);
|
||||||
}
|
}
|
||||||
// 更新人
|
// 更新人
|
||||||
if (Objects.nonNull(userId) && Objects.isNull(baseDO.getUpdater())) {
|
if (Objects.nonNull(username) && Objects.isNull(baseDO.getUpdater())) {
|
||||||
baseDO.setUpdater(userId.toString());
|
baseDO.setUpdater(username);
|
||||||
}
|
}
|
||||||
// 逻辑删除字段
|
// 逻辑删除字段
|
||||||
if (Objects.isNull(baseDO.getDeleted())) {
|
if (Objects.isNull(baseDO.getDeleted())) {
|
||||||
@@ -85,9 +84,9 @@ public class DomainFillUtils {
|
|||||||
baseDO.setUpdateTime(new Date());
|
baseDO.setUpdateTime(new Date());
|
||||||
}
|
}
|
||||||
// 更新人
|
// 更新人
|
||||||
Long userId = securityHolder.getLoginUserId();
|
String username = securityHolder.getLoginUsername();
|
||||||
if (Objects.nonNull(userId) && Objects.isNull(baseDO.getUpdater())) {
|
if (Objects.nonNull(username) && Objects.isNull(baseDO.getUpdater())) {
|
||||||
baseDO.setUpdater(userId.toString());
|
baseDO.setUpdater(username);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import com.baomidou.mybatisplus.annotation.*;
|
|||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.math.*;
|
import java.math.*;
|
||||||
@@ -38,7 +39,7 @@ import java.math.*;
|
|||||||
* @since ${date}
|
* @since ${date}
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@@ -66,17 +67,8 @@ public class ${entity} {
|
|||||||
#if("$!field.comment" != "")
|
#if("$!field.comment" != "")
|
||||||
@Schema(description = "${field.comment}")
|
@Schema(description = "${field.comment}")
|
||||||
#end
|
#end
|
||||||
#if(${field.keyFlag})
|
|
||||||
## 主键
|
|
||||||
#if(${field.keyIdentityFlag})
|
|
||||||
@TableId(value = "${field.annotationColumnName}", type = IdType.AUTO)
|
|
||||||
#elseif(!$null.isNull(${idType}) && "$!idType" != "")
|
|
||||||
@TableId(value = "${field.annotationColumnName}", type = IdType.${idType})
|
|
||||||
#elseif(${field.convert})
|
|
||||||
@TableId("${field.annotationColumnName}")
|
|
||||||
#end
|
|
||||||
## 普通字段
|
## 普通字段
|
||||||
#elseif(${field.fill})
|
#if(${field.fill})
|
||||||
## ----- 存在字段填充设置 -----
|
## ----- 存在字段填充设置 -----
|
||||||
#if(${field.convert})
|
#if(${field.convert})
|
||||||
@TableField(value = "${field.annotationColumnName}", fill = FieldFill.${field.fill})
|
@TableField(value = "${field.annotationColumnName}", fill = FieldFill.${field.fill})
|
||||||
|
|||||||
@@ -25,11 +25,9 @@ package ${currentPackage};
|
|||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.dromara.visor.common.entity.PageRequest;
|
import org.dromara.visor.common.entity.BaseQueryRequest;
|
||||||
|
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.util.*;
|
|
||||||
import java.math.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $!{table.comment} 查询请求对象
|
* $!{table.comment} 查询请求对象
|
||||||
@@ -44,7 +42,7 @@ import java.math.*;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "${type}QueryRequest", description = "$!{table.comment} 查询请求对象")
|
@Schema(name = "${type}QueryRequest", description = "$!{table.comment} 查询请求对象")
|
||||||
public class ${type}QueryRequest extends PageRequest {
|
public class ${type}QueryRequest extends BaseQueryRequest {
|
||||||
|
|
||||||
@Schema(description = "搜索")
|
@Schema(description = "搜索")
|
||||||
private String searchValue;
|
private String searchValue;
|
||||||
|
|||||||
@@ -144,10 +144,11 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
|
|||||||
@Override
|
@Override
|
||||||
public List<${type}VO> get${type}List(${type}QueryRequest request) {
|
public List<${type}VO> get${type}List(${type}QueryRequest request) {
|
||||||
// 条件
|
// 条件
|
||||||
LambdaQueryWrapper<${type}DO> wrapper = this.buildQueryWrapper(request)
|
LambdaQueryWrapper<${type}DO> wrapper = this.buildQueryWrapper(request);
|
||||||
.orderByDesc(${type}DO::getId);
|
|
||||||
// 查询
|
// 查询
|
||||||
return ${typeLower}DAO.of(wrapper).list(${type}Convert.MAPPER::to);
|
return ${typeLower}DAO.of(wrapper)
|
||||||
|
.order(request, ${type}DO::getId)
|
||||||
|
.list(${type}Convert.MAPPER::to);
|
||||||
}
|
}
|
||||||
#if($meta.enableCache)
|
#if($meta.enableCache)
|
||||||
|
|
||||||
@@ -176,12 +177,12 @@ public class ${table.serviceImplName} implements ${table.serviceName} {
|
|||||||
@Override
|
@Override
|
||||||
public DataGrid<${type}VO> get${type}Page(${type}QueryRequest request) {
|
public DataGrid<${type}VO> get${type}Page(${type}QueryRequest request) {
|
||||||
// 条件
|
// 条件
|
||||||
LambdaQueryWrapper<${type}DO> wrapper = this.buildQueryWrapper(request)
|
LambdaQueryWrapper<${type}DO> wrapper = this.buildQueryWrapper(request);
|
||||||
.orderByDesc(${type}DO::getId);
|
|
||||||
// 查询
|
// 查询
|
||||||
return ${typeLower}DAO.of()
|
return ${typeLower}DAO.of()
|
||||||
.page(request)
|
|
||||||
.wrapper(wrapper)
|
.wrapper(wrapper)
|
||||||
|
.page(request)
|
||||||
|
.order(request, ${type}DO::getId)
|
||||||
.dataGrid(${type}Convert.MAPPER::to);
|
.dataGrid(${type}Convert.MAPPER::to);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ SELECT @TYPE_KEY_ID:= id FROM dict_key WHERE key_name = 'operatorLogType' AND de
|
|||||||
INSERT INTO dict_value
|
INSERT INTO dict_value
|
||||||
(`key_id`, `key_name`, `value`, `label`, `extra`, `sort`, `create_time`, `update_time`, `creator`, `updater`, `deleted`)
|
(`key_id`, `key_name`, `value`, `label`, `extra`, `sort`, `create_time`, `update_time`, `creator`, `updater`, `deleted`)
|
||||||
VALUES
|
VALUES
|
||||||
(@MODULE_KEY_ID, 'operatorLogModule', '${package.ModuleName}:${typeHyphen}', '$!{table.comment}', '{}', @MODULE_KEY_MAX_SORT + 10, now(), now(), '1', '1', 0),
|
(@MODULE_KEY_ID, 'operatorLogModule', '${package.ModuleName}:${typeHyphen}', '$!{table.comment}', '{}', @MODULE_KEY_MAX_SORT + 10, now(), now(), 'admin', 'admin', 0),
|
||||||
(@TYPE_KEY_ID, 'operatorLogType', '${typeHyphen}:create', '创建$!{table.comment}', '{}', 10, now(), now(), '1', '1', 0),
|
(@TYPE_KEY_ID, 'operatorLogType', '${typeHyphen}:create', '创建$!{table.comment}', '{}', 10, now(), now(), 'admin', 'admin', 0),
|
||||||
(@TYPE_KEY_ID, 'operatorLogType', '${typeHyphen}:update', '更新$!{table.comment}', '{}', 20, now(), now(), '1', '1', 0),
|
(@TYPE_KEY_ID, 'operatorLogType', '${typeHyphen}:update', '更新$!{table.comment}', '{}', 20, now(), now(), 'admin', 'admin', 0),
|
||||||
(@TYPE_KEY_ID, 'operatorLogType', '${typeHyphen}:delete', '删除$!{table.comment}', '{}', 30, now(), now(), '1', '1', 0);
|
(@TYPE_KEY_ID, 'operatorLogType', '${typeHyphen}:delete', '删除$!{table.comment}', '{}', 30, now(), now(), 'admin', 'admin', 0);
|
||||||
#end
|
#end
|
||||||
|
|
||||||
#if($dictMap.entrySet().size() > 0)
|
#if($dictMap.entrySet().size() > 0)
|
||||||
@@ -23,7 +23,7 @@ VALUES
|
|||||||
INSERT INTO dict_key
|
INSERT INTO dict_key
|
||||||
(`key_name`, `value_type`, `extra_schema`, `description`, `create_time`, `update_time`, `creator`, `updater`, `deleted`)
|
(`key_name`, `value_type`, `extra_schema`, `description`, `create_time`, `update_time`, `creator`, `updater`, `deleted`)
|
||||||
VALUES
|
VALUES
|
||||||
('$enumEntity.value.keyName', 'STRING', '$enumEntity.value.extraSchema', '$enumEntity.value.comment', now(), now(), '1', '1', 0);
|
('$enumEntity.value.keyName', 'STRING', '$enumEntity.value.extraSchema', '$enumEntity.value.comment', now(), now(), 'admin', 'admin', 0);
|
||||||
|
|
||||||
-- 设置临时配置项id
|
-- 设置临时配置项id
|
||||||
SELECT @TMP_KEY_ID:=LAST_INSERT_ID();
|
SELECT @TMP_KEY_ID:=LAST_INSERT_ID();
|
||||||
@@ -35,7 +35,7 @@ VALUES
|
|||||||
#set($count = $enumEntity.value.fields.size() - 1)
|
#set($count = $enumEntity.value.fields.size() - 1)
|
||||||
#foreach($index in [0..$count])
|
#foreach($index in [0..$count])
|
||||||
#set($sort = $index * 10 + 10)
|
#set($sort = $index * 10 + 10)
|
||||||
(@TMP_KEY_ID, '$enumEntity.value.keyName', '$enumEntity.value.values.get($index)', '$enumEntity.value.labels.get($index)', #if($enumEntity.value.extraJson.size() > $index)'$enumEntity.value.extraJson.get($index)'#else'{}'#end, $sort, now(), now(), '1', '1', 0)#if($foreach.hasNext),#else;#end
|
(@TMP_KEY_ID, '$enumEntity.value.keyName', '$enumEntity.value.values.get($index)', '$enumEntity.value.labels.get($index)', #if($enumEntity.value.extraJson.size() > $index)'$enumEntity.value.extraJson.get($index)'#else'{}'#end, $sort, now(), now(), 'admin', 'admin', 0)#if($foreach.hasNext),#else;#end
|
||||||
#end
|
#end
|
||||||
|
|
||||||
#end
|
#end
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
INSERT INTO system_menu
|
INSERT INTO system_menu
|
||||||
(parent_id, name, type, sort, visible, status, cache, component, creator, updater, deleted)
|
(parent_id, name, type, sort, visible, status, cache, component, creator, updater, deleted)
|
||||||
VALUES
|
VALUES
|
||||||
(0, '${table.comment}管理', 1, 10, 1, 1, 1, '${vue.moduleEntityFirstLower}Module', '1', '1', 0);
|
(0, '${table.comment}管理', 1, 10, 1, 1, 1, '${vue.moduleEntityFirstLower}Module', 'admin', 'admin', 0);
|
||||||
|
|
||||||
-- 设置临时父菜单id
|
-- 设置临时父菜单id
|
||||||
SELECT @TMP_PARENT_ID:=LAST_INSERT_ID();
|
SELECT @TMP_PARENT_ID:=LAST_INSERT_ID();
|
||||||
@@ -13,7 +13,7 @@ SELECT @TMP_PARENT_ID:=LAST_INSERT_ID();
|
|||||||
INSERT INTO system_menu
|
INSERT INTO system_menu
|
||||||
(parent_id, name, type, sort, visible, status, cache, component, creator, updater, deleted)
|
(parent_id, name, type, sort, visible, status, cache, component, creator, updater, deleted)
|
||||||
VALUES
|
VALUES
|
||||||
(@TMP_PARENT_ID, '$table.comment', 2, 10, 1, 1, 1, '$vue.featureEntityFirstLower', '1', '1', 0);
|
(@TMP_PARENT_ID, '$table.comment', 2, 10, 1, 1, 1, '$vue.featureEntityFirstLower', 'admin', 'admin', 0);
|
||||||
|
|
||||||
-- 设置临时子菜单id
|
-- 设置临时子菜单id
|
||||||
SELECT @TMP_SUB_ID:=LAST_INSERT_ID();
|
SELECT @TMP_SUB_ID:=LAST_INSERT_ID();
|
||||||
@@ -22,7 +22,7 @@ SELECT @TMP_SUB_ID:=LAST_INSERT_ID();
|
|||||||
INSERT INTO system_menu
|
INSERT INTO system_menu
|
||||||
(parent_id, name, permission, type, sort, creator, updater, deleted)
|
(parent_id, name, permission, type, sort, creator, updater, deleted)
|
||||||
VALUES
|
VALUES
|
||||||
(@TMP_SUB_ID, '查询$table.comment', '${package.ModuleName}:${typeHyphen}:query', 3, 10, '1', '1', 0),
|
(@TMP_SUB_ID, '查询$table.comment', '${package.ModuleName}:${typeHyphen}:query', 3, 10, 'admin', 'admin', 0),
|
||||||
(@TMP_SUB_ID, '创建$table.comment', '${package.ModuleName}:${typeHyphen}:create', 3, 20, '1', '1', 0),
|
(@TMP_SUB_ID, '创建$table.comment', '${package.ModuleName}:${typeHyphen}:create', 3, 20, 'admin', 'admin', 0),
|
||||||
(@TMP_SUB_ID, '修改$table.comment', '${package.ModuleName}:${typeHyphen}:update', 3, 30, '1', '1', 0),
|
(@TMP_SUB_ID, '修改$table.comment', '${package.ModuleName}:${typeHyphen}:update', 3, 30, 'admin', 'admin', 0),
|
||||||
(@TMP_SUB_ID, '删除$table.comment', '${package.ModuleName}:${typeHyphen}:delete', 3, 40, '1', '1', 0);
|
(@TMP_SUB_ID, '删除$table.comment', '${package.ModuleName}:${typeHyphen}:delete', 3, 40, 'admin', 'admin', 0);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { DataGrid, Pagination } from '@/types/global';
|
import type { TableData } from '@arco-design/web-vue';
|
||||||
import type { TableData } from '@arco-design/web-vue/es/table/interface';
|
import type { DataGrid, OrderDirection, Pagination } from '@/types/global';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import qs from 'query-string';
|
import qs from 'query-string';
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ export interface ${vue.featureEntity}UpdateRequest extends ${vue.featureEntity}C
|
|||||||
/**
|
/**
|
||||||
* ${table.comment}查询请求
|
* ${table.comment}查询请求
|
||||||
*/
|
*/
|
||||||
export interface ${vue.featureEntity}QueryRequest extends Pagination {
|
export interface ${vue.featureEntity}QueryRequest extends Pagination, OrderDirection {
|
||||||
searchValue?: string;
|
searchValue?: string;
|
||||||
#foreach($field in ${table.fields})
|
#foreach($field in ${table.fields})
|
||||||
#if("$field.propertyType" == "String" || "$field.propertyType" == "Date")
|
#if("$field.propertyType" == "String" || "$field.propertyType" == "Date")
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const $vue.moduleConst: AppRouteRecordRaw = {
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
name: '$vue.featureEntityFirstLower',
|
name: '$vue.featureEntityFirstLower',
|
||||||
path: '/$vue.feature',
|
path: '/$vue.module/$vue.feature',
|
||||||
component: () => import('@/views/$vue.module/$vue.feature/index.vue'),
|
component: () => import('@/views/$vue.module/$vue.feature/index.vue'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -3,12 +3,14 @@
|
|||||||
search-input-placeholder="输入搜索值"
|
search-input-placeholder="输入搜索值"
|
||||||
:create-card-position="false"
|
:create-card-position="false"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:field-config="fieldConfig"
|
:field-config="cardFieldConfig"
|
||||||
:list="list"
|
:list="list"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:card-layout-cols="cardColLayout"
|
:card-layout-cols="cardColLayout"
|
||||||
:filter-count="filterCount"
|
:filter-count="filterCount"
|
||||||
:add-permission="['${package.ModuleName}:${typeHyphen}:create']"
|
:add-permission="['${package.ModuleName}:${typeHyphen}:create']"
|
||||||
|
:query-order="queryOrder"
|
||||||
|
:fields-hook="fieldsHook"
|
||||||
@add="emits('openAdd')"
|
@add="emits('openAdd')"
|
||||||
@reset="reset"
|
@reset="reset"
|
||||||
@search="fetchCardData"
|
@search="fetchCardData"
|
||||||
@@ -74,16 +76,12 @@
|
|||||||
<!-- 修改 -->
|
<!-- 修改 -->
|
||||||
<a-doption v-permission="['${package.ModuleName}:${typeHyphen}:update']"
|
<a-doption v-permission="['${package.ModuleName}:${typeHyphen}:update']"
|
||||||
@click="emits('openUpdate', record)">
|
@click="emits('openUpdate', record)">
|
||||||
<span class="more-doption normal">
|
<span class="more-doption normal">修改</span>
|
||||||
<icon-edit /> 修改
|
|
||||||
</span>
|
|
||||||
</a-doption>
|
</a-doption>
|
||||||
<!-- 删除 -->
|
<!-- 删除 -->
|
||||||
<a-doption v-permission="['${package.ModuleName}:${typeHyphen}:delete']"
|
<a-doption v-permission="['${package.ModuleName}:${typeHyphen}:delete']"
|
||||||
@click="deleteRow(record.id)">
|
@click="deleteRow(record.id)">
|
||||||
<span class="more-doption error">
|
<span class="more-doption error">删除</span>
|
||||||
<icon-delete /> 删除
|
|
||||||
</span>
|
|
||||||
</a-doption>
|
</a-doption>
|
||||||
</template>
|
</template>
|
||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
@@ -94,17 +92,13 @@
|
|||||||
<!-- 修改 -->
|
<!-- 修改 -->
|
||||||
<a-doption v-permission="['${package.ModuleName}:${typeHyphen}:update']"
|
<a-doption v-permission="['${package.ModuleName}:${typeHyphen}:update']"
|
||||||
@click="emits('openUpdate', record)">
|
@click="emits('openUpdate', record)">
|
||||||
<span class="more-doption normal">
|
<span class="more-doption normal">修改</span>
|
||||||
<icon-edit /> 修改
|
|
||||||
</span>
|
|
||||||
</a-doption>
|
</a-doption>
|
||||||
<!-- 删除 -->
|
<!-- 删除 -->
|
||||||
<a-doption v-permission="['${package.ModuleName}:${typeHyphen}:delete']"
|
<a-doption v-permission="['${package.ModuleName}:${typeHyphen}:delete']"
|
||||||
class="span-red"
|
class="span-red"
|
||||||
@click="deleteRow(record.id)">
|
@click="deleteRow(record.id)">
|
||||||
<span class="more-doption error">
|
<span class="more-doption error">删除</span>
|
||||||
<icon-delete /> 删除
|
|
||||||
</span>
|
|
||||||
</a-doption>
|
</a-doption>
|
||||||
</template>
|
</template>
|
||||||
</card-list>
|
</card-list>
|
||||||
@@ -118,26 +112,29 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { ${vue.featureEntity}QueryRequest, ${vue.featureEntity}QueryResponse } from '@/api/${vue.module}/${vue.feature}';
|
import type { ${vue.featureEntity}QueryRequest, ${vue.featureEntity}QueryResponse } from '@/api/${vue.module}/${vue.feature}';
|
||||||
import { useCardPagination, useCardColLayout } from '@/hooks/card';
|
import { useCardPagination, useCardColLayout, useCardFieldConfig } from '@/hooks/card';
|
||||||
import { computed, reactive, ref, onMounted } from 'vue';
|
import { computed, reactive, ref, onMounted } from 'vue';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { objectTruthKeyCount, resetObject } from '@/utils';
|
import { objectTruthKeyCount, resetObject } from '@/utils';
|
||||||
import fieldConfig from '../types/card.fields';
|
import fieldConfig from '../types/card.fields';
|
||||||
#if($dictMap.entrySet().size() > 0)
|
#if($dictMap.entrySet().size() > 0)
|
||||||
import { #foreach($entry in ${dictMap.entrySet()})${entry.value.keyField}#if($foreach.hasNext), #end#end } from '../types/const';
|
import { TableName, #foreach($entry in ${dictMap.entrySet()})${entry.value.keyField}#if($foreach.hasNext), #end#end } from '../types/const';
|
||||||
#else
|
#else
|
||||||
import {} from '../types/const';
|
import { TableName } from '../types/const';
|
||||||
#end
|
#end
|
||||||
import { delete${vue.featureEntity}, get${vue.featureEntity}Page } from '@/api/${vue.module}/${vue.feature}';
|
import { delete${vue.featureEntity}, get${vue.featureEntity}Page } from '@/api/${vue.module}/${vue.feature}';
|
||||||
import { Message, Modal } from '@arco-design/web-vue';
|
import { Message, Modal } from '@arco-design/web-vue';
|
||||||
#if($dictMap.entrySet().size() > 0)
|
#if($dictMap.entrySet().size() > 0)
|
||||||
import { useDictStore } from '@/store';
|
import { useDictStore } from '@/store';
|
||||||
#end
|
#end
|
||||||
|
import { useQueryOrder, ASC } from '@/hooks/query-order';
|
||||||
|
|
||||||
const emits = defineEmits(['openAdd', 'openUpdate']);
|
const emits = defineEmits(['openAdd', 'openUpdate']);
|
||||||
|
|
||||||
const cardColLayout = useCardColLayout();
|
const cardColLayout = useCardColLayout();
|
||||||
const pagination = useCardPagination();
|
const pagination = useCardPagination();
|
||||||
|
const queryOrder = useQueryOrder(TableName, ASC);
|
||||||
|
const { cardFieldConfig, fieldsHook } = useCardFieldConfig(TableName, fieldConfig);
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
#if($dictMap.entrySet().size() > 0)
|
#if($dictMap.entrySet().size() > 0)
|
||||||
const { toOptions, getDictValue } = useDictStore();
|
const { toOptions, getDictValue } = useDictStore();
|
||||||
@@ -198,7 +195,7 @@
|
|||||||
const doFetchCardData = async (request: ${vue.featureEntity}QueryRequest) => {
|
const doFetchCardData = async (request: ${vue.featureEntity}QueryRequest) => {
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const { data } = await get${vue.featureEntity}Page(request);
|
const { data } = await get${vue.featureEntity}Page(queryOrder.markOrderly(request));
|
||||||
list.value = data.rows;
|
list.value = data.rows;
|
||||||
pagination.total = data.total;
|
pagination.total = data.total;
|
||||||
pagination.current = request.page;
|
pagination.current = request.page;
|
||||||
|
|||||||
@@ -75,6 +75,11 @@
|
|||||||
</a-button>
|
</a-button>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
#end
|
#end
|
||||||
|
<!-- 调整 -->
|
||||||
|
<table-adjust :columns="columns"
|
||||||
|
:columns-hook="columnsHook"
|
||||||
|
:query-order="queryOrder"
|
||||||
|
@query="fetchTableData" />
|
||||||
</a-space>
|
</a-space>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -87,7 +92,7 @@
|
|||||||
#end
|
#end
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:columns="columns"
|
:columns="tableColumns"
|
||||||
#if($vue.enableRowSelection)
|
#if($vue.enableRowSelection)
|
||||||
:row-selection="rowSelection"
|
:row-selection="rowSelection"
|
||||||
#end
|
#end
|
||||||
@@ -146,25 +151,29 @@
|
|||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import columns from '../types/table.columns';
|
import columns from '../types/table.columns';
|
||||||
#if($dictMap.entrySet().size() > 0)
|
#if($dictMap.entrySet().size() > 0)
|
||||||
import { #foreach($entry in ${dictMap.entrySet()})${entry.value.keyField}#if($foreach.hasNext), #end#end } from '../types/const';
|
import { TableName, #foreach($entry in ${dictMap.entrySet()})${entry.value.keyField}#if($foreach.hasNext), #end#end } from '../types/const';
|
||||||
#else
|
#else
|
||||||
import {} from '../types/const';
|
import { TableName } from '../types/const';
|
||||||
#end
|
#end
|
||||||
#if($vue.enableRowSelection)
|
#if($vue.enableRowSelection)
|
||||||
import { useTablePagination, useRowSelection } from '@/hooks/table';
|
import { useTablePagination, useRowSelection, useTableColumns } from '@/hooks/table';
|
||||||
#else
|
#else
|
||||||
import { useTablePagination } from '@/hooks/table';
|
import { useTablePagination, useTableColumns } from '@/hooks/table';
|
||||||
#end
|
#end
|
||||||
#if($dictMap.entrySet().size() > 0)
|
#if($dictMap.entrySet().size() > 0)
|
||||||
import { useDictStore } from '@/store';
|
import { useDictStore } from '@/store';
|
||||||
#end
|
#end
|
||||||
|
import { useQueryOrder, ASC } from '@/hooks/query-order';
|
||||||
|
import TableAdjust from '@/components/app/table-adjust/index.vue';
|
||||||
|
|
||||||
const emits = defineEmits(['openAdd', 'openUpdate']);
|
const emits = defineEmits(['openAdd', 'openUpdate']);
|
||||||
|
|
||||||
const pagination = useTablePagination();
|
|
||||||
#if($vue.enableRowSelection)
|
#if($vue.enableRowSelection)
|
||||||
const rowSelection = useRowSelection();
|
const rowSelection = useRowSelection();
|
||||||
#end
|
#end
|
||||||
|
const pagination = useTablePagination();
|
||||||
|
const queryOrder = useQueryOrder(TableName, ASC);
|
||||||
|
const { tableColumns, columnsHook } = useTableColumns(TableName, columns);
|
||||||
const { loading, setLoading } = useLoading();
|
const { loading, setLoading } = useLoading();
|
||||||
#if($dictMap.entrySet().size() > 0)
|
#if($dictMap.entrySet().size() > 0)
|
||||||
const { toOptions, getDictValue } = useDictStore();
|
const { toOptions, getDictValue } = useDictStore();
|
||||||
@@ -227,7 +236,7 @@
|
|||||||
const doFetchTableData = async (request: ${vue.featureEntity}QueryRequest) => {
|
const doFetchTableData = async (request: ${vue.featureEntity}QueryRequest) => {
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const { data } = await get${vue.featureEntity}Page(request);
|
const { data } = await get${vue.featureEntity}Page(queryOrder.markOrderly(request));
|
||||||
tableRenderData.value = data.rows;
|
tableRenderData.value = data.rows;
|
||||||
pagination.total = data.total;
|
pagination.total = data.total;
|
||||||
pagination.current = request.page;
|
pagination.current = request.page;
|
||||||
|
|||||||
@@ -3,13 +3,14 @@ import { dateFormat } from '@/utils';
|
|||||||
|
|
||||||
const fieldConfig = {
|
const fieldConfig = {
|
||||||
rowGap: '10px',
|
rowGap: '10px',
|
||||||
labelSpan: 8,
|
labelSpan: 6,
|
||||||
minHeight: '22px',
|
minHeight: '22px',
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
label: 'id',
|
label: 'id',
|
||||||
dataIndex: 'id',
|
dataIndex: 'id',
|
||||||
slotName: 'id',
|
slotName: 'id',
|
||||||
|
default: true,
|
||||||
}, #foreach($field in ${table.fields})#if("$!field.propertyName" != "id"){
|
}, #foreach($field in ${table.fields})#if("$!field.propertyName" != "id"){
|
||||||
label: '${field.comment}',
|
label: '${field.comment}',
|
||||||
dataIndex: '${field.propertyName}',
|
dataIndex: '${field.propertyName}',
|
||||||
@@ -21,6 +22,7 @@ const fieldConfig = {
|
|||||||
return record.${field.propertyName} && dateFormat(new Date(record.${field.propertyName}));
|
return record.${field.propertyName} && dateFormat(new Date(record.${field.propertyName}));
|
||||||
},
|
},
|
||||||
#end
|
#end
|
||||||
|
default: true,
|
||||||
}, #end#end{
|
}, #end#end{
|
||||||
label: '创建时间',
|
label: '创建时间',
|
||||||
dataIndex: 'createTime',
|
dataIndex: 'createTime',
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
export const TABLE_NAME = '$table.name';
|
||||||
|
|
||||||
#if($dictMap.entrySet().size() > 0)
|
#if($dictMap.entrySet().size() > 0)
|
||||||
#foreach($enumEntity in $dictMap.entrySet())
|
#foreach($enumEntity in $dictMap.entrySet())
|
||||||
// $enumEntity.value.comment
|
// $enumEntity.value.comment
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
|
import type { TableColumnData } from '@arco-design/web-vue';
|
||||||
import { dateFormat } from '@/utils';
|
import { dateFormat } from '@/utils';
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
@@ -9,6 +9,7 @@ const columns = [
|
|||||||
width: 68,
|
width: 68,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
|
default: true,
|
||||||
}, #foreach($field in ${table.fields})#if("$!field.propertyName" != "id"){
|
}, #foreach($field in ${table.fields})#if("$!field.propertyName" != "id"){
|
||||||
title: '${field.comment}',
|
title: '${field.comment}',
|
||||||
dataIndex: '${field.propertyName}',
|
dataIndex: '${field.propertyName}',
|
||||||
@@ -24,6 +25,7 @@ const columns = [
|
|||||||
return record.${field.propertyName} && dateFormat(new Date(record.${field.propertyName}));
|
return record.${field.propertyName} && dateFormat(new Date(record.${field.propertyName}));
|
||||||
},
|
},
|
||||||
#end
|
#end
|
||||||
|
default: true,
|
||||||
}, #end#end{
|
}, #end#end{
|
||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
dataIndex: 'createTime',
|
dataIndex: 'createTime',
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ public class OrionSecurityAutoConfiguration {
|
|||||||
return httpSecurity
|
return httpSecurity
|
||||||
// 开启跨域
|
// 开启跨域
|
||||||
.cors().and()
|
.cors().and()
|
||||||
// 因为不使用session 禁用CSRF
|
// 因为不使用 session 禁用 CSRF
|
||||||
.csrf().disable()
|
.csrf().disable()
|
||||||
// 基于 token 机制所以不需要 session
|
// 基于 token 机制所以不需要 session
|
||||||
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
|
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
|
||||||
|
|||||||
@@ -45,4 +45,9 @@ public class SecurityHolderDelegate implements SecurityHolder {
|
|||||||
return SecurityUtils.getLoginUserId();
|
return SecurityUtils.getLoginUserId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLoginUsername() {
|
||||||
|
return SecurityUtils.getLoginUsername();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,27 @@ public class StaticResourceAuthorizeRequestsCustomizer extends AuthorizeRequests
|
|||||||
@Override
|
@Override
|
||||||
public void customize(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry) {
|
public void customize(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry) {
|
||||||
// 静态资源可匿名访问
|
// 静态资源可匿名访问
|
||||||
registry.antMatchers(HttpMethod.GET, "/*.html", "/**/*.html", "/**/*.css", "/**/*.js").permitAll();
|
registry.antMatchers(HttpMethod.GET,
|
||||||
|
"/*.html",
|
||||||
|
"/*.css",
|
||||||
|
"/*.js",
|
||||||
|
"/*.gz",
|
||||||
|
"/*.ico",
|
||||||
|
"/*.jpg",
|
||||||
|
"/*.png",
|
||||||
|
"/*.svg",
|
||||||
|
"/*.json",
|
||||||
|
"/*.webmanifest",
|
||||||
|
"/**/*.html",
|
||||||
|
"/**/*.css",
|
||||||
|
"/**/*.js",
|
||||||
|
"/**/*.gz",
|
||||||
|
"/**/*.ico",
|
||||||
|
"/**/*.jpg",
|
||||||
|
"/**/*.png",
|
||||||
|
"/**/*.svg",
|
||||||
|
"/**/*.json"
|
||||||
|
).permitAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,11 @@ public class OrionMockBeanTestConfiguration {
|
|||||||
public Long getLoginUserId() {
|
public Long getLoginUserId() {
|
||||||
return DEFAULT.getId();
|
return DEFAULT.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLoginUsername() {
|
||||||
|
return DEFAULT.getUsername();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ package org.dromara.visor.framework.test.core.base;
|
|||||||
|
|
||||||
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
|
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
|
||||||
import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;
|
import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;
|
||||||
|
import org.dromara.visor.common.configuration.SpringConfiguration;
|
||||||
import org.dromara.visor.framework.datasource.configuration.OrionDataSourceAutoConfiguration;
|
import org.dromara.visor.framework.datasource.configuration.OrionDataSourceAutoConfiguration;
|
||||||
import org.dromara.visor.framework.mybatis.configuration.OrionMybatisAutoConfiguration;
|
import org.dromara.visor.framework.mybatis.configuration.OrionMybatisAutoConfiguration;
|
||||||
import org.dromara.visor.framework.redis.configuration.OrionRedisAutoConfiguration;
|
import org.dromara.visor.framework.redis.configuration.OrionRedisAutoConfiguration;
|
||||||
@@ -57,6 +58,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
public class BaseUnitTest {
|
public class BaseUnitTest {
|
||||||
|
|
||||||
@Import({
|
@Import({
|
||||||
|
// spring
|
||||||
|
SpringConfiguration.class,
|
||||||
// mock
|
// mock
|
||||||
OrionMockBeanTestConfiguration.class,
|
OrionMockBeanTestConfiguration.class,
|
||||||
OrionMockRedisTestConfiguration.class,
|
OrionMockRedisTestConfiguration.class,
|
||||||
@@ -74,7 +77,6 @@ public class BaseUnitTest {
|
|||||||
RedisAutoConfiguration.class,
|
RedisAutoConfiguration.class,
|
||||||
RedissonAutoConfiguration.class,
|
RedissonAutoConfiguration.class,
|
||||||
})
|
})
|
||||||
// TODO
|
|
||||||
public static class Application {
|
public static class Application {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,11 @@
|
|||||||
"description": "是否为演示模式.",
|
"description": "是否为演示模式.",
|
||||||
"defaultValue": false
|
"defaultValue": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "orion.prefix",
|
||||||
|
"type": "java.lang.String",
|
||||||
|
"description": "项目前缀."
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "orion.api.prefix",
|
"name": "orion.api.prefix",
|
||||||
"type": "java.lang.String",
|
"type": "java.lang.String",
|
||||||
|
|||||||
@@ -112,8 +112,12 @@
|
|||||||
<!-- 设置构建的 jar 包名 -->
|
<!-- 设置构建的 jar 包名 -->
|
||||||
<finalName>${project.artifactId}</finalName>
|
<finalName>${project.artifactId}</finalName>
|
||||||
<resources>
|
<resources>
|
||||||
|
<!-- 应用配置过滤 -->
|
||||||
<resource>
|
<resource>
|
||||||
<directory>src/main/resources</directory>
|
<directory>src/main/resources</directory>
|
||||||
|
<includes>
|
||||||
|
<include>*.yaml</include>
|
||||||
|
</includes>
|
||||||
<filtering>true</filtering>
|
<filtering>true</filtering>
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -42,7 +42,11 @@ import java.util.Optional;
|
|||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @since 2023/6/19 16:55
|
* @since 2023/6/19 16:55
|
||||||
*/
|
*/
|
||||||
@SpringBootApplication(scanBasePackages = {"org.dromara.visor.launch", "org.dromara.visor.module"})
|
@SpringBootApplication(scanBasePackages = {
|
||||||
|
"org.dromara.visor.launch",
|
||||||
|
"org.dromara.visor.common",
|
||||||
|
"org.dromara.visor.module"
|
||||||
|
})
|
||||||
public class LaunchApplication {
|
public class LaunchApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
druid:
|
druid:
|
||||||
url: jdbc:mysql://127.0.0.1:3306/orion_visor?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true
|
url: jdbc:mysql://${MYSQL_HOST:127.0.0.1}:${MYSQL_PORT:3306}/${MYSQL_DATABASE:orion_visor}?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=Asia/Shanghai&autoReconnect=true
|
||||||
username: root
|
username: ${MYSQL_USER:root}
|
||||||
password: Data@123456
|
password: ${MYSQL_PASSWORD:Data@123456}
|
||||||
initial-size: 0
|
initial-size: 0
|
||||||
min-idle: 1
|
min-idle: 1
|
||||||
max-active: 5
|
max-active: 5
|
||||||
stat-view-servlet:
|
stat-view-servlet:
|
||||||
enabled: false
|
enabled: false
|
||||||
redis:
|
redis:
|
||||||
host: 127.0.0.1
|
host: ${REDIS_HOST:127.0.0.1}
|
||||||
port: 6379
|
port: ${REDIS_PORT:6379}
|
||||||
password: Data@123456
|
password: ${REDIS_PASSWORD:Data@123456}
|
||||||
redisson:
|
redisson:
|
||||||
threads: 2
|
threads: 2
|
||||||
netty-threads: 2
|
netty-threads: 2
|
||||||
|
|||||||
@@ -163,14 +163,16 @@ orion:
|
|||||||
version: @revision@
|
version: @revision@
|
||||||
# 是否为演示模式
|
# 是否为演示模式
|
||||||
demo: false
|
demo: false
|
||||||
|
# 前缀
|
||||||
|
prefix: /orion-visor
|
||||||
api:
|
api:
|
||||||
# 公共 api 前缀
|
# 公共 api 前缀
|
||||||
prefix: /orion-visor/api
|
prefix: ${orion.prefix}/api
|
||||||
# 是否允许跨域
|
# 是否允许跨域
|
||||||
cors: true
|
cors: true
|
||||||
websocket:
|
websocket:
|
||||||
# 公共 websocket 前缀
|
# 公共 websocket 前缀
|
||||||
prefix: /orion-visor/keep-alive
|
prefix: ${orion.prefix}/keep-alive
|
||||||
# 1MB
|
# 1MB
|
||||||
binary-buffer-size: 1048576
|
binary-buffer-size: 1048576
|
||||||
# 1MB
|
# 1MB
|
||||||
|
|||||||
@@ -39,19 +39,19 @@ import java.util.function.Function;
|
|||||||
*/
|
*/
|
||||||
public class ReplaceVersion {
|
public class ReplaceVersion {
|
||||||
|
|
||||||
private static final String TARGET_VERSION = "2.3.2";
|
private static final String TARGET_VERSION = "2.3.7";
|
||||||
|
|
||||||
private static final String REPLACE_VERSION = "2.3.3";
|
private static final String REPLACE_VERSION = "2.3.8";
|
||||||
|
|
||||||
private static final String PATH = new File("").getAbsolutePath();
|
private static final String PATH = new File("").getAbsolutePath();
|
||||||
|
|
||||||
private static final String[] DOCKER_FILES = new String[]{
|
private static final String[] DOCKER_FILES = new String[]{
|
||||||
"docker/push.sh",
|
"docker/push.sh",
|
||||||
"docker/adminer/build.sh",
|
"docker/adminer/build.sh",
|
||||||
"docker/adminer/build.sh",
|
|
||||||
"docker/mysql/build.sh",
|
"docker/mysql/build.sh",
|
||||||
"docker/redis/build.sh",
|
"docker/redis/build.sh",
|
||||||
"docker/service/build.sh",
|
"docker/service/build.sh",
|
||||||
|
"docker/ui/build.sh",
|
||||||
"docker-compose.yml",
|
"docker-compose.yml",
|
||||||
"docker-compose-testing.yml"
|
"docker-compose-testing.yml"
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -82,6 +82,10 @@
|
|||||||
<groupId>org.dromara.visor</groupId>
|
<groupId>org.dromara.visor</groupId>
|
||||||
<artifactId>orion-visor-spring-boot-starter-job</artifactId>
|
<artifactId>orion-visor-spring-boot-starter-job</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.dromara.visor</groupId>
|
||||||
|
<artifactId>orion-visor-spring-boot-starter-test</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@@ -63,7 +63,7 @@ public class AssetAuthorizedDataServiceController {
|
|||||||
@IgnoreLog(IgnoreLogMode.RET)
|
@IgnoreLog(IgnoreLogMode.RET)
|
||||||
@GetMapping("/current-host")
|
@GetMapping("/current-host")
|
||||||
@Operation(summary = "查询当前用户已授权的主机")
|
@Operation(summary = "查询当前用户已授权的主机")
|
||||||
public AuthorizedHostWrapperVO getCurrentAuthorizedHost(@RequestParam("type") String type) {
|
public AuthorizedHostWrapperVO getCurrentAuthorizedHost(@RequestParam(value = "type", required = false) String type) {
|
||||||
return assetAuthorizedDataService.getUserAuthorizedHost(SecurityUtils.getLoginUserId(), type);
|
return assetAuthorizedDataService.getUserAuthorizedHost(SecurityUtils.getLoginUserId(), type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
/*
|
||||||
|
* 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.module.asset.controller;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.visor.framework.biz.operator.log.core.annotation.OperatorLog;
|
||||||
|
import org.dromara.visor.framework.log.core.annotation.IgnoreLog;
|
||||||
|
import org.dromara.visor.framework.log.core.enums.IgnoreLogMode;
|
||||||
|
import org.dromara.visor.framework.web.core.annotation.DemoDisableApi;
|
||||||
|
import org.dromara.visor.framework.web.core.annotation.RestWrapper;
|
||||||
|
import org.dromara.visor.module.asset.define.operator.HostOperatorType;
|
||||||
|
import org.dromara.visor.module.asset.entity.request.host.HostConfigQueryRequest;
|
||||||
|
import org.dromara.visor.module.asset.entity.request.host.HostConfigUpdateRequest;
|
||||||
|
import org.dromara.visor.module.asset.service.HostConfigService;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主机 api
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2023-9-11 14:16
|
||||||
|
*/
|
||||||
|
@Tag(name = "asset - 主机配置服务")
|
||||||
|
@Slf4j
|
||||||
|
@Validated
|
||||||
|
@RestWrapper
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/asset/host-config")
|
||||||
|
public class HostConfigController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private HostConfigService hostConfigService;
|
||||||
|
|
||||||
|
@DemoDisableApi
|
||||||
|
@OperatorLog(HostOperatorType.UPDATE_CONFIG)
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新主机配置")
|
||||||
|
@PreAuthorize("@ss.hasPermission('asset:host:update-config')")
|
||||||
|
public Integer updateHostConfig(@Validated @RequestBody HostConfigUpdateRequest request) {
|
||||||
|
return hostConfigService.updateHostConfig(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
@IgnoreLog(IgnoreLogMode.RET)
|
||||||
|
@PostMapping("/get")
|
||||||
|
@Operation(summary = "查询主机配置")
|
||||||
|
@PreAuthorize("@ss.hasPermission('asset:host:query')")
|
||||||
|
public Object getHostConfig(@Validated @RequestBody HostConfigQueryRequest request) {
|
||||||
|
return hostConfigService.getHostConfigView(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -35,8 +35,8 @@ import org.dromara.visor.framework.web.core.annotation.DemoDisableApi;
|
|||||||
import org.dromara.visor.framework.web.core.annotation.RestWrapper;
|
import org.dromara.visor.framework.web.core.annotation.RestWrapper;
|
||||||
import org.dromara.visor.module.asset.define.operator.HostOperatorType;
|
import org.dromara.visor.module.asset.define.operator.HostOperatorType;
|
||||||
import org.dromara.visor.module.asset.entity.request.host.*;
|
import org.dromara.visor.module.asset.entity.request.host.*;
|
||||||
import org.dromara.visor.module.asset.entity.vo.HostConfigVO;
|
|
||||||
import org.dromara.visor.module.asset.entity.vo.HostVO;
|
import org.dromara.visor.module.asset.entity.vo.HostVO;
|
||||||
|
import org.dromara.visor.module.asset.service.HostConnectService;
|
||||||
import org.dromara.visor.module.asset.service.HostService;
|
import org.dromara.visor.module.asset.service.HostService;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -63,6 +63,9 @@ public class HostController {
|
|||||||
@Resource
|
@Resource
|
||||||
private HostService hostService;
|
private HostService hostService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private HostConnectService hostConnectService;
|
||||||
|
|
||||||
@DemoDisableApi
|
@DemoDisableApi
|
||||||
@OperatorLog(HostOperatorType.CREATE)
|
@OperatorLog(HostOperatorType.CREATE)
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@@ -91,12 +94,12 @@ public class HostController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DemoDisableApi
|
@DemoDisableApi
|
||||||
@OperatorLog(HostOperatorType.UPDATE_CONFIG)
|
@OperatorLog(HostOperatorType.UPDATE_SPEC)
|
||||||
@PutMapping("/update-config")
|
@PutMapping("/update-spec")
|
||||||
@Operation(summary = "更新主机配置")
|
@Operation(summary = "修改主机规格信息")
|
||||||
@PreAuthorize("@ss.hasPermission('asset:host:update-config')")
|
@PreAuthorize("@ss.hasPermission('asset:host:update')")
|
||||||
public Integer updateHostConfig(@Validated @RequestBody HostUpdateConfigRequest request) {
|
public Integer updateHostSpec(@Validated @RequestBody HostExtraUpdateRequest request) {
|
||||||
return hostService.updateHostConfig(request);
|
return hostService.updateHostSpec(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@IgnoreLog(IgnoreLogMode.RET)
|
@IgnoreLog(IgnoreLogMode.RET)
|
||||||
@@ -108,15 +111,6 @@ public class HostController {
|
|||||||
return hostService.getHostById(id);
|
return hostService.getHostById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@IgnoreLog(IgnoreLogMode.RET)
|
|
||||||
@GetMapping("/get-config")
|
|
||||||
@Operation(summary = "查询主机配置")
|
|
||||||
@Parameter(name = "id", description = "id", required = true)
|
|
||||||
@PreAuthorize("@ss.hasPermission('asset:host:query')")
|
|
||||||
public HostConfigVO getHostConfig(@RequestParam("id") Long id) {
|
|
||||||
return hostService.getHostConfig(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@IgnoreLog(IgnoreLogMode.RET)
|
@IgnoreLog(IgnoreLogMode.RET)
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@Operation(summary = "查询主机")
|
@Operation(summary = "查询主机")
|
||||||
@@ -162,5 +156,14 @@ public class HostController {
|
|||||||
return hostService.deleteHostByIdList(idList);
|
return hostService.deleteHostByIdList(idList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DemoDisableApi
|
||||||
|
@PostMapping("/test-connect")
|
||||||
|
@Operation(summary = "测试主机连接")
|
||||||
|
@PreAuthorize("@ss.hasAnyPermission('asset:host:update', 'asset:host:update-config')")
|
||||||
|
public Boolean testHostConnect(@Validated @RequestBody HostTestConnectRequest request) {
|
||||||
|
hostConnectService.testHostConnect(request);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,11 +26,13 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.visor.common.constant.ErrorMessage;
|
||||||
|
import org.dromara.visor.common.utils.Valid;
|
||||||
import org.dromara.visor.framework.log.core.annotation.IgnoreLog;
|
import org.dromara.visor.framework.log.core.annotation.IgnoreLog;
|
||||||
import org.dromara.visor.framework.log.core.enums.IgnoreLogMode;
|
import org.dromara.visor.framework.log.core.enums.IgnoreLogMode;
|
||||||
import org.dromara.visor.framework.web.core.annotation.RestWrapper;
|
import org.dromara.visor.framework.web.core.annotation.RestWrapper;
|
||||||
import org.dromara.visor.module.asset.entity.request.host.HostExtraQueryRequest;
|
|
||||||
import org.dromara.visor.module.asset.entity.request.host.HostExtraUpdateRequest;
|
import org.dromara.visor.module.asset.entity.request.host.HostExtraUpdateRequest;
|
||||||
|
import org.dromara.visor.module.asset.enums.HostExtraItemEnum;
|
||||||
import org.dromara.visor.module.asset.service.HostExtraService;
|
import org.dromara.visor.module.asset.service.HostExtraService;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -61,20 +63,15 @@ public class HostExtraController {
|
|||||||
@Operation(summary = "获取主机拓展信息")
|
@Operation(summary = "获取主机拓展信息")
|
||||||
@Parameter(name = "hostId", description = "hostId", required = true)
|
@Parameter(name = "hostId", description = "hostId", required = true)
|
||||||
@Parameter(name = "item", description = "item", required = true)
|
@Parameter(name = "item", description = "item", required = true)
|
||||||
public Map<String, Object> getHostExtra(@RequestParam("hostId") Long hostId, @RequestParam("item") String item) {
|
public Map<String, Object> getHostExtraView(@RequestParam("hostId") Long hostId, @RequestParam("item") String item) {
|
||||||
return hostExtraService.getHostExtra(hostId, item);
|
return hostExtraService.getHostExtraView(hostId, item);
|
||||||
}
|
|
||||||
|
|
||||||
@IgnoreLog(IgnoreLogMode.RET)
|
|
||||||
@PostMapping("/list")
|
|
||||||
@Operation(summary = "获取多个主机拓展信息")
|
|
||||||
public Map<String, Map<String, Object>> getHostExtraList(@Validated @RequestBody HostExtraQueryRequest request) {
|
|
||||||
return hostExtraService.getHostExtraList(request);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "修改主机拓展信息")
|
@Operation(summary = "修改主机拓展信息")
|
||||||
public Integer updateHostExtra(@Validated @RequestBody HostExtraUpdateRequest request) {
|
public Integer updateHostExtra(@Validated @RequestBody HostExtraUpdateRequest request) {
|
||||||
|
HostExtraItemEnum item = Valid.valid(HostExtraItemEnum::of, request.getItem());
|
||||||
|
Valid.isTrue(item.isUserExtra(), ErrorMessage.PARAM_ERROR);
|
||||||
return hostExtraService.updateHostExtra(request);
|
return hostExtraService.updateHostExtra(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public class HostGroupController {
|
|||||||
@OperatorLog(HostGroupOperatorType.RENAME)
|
@OperatorLog(HostGroupOperatorType.RENAME)
|
||||||
@PutMapping("/rename")
|
@PutMapping("/rename")
|
||||||
@Operation(summary = "修改名称")
|
@Operation(summary = "修改名称")
|
||||||
@PreAuthorize("@ss.hasPermission('asset:host-group:update')")
|
@PreAuthorize("@ss.hasAnyPermission('asset:host-group:update', 'asset:host:query')")
|
||||||
public Integer updateHostGroupName(@Validated @RequestBody DataGroupRenameDTO request) {
|
public Integer updateHostGroupName(@Validated @RequestBody DataGroupRenameDTO request) {
|
||||||
return hostGroupService.updateHostGroupName(request);
|
return hostGroupService.updateHostGroupName(request);
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ public class HostGroupController {
|
|||||||
@GetMapping("/rel-list")
|
@GetMapping("/rel-list")
|
||||||
@Operation(summary = "查询分组内主机")
|
@Operation(summary = "查询分组内主机")
|
||||||
@Parameter(name = "groupId", description = "groupId", required = true)
|
@Parameter(name = "groupId", description = "groupId", required = true)
|
||||||
@PreAuthorize("@ss.hasPermission('asset:host-group:update')")
|
@PreAuthorize("@ss.hasAnyPermission('asset:host-group:update', 'asset:host:query')")
|
||||||
public Set<Long> queryHostGroupRel(@RequestParam("groupId") Long groupId) {
|
public Set<Long> queryHostGroupRel(@RequestParam("groupId") Long groupId) {
|
||||||
return hostGroupService.queryHostGroupRel(groupId);
|
return hostGroupService.queryHostGroupRel(groupId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.convert;
|
package org.dromara.visor.module.asset.convert;
|
||||||
|
|
||||||
|
import org.dromara.visor.common.mapstruct.StringConversion;
|
||||||
import org.dromara.visor.module.asset.entity.domain.HostDO;
|
import org.dromara.visor.module.asset.entity.domain.HostDO;
|
||||||
import org.dromara.visor.module.asset.entity.dto.HostCacheDTO;
|
import org.dromara.visor.module.asset.entity.dto.HostCacheDTO;
|
||||||
import org.dromara.visor.module.asset.entity.request.host.HostCreateRequest;
|
import org.dromara.visor.module.asset.entity.request.host.HostCreateRequest;
|
||||||
@@ -41,7 +42,7 @@ import java.util.List;
|
|||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @since 2023-9-11 14:16
|
* @since 2023-9-11 14:16
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper(uses = StringConversion.class)
|
||||||
public interface HostConvert {
|
public interface HostConvert {
|
||||||
|
|
||||||
HostConvert MAPPER = Mappers.getMapper(HostConvert.class);
|
HostConvert MAPPER = Mappers.getMapper(HostConvert.class);
|
||||||
|
|||||||
@@ -0,0 +1,122 @@
|
|||||||
|
/*
|
||||||
|
* 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.module.asset.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.dromara.visor.framework.mybatis.core.mapper.IMapper;
|
||||||
|
import org.dromara.visor.framework.mybatis.core.query.Conditions;
|
||||||
|
import org.dromara.visor.module.asset.entity.domain.HostConfigDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主机配置 Mapper 接口
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2025-3-6 10:59
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface HostConfigDAO extends IMapper<HostConfigDO> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过 hostId 和 type 查询
|
||||||
|
*
|
||||||
|
* @param hostId hostId
|
||||||
|
* @param type type
|
||||||
|
* @return config
|
||||||
|
*/
|
||||||
|
default HostConfigDO selectByHostIdType(Long hostId, String type) {
|
||||||
|
return this.of()
|
||||||
|
.createWrapper()
|
||||||
|
.eq(HostConfigDO::getHostId, hostId)
|
||||||
|
.eq(HostConfigDO::getType, type)
|
||||||
|
.then()
|
||||||
|
.getOne();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新配置状态
|
||||||
|
*
|
||||||
|
* @param hostId hostId
|
||||||
|
* @param types types
|
||||||
|
* @param status status
|
||||||
|
*/
|
||||||
|
default void updateConfigStatus(Long hostId, List<String> types, String status) {
|
||||||
|
HostConfigDO update = HostConfigDO.builder()
|
||||||
|
.status(status)
|
||||||
|
.build();
|
||||||
|
LambdaQueryWrapper<HostConfigDO> condition = this.wrapper()
|
||||||
|
.eq(HostConfigDO::getHostId, hostId)
|
||||||
|
.in(HostConfigDO::getType, types)
|
||||||
|
.ne(HostConfigDO::getStatus, status);
|
||||||
|
this.update(update, condition);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新配置状态
|
||||||
|
*
|
||||||
|
* @param hostId hostId
|
||||||
|
* @param notTypes notTypes
|
||||||
|
* @param status status
|
||||||
|
*/
|
||||||
|
default void updateConfigInvertStatus(Long hostId, List<String> notTypes, String status) {
|
||||||
|
HostConfigDO update = HostConfigDO.builder()
|
||||||
|
.status(status)
|
||||||
|
.build();
|
||||||
|
LambdaQueryWrapper<HostConfigDO> condition = this.wrapper()
|
||||||
|
.eq(HostConfigDO::getHostId, hostId)
|
||||||
|
.notIn(HostConfigDO::getType, notTypes)
|
||||||
|
.ne(HostConfigDO::getStatus, status);
|
||||||
|
this.update(update, condition);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过 hostId 删除
|
||||||
|
*
|
||||||
|
* @param hostIdList hostIdList
|
||||||
|
* @return effect
|
||||||
|
*/
|
||||||
|
default int deleteByHostIdList(List<Long> hostIdList) {
|
||||||
|
return this.delete(Conditions.in(HostConfigDO::getHostId, hostIdList));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置 keyId 为 NULL
|
||||||
|
*
|
||||||
|
* @param keyIdList keyIdList
|
||||||
|
* @return effect
|
||||||
|
*/
|
||||||
|
int setKeyIdWithNull(@Param("keyIdList") List<Long> keyIdList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置 identityId 为 NULL
|
||||||
|
*
|
||||||
|
* @param identityIdList identityIdList
|
||||||
|
* @return effect
|
||||||
|
*/
|
||||||
|
int setIdentityIdWithNull(@Param("identityIdList") List<Long> identityIdList);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -22,13 +22,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.dao;
|
package org.dromara.visor.module.asset.dao;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.dromara.visor.framework.mybatis.core.mapper.IMapper;
|
import org.dromara.visor.framework.mybatis.core.mapper.IMapper;
|
||||||
import org.dromara.visor.module.asset.entity.domain.HostDO;
|
import org.dromara.visor.module.asset.entity.domain.HostDO;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,54 +38,8 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface HostDAO extends IMapper<HostDO> {
|
public interface HostDAO extends IMapper<HostDO> {
|
||||||
|
|
||||||
List<SFunction<HostDO, ?>> BASE_COLUMN = Arrays.asList(
|
|
||||||
HostDO::getId,
|
|
||||||
HostDO::getType,
|
|
||||||
HostDO::getOsType,
|
|
||||||
HostDO::getName,
|
|
||||||
HostDO::getCode,
|
|
||||||
HostDO::getAddress,
|
|
||||||
HostDO::getPort,
|
|
||||||
HostDO::getStatus,
|
|
||||||
HostDO::getDescription,
|
|
||||||
HostDO::getCreateTime,
|
|
||||||
HostDO::getUpdateTime,
|
|
||||||
HostDO::getCreator,
|
|
||||||
HostDO::getUpdater
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过 id 查询基本信息
|
* 通过类型查询 hostId
|
||||||
*
|
|
||||||
* @param id id
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
default HostDO selectBaseById(Long id) {
|
|
||||||
return this.of()
|
|
||||||
.createWrapper()
|
|
||||||
.select(BASE_COLUMN)
|
|
||||||
.eq(HostDO::getId, id)
|
|
||||||
.then()
|
|
||||||
.getOne();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过 id 查询基本信息
|
|
||||||
*
|
|
||||||
* @param idList idList
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
default List<HostDO> selectBaseByIdList(List<Long> idList) {
|
|
||||||
return this.of()
|
|
||||||
.createWrapper()
|
|
||||||
.select(BASE_COLUMN)
|
|
||||||
.in(HostDO::getId, idList)
|
|
||||||
.then()
|
|
||||||
.list();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取的 hostId
|
|
||||||
*
|
*
|
||||||
* @param hostIdList hostIdList
|
* @param hostIdList hostIdList
|
||||||
* @param type type
|
* @param type type
|
||||||
@@ -100,26 +51,10 @@ public interface HostDAO extends IMapper<HostDO> {
|
|||||||
.createWrapper(true)
|
.createWrapper(true)
|
||||||
.select(HostDO::getId)
|
.select(HostDO::getId)
|
||||||
.in(HostDO::getId, hostIdList)
|
.in(HostDO::getId, hostIdList)
|
||||||
.eq(HostDO::getType, type)
|
|
||||||
.eq(HostDO::getStatus, status)
|
.eq(HostDO::getStatus, status)
|
||||||
|
.like(HostDO::getTypes, type)
|
||||||
.then()
|
.then()
|
||||||
.list(HostDO::getId);
|
.list(HostDO::getId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置 keyId 为 NULL
|
|
||||||
*
|
|
||||||
* @param keyIdList keyIdList
|
|
||||||
* @return effect
|
|
||||||
*/
|
|
||||||
int setKeyIdWithNull(@Param("keyIdList") List<Long> keyIdList);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置 identityId 为 NULL
|
|
||||||
*
|
|
||||||
* @param identityIdList identityIdList
|
|
||||||
* @return effect
|
|
||||||
*/
|
|
||||||
int setIdentityIdWithNull(@Param("identityIdList") List<Long> identityIdList);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,17 @@ public interface TerminalConnectLogDAO extends IMapper<TerminalConnectLogDO> {
|
|||||||
* @param limit limit
|
* @param limit limit
|
||||||
* @return hostId
|
* @return hostId
|
||||||
*/
|
*/
|
||||||
List<Long> selectLatestConnectHostId(@Param("userId") Long userId, @Param("type") String type, @Param("limit") Integer limit);
|
default List<Long> selectLatestConnectHostId(Long userId, String type, Integer limit) {
|
||||||
|
return this.of()
|
||||||
|
.createWrapper(true)
|
||||||
|
.select(TerminalConnectLogDO::getHostId)
|
||||||
|
.eq(TerminalConnectLogDO::getUserId, userId)
|
||||||
|
.eq(TerminalConnectLogDO::getType, type)
|
||||||
|
.orderByDesc(TerminalConnectLogDO::getId)
|
||||||
|
.then()
|
||||||
|
.limit(limit)
|
||||||
|
.list(TerminalConnectLogDO::getHostId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询终端连接日志用户数量
|
* 查询终端连接日志用户数量
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ public class HostOperatorType extends InitializingOperatorTypes {
|
|||||||
|
|
||||||
public static final String UPDATE_CONFIG = "host:update-config";
|
public static final String UPDATE_CONFIG = "host:update-config";
|
||||||
|
|
||||||
|
public static final String UPDATE_SPEC = "host:update-spec";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OperatorType[] types() {
|
public OperatorType[] types() {
|
||||||
return new OperatorType[]{
|
return new OperatorType[]{
|
||||||
@@ -56,6 +58,7 @@ public class HostOperatorType extends InitializingOperatorTypes {
|
|||||||
new OperatorType(H, DELETE, "删除主机 <sb>${count}</sb> 条"),
|
new OperatorType(H, DELETE, "删除主机 <sb>${count}</sb> 条"),
|
||||||
new OperatorType(M, UPDATE_STATUS, "修改主机状态 <sb>${name}</sb> - <sb>${status}</sb>"),
|
new OperatorType(M, UPDATE_STATUS, "修改主机状态 <sb>${name}</sb> - <sb>${status}</sb>"),
|
||||||
new OperatorType(M, UPDATE_CONFIG, "修改主机配置 <sb>${name}</sb>"),
|
new OperatorType(M, UPDATE_CONFIG, "修改主机配置 <sb>${name}</sb>"),
|
||||||
|
new OperatorType(M, UPDATE_SPEC, "修改主机规格信息 <sb>${name}</sb>"),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,12 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.entity.domain;
|
package org.dromara.visor.module.asset.entity.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,7 +40,7 @@ import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
|||||||
* @since 2024-1-22 15:28
|
* @since 2024-1-22 15:28
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@@ -48,10 +50,6 @@ public class CommandSnippetDO extends BaseDO {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "id")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "用户id")
|
@Schema(description = "用户id")
|
||||||
@TableField("user_id")
|
@TableField("user_id")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|||||||
@@ -22,12 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.entity.domain;
|
package org.dromara.visor.module.asset.entity.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -40,7 +42,7 @@ import java.util.Date;
|
|||||||
* @since 2024-3-11 14:05
|
* @since 2024-3-11 14:05
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@@ -50,10 +52,6 @@ public class ExecHostLogDO extends BaseDO {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "id")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "执行日志id")
|
@Schema(description = "执行日志id")
|
||||||
@TableField("log_id")
|
@TableField("log_id")
|
||||||
private Long logId;
|
private Long logId;
|
||||||
|
|||||||
@@ -22,12 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.entity.domain;
|
package org.dromara.visor.module.asset.entity.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,7 +40,7 @@ import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
|||||||
* @since 2024-3-28 12:03
|
* @since 2024-3-28 12:03
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@@ -48,10 +50,6 @@ public class ExecJobDO extends BaseDO {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "id")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "任务名称")
|
@Schema(description = "任务名称")
|
||||||
@TableField("name")
|
@TableField("name")
|
||||||
private String name;
|
private String name;
|
||||||
|
|||||||
@@ -22,12 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.entity.domain;
|
package org.dromara.visor.module.asset.entity.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,7 +40,7 @@ import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
|||||||
* @since 2024-3-28 12:03
|
* @since 2024-3-28 12:03
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@@ -48,10 +50,6 @@ public class ExecJobHostDO extends BaseDO {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "id")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "任务id")
|
@Schema(description = "任务id")
|
||||||
@TableField("job_id")
|
@TableField("job_id")
|
||||||
private Long jobId;
|
private Long jobId;
|
||||||
|
|||||||
@@ -22,12 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.entity.domain;
|
package org.dromara.visor.module.asset.entity.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -40,7 +42,7 @@ import java.util.Date;
|
|||||||
* @since 2024-3-11 11:31
|
* @since 2024-3-11 11:31
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@@ -50,10 +52,6 @@ public class ExecLogDO extends BaseDO {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "id")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "执行用户id")
|
@Schema(description = "执行用户id")
|
||||||
@TableField("user_id")
|
@TableField("user_id")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|||||||
@@ -22,12 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.entity.domain;
|
package org.dromara.visor.module.asset.entity.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,7 +40,7 @@ import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
|||||||
* @since 2024-3-7 18:08
|
* @since 2024-3-7 18:08
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@@ -48,10 +50,6 @@ public class ExecTemplateDO extends BaseDO {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "id")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "名称")
|
@Schema(description = "名称")
|
||||||
@TableField("name")
|
@TableField("name")
|
||||||
private String name;
|
private String name;
|
||||||
|
|||||||
@@ -22,12 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.entity.domain;
|
package org.dromara.visor.module.asset.entity.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,7 +40,7 @@ import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
|||||||
* @since 2024-4-22 12:13
|
* @since 2024-4-22 12:13
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@@ -48,10 +50,6 @@ public class ExecTemplateHostDO extends BaseDO {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "id")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "模板id")
|
@Schema(description = "模板id")
|
||||||
@TableField("template_id")
|
@TableField("template_id")
|
||||||
private Long templateId;
|
private Long templateId;
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* 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.module.asset.entity.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主机配置 实体对象
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2025-3-6 10:59
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName(value = "host_config", autoResultMap = true)
|
||||||
|
@Schema(name = "HostConfigDO", description = "主机配置 实体对象")
|
||||||
|
public class HostConfigDO extends BaseDO {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Schema(description = "主机id")
|
||||||
|
@TableField("host_id")
|
||||||
|
private Long hostId;
|
||||||
|
|
||||||
|
@Schema(description = "配置类型")
|
||||||
|
@TableField("type")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "配置状态")
|
||||||
|
@TableField("status")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "配置值")
|
||||||
|
@TableField("config")
|
||||||
|
private String config;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -22,12 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.entity.domain;
|
package org.dromara.visor.module.asset.entity.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,7 +40,7 @@ import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
|||||||
* @since 2023-9-11 14:16
|
* @since 2023-9-11 14:16
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@@ -48,18 +50,18 @@ public class HostDO extends BaseDO {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "id")
|
@Schema(description = "类型")
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableField("types")
|
||||||
private Long id;
|
private String types;
|
||||||
|
|
||||||
@Schema(description = "主机类型")
|
|
||||||
@TableField("type")
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
@Schema(description = "系统类型")
|
@Schema(description = "系统类型")
|
||||||
@TableField("os_type")
|
@TableField("os_type")
|
||||||
private String osType;
|
private String osType;
|
||||||
|
|
||||||
|
@Schema(description = "系统架构")
|
||||||
|
@TableField("arch_type")
|
||||||
|
private String archType;
|
||||||
|
|
||||||
@Schema(description = "主机名称")
|
@Schema(description = "主机名称")
|
||||||
@TableField("name")
|
@TableField("name")
|
||||||
private String name;
|
private String name;
|
||||||
@@ -72,19 +74,11 @@ public class HostDO extends BaseDO {
|
|||||||
@TableField("address")
|
@TableField("address")
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
@Schema(description = "主机端口")
|
|
||||||
@TableField("port")
|
|
||||||
private Integer port;
|
|
||||||
|
|
||||||
@Schema(description = "主机状态")
|
@Schema(description = "主机状态")
|
||||||
@TableField("status")
|
@TableField("status")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
@Schema(description = "主机配置")
|
@Schema(description = "主机描述")
|
||||||
@TableField("config")
|
|
||||||
private String config;
|
|
||||||
|
|
||||||
@Schema(description = "描述")
|
|
||||||
@TableField("description")
|
@TableField("description")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
|||||||
@@ -22,12 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.entity.domain;
|
package org.dromara.visor.module.asset.entity.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,7 +40,7 @@ import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
|||||||
* @since 2023-9-20 11:55
|
* @since 2023-9-20 11:55
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@@ -48,10 +50,6 @@ public class HostIdentityDO extends BaseDO {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "id")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "名称")
|
@Schema(description = "名称")
|
||||||
@TableField("name")
|
@TableField("name")
|
||||||
private String name;
|
private String name;
|
||||||
|
|||||||
@@ -22,12 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.entity.domain;
|
package org.dromara.visor.module.asset.entity.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,7 +40,7 @@ import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
|||||||
* @since 2023-9-20 11:55
|
* @since 2023-9-20 11:55
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@@ -48,10 +50,6 @@ public class HostKeyDO extends BaseDO {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "id")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "名称")
|
@Schema(description = "名称")
|
||||||
@TableField("name")
|
@TableField("name")
|
||||||
private String name;
|
private String name;
|
||||||
|
|||||||
@@ -22,12 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.entity.domain;
|
package org.dromara.visor.module.asset.entity.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,7 +40,7 @@ import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
|||||||
* @since 2024-4-23 23:15
|
* @since 2024-4-23 23:15
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@@ -48,10 +50,6 @@ public class PathBookmarkDO extends BaseDO {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "id")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "用户id")
|
@Schema(description = "用户id")
|
||||||
@TableField("user_id")
|
@TableField("user_id")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|||||||
@@ -22,12 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.entity.domain;
|
package org.dromara.visor.module.asset.entity.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -40,7 +42,7 @@ import java.util.Date;
|
|||||||
* @since 2023-12-26 22:09
|
* @since 2023-12-26 22:09
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@@ -50,10 +52,6 @@ public class TerminalConnectLogDO extends BaseDO {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "id")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "用户id")
|
@Schema(description = "用户id")
|
||||||
@TableField("user_id")
|
@TableField("user_id")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|||||||
@@ -22,12 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.entity.domain;
|
package org.dromara.visor.module.asset.entity.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -40,7 +42,7 @@ import java.util.Date;
|
|||||||
* @since 2024-5-7 22:15
|
* @since 2024-5-7 22:15
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@@ -50,10 +52,6 @@ public class UploadTaskDO extends BaseDO {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "id")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "用户id")
|
@Schema(description = "用户id")
|
||||||
@TableField("user_id")
|
@TableField("user_id")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|||||||
@@ -22,12 +22,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.entity.domain;
|
package org.dromara.visor.module.asset.entity.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
import org.dromara.visor.framework.mybatis.core.domain.BaseDO;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -40,7 +42,7 @@ import java.util.Date;
|
|||||||
* @since 2024-5-8 10:31
|
* @since 2024-5-8 10:31
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@@ -50,10 +52,6 @@ public class UploadTaskFileDO extends BaseDO {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "id")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "用户id")
|
@Schema(description = "用户id")
|
||||||
@TableField("task_id")
|
@TableField("task_id")
|
||||||
private Long taskId;
|
private Long taskId;
|
||||||
|
|||||||
@@ -49,11 +49,14 @@ public class HostCacheDTO implements LongCacheIdModel, Serializable {
|
|||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Schema(description = "主机类型")
|
@Schema(description = "主机类型")
|
||||||
private String type;
|
private String types;
|
||||||
|
|
||||||
@Schema(description = "系统类型")
|
@Schema(description = "系统类型")
|
||||||
private String osType;
|
private String osType;
|
||||||
|
|
||||||
|
@Schema(description = "系统架构")
|
||||||
|
private String archType;
|
||||||
|
|
||||||
@Schema(description = "主机名称")
|
@Schema(description = "主机名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@@ -69,7 +72,7 @@ public class HostCacheDTO implements LongCacheIdModel, Serializable {
|
|||||||
@Schema(description = "主机状态")
|
@Schema(description = "主机状态")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
@Schema(description = "描述")
|
@Schema(description = "主机描述")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,6 +69,9 @@ public class TerminalConnectDTO {
|
|||||||
@Schema(description = "系统类型")
|
@Schema(description = "系统类型")
|
||||||
private String osType;
|
private String osType;
|
||||||
|
|
||||||
|
@Schema(description = "系统架构")
|
||||||
|
private String archType;
|
||||||
|
|
||||||
@Schema(description = "超时时间")
|
@Schema(description = "超时时间")
|
||||||
private Integer timeout;
|
private Integer timeout;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package org.dromara.visor.module.asset.entity.request.exec;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.dromara.visor.common.entity.PageRequest;
|
import org.dromara.visor.common.entity.BaseQueryRequest;
|
||||||
|
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ import javax.validation.constraints.Size;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "ExecJobQueryRequest", description = "计划任务 查询请求对象")
|
@Schema(name = "ExecJobQueryRequest", description = "计划任务 查询请求对象")
|
||||||
public class ExecJobQueryRequest extends PageRequest {
|
public class ExecJobQueryRequest extends BaseQueryRequest {
|
||||||
|
|
||||||
@Schema(description = "id")
|
@Schema(description = "id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package org.dromara.visor.module.asset.entity.request.exec;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.dromara.visor.common.entity.PageRequest;
|
import org.dromara.visor.common.entity.BaseQueryRequest;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ import javax.validation.constraints.NotNull;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "ExecJobUpdateExecUserRequest", description = "修改计划任务执行用户 查询请求对象")
|
@Schema(name = "ExecJobUpdateExecUserRequest", description = "修改计划任务执行用户 查询请求对象")
|
||||||
public class ExecJobUpdateExecUserRequest extends PageRequest {
|
public class ExecJobUpdateExecUserRequest extends BaseQueryRequest {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Schema(description = "id")
|
@Schema(description = "id")
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ package org.dromara.visor.module.asset.entity.request.exec;
|
|||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.dromara.visor.common.entity.PageRequest;
|
import org.dromara.visor.common.entity.BaseQueryRequest;
|
||||||
|
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -44,7 +44,7 @@ import java.util.List;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "ExecLogQueryRequest", description = "批量执行日志 查询请求对象")
|
@Schema(name = "ExecLogQueryRequest", description = "批量执行日志 查询请求对象")
|
||||||
public class ExecLogQueryRequest extends PageRequest {
|
public class ExecLogQueryRequest extends BaseQueryRequest {
|
||||||
|
|
||||||
@Schema(description = "id")
|
@Schema(description = "id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package org.dromara.visor.module.asset.entity.request.exec;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.dromara.visor.common.entity.PageRequest;
|
import org.dromara.visor.common.entity.BaseQueryRequest;
|
||||||
|
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ import javax.validation.constraints.Size;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "ExecTemplateQueryRequest", description = "执行模板 查询请求对象")
|
@Schema(name = "ExecTemplateQueryRequest", description = "执行模板 查询请求对象")
|
||||||
public class ExecTemplateQueryRequest extends PageRequest {
|
public class ExecTemplateQueryRequest extends BaseQueryRequest {
|
||||||
|
|
||||||
@Schema(description = "id")
|
@Schema(description = "id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|||||||
@@ -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.module.asset.entity.request.host;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import org.dromara.visor.common.entity.BaseQueryRequest;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主机配置 查询请求对象
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2025-3-6 10:59
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Schema(name = "HostConfigQueryRequest", description = "主机配置 查询请求对象")
|
||||||
|
public class HostConfigQueryRequest extends BaseQueryRequest {
|
||||||
|
|
||||||
|
@Schema(description = "主机id")
|
||||||
|
private Long hostId;
|
||||||
|
|
||||||
|
@Size(max = 12)
|
||||||
|
@Schema(description = "配置类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.module.asset.entity.request.host;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主机配置 更新请求对象
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2025-3-6 10:59
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Schema(name = "HostConfigUpdateRequest", description = "主机配置 更新请求对象")
|
||||||
|
public class HostConfigUpdateRequest implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Schema(description = "主机id")
|
||||||
|
private Long hostId;
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
@Size(max = 12)
|
||||||
|
@Schema(description = "配置类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
@Schema(description = "配置值")
|
||||||
|
private String config;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -28,9 +28,8 @@ import lombok.Builder;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import javax.validation.constraints.Max;
|
|
||||||
import javax.validation.constraints.Min;
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -49,15 +48,20 @@ import java.util.List;
|
|||||||
@Schema(name = "HostCreateRequest", description = "主机 创建请求对象")
|
@Schema(name = "HostCreateRequest", description = "主机 创建请求对象")
|
||||||
public class HostCreateRequest implements Serializable {
|
public class HostCreateRequest implements Serializable {
|
||||||
|
|
||||||
@NotBlank
|
@NotEmpty
|
||||||
@Schema(description = "主机类型")
|
@Schema(description = "主机类型")
|
||||||
private String type;
|
private List<String> types;
|
||||||
|
|
||||||
@NotBlank
|
|
||||||
@Size(max = 12)
|
@Size(max = 12)
|
||||||
|
@NotBlank
|
||||||
@Schema(description = "系统类型")
|
@Schema(description = "系统类型")
|
||||||
private String osType;
|
private String osType;
|
||||||
|
|
||||||
|
@Size(max = 12)
|
||||||
|
@NotBlank
|
||||||
|
@Schema(description = "系统架构")
|
||||||
|
private String archType;
|
||||||
|
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Size(max = 64)
|
@Size(max = 64)
|
||||||
@Schema(description = "主机名称")
|
@Schema(description = "主机名称")
|
||||||
@@ -73,11 +77,7 @@ public class HostCreateRequest implements Serializable {
|
|||||||
@Schema(description = "主机地址")
|
@Schema(description = "主机地址")
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
@Min(value = 1)
|
@NotEmpty
|
||||||
@Max(value = 65535)
|
|
||||||
@Schema(description = "主机端口")
|
|
||||||
private Integer port;
|
|
||||||
|
|
||||||
@Schema(description = "主机分组")
|
@Schema(description = "主机分组")
|
||||||
private List<Long> groupIdList;
|
private List<Long> groupIdList;
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ public class HostExtraUpdateRequest {
|
|||||||
@Schema(description = "主机id")
|
@Schema(description = "主机id")
|
||||||
private Long hostId;
|
private Long hostId;
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Schema(description = "配置项")
|
@Schema(description = "配置项")
|
||||||
private String item;
|
private String item;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package org.dromara.visor.module.asset.entity.request.host;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.dromara.visor.common.entity.PageRequest;
|
import org.dromara.visor.common.entity.BaseQueryRequest;
|
||||||
|
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ import javax.validation.constraints.Size;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "HostIdentityQueryRequest", description = "主机身份 查询请求对象")
|
@Schema(name = "HostIdentityQueryRequest", description = "主机身份 查询请求对象")
|
||||||
public class HostIdentityQueryRequest extends PageRequest {
|
public class HostIdentityQueryRequest extends BaseQueryRequest {
|
||||||
|
|
||||||
@Schema(description = "搜索")
|
@Schema(description = "搜索")
|
||||||
private String searchValue;
|
private String searchValue;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package org.dromara.visor.module.asset.entity.request.host;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.dromara.visor.common.entity.PageRequest;
|
import org.dromara.visor.common.entity.BaseQueryRequest;
|
||||||
|
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ import javax.validation.constraints.Size;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "HostKeyQueryRequest", description = "主机密钥 查询请求对象")
|
@Schema(name = "HostKeyQueryRequest", description = "主机密钥 查询请求对象")
|
||||||
public class HostKeyQueryRequest extends PageRequest {
|
public class HostKeyQueryRequest extends BaseQueryRequest {
|
||||||
|
|
||||||
@Schema(description = "搜索")
|
@Schema(description = "搜索")
|
||||||
private String searchValue;
|
private String searchValue;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ package org.dromara.visor.module.asset.entity.request.host;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.dromara.visor.common.entity.PageRequest;
|
import org.dromara.visor.common.entity.BaseQueryRequest;
|
||||||
|
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -42,7 +42,7 @@ import java.util.List;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "HostQueryRequest", description = "主机 查询请求对象")
|
@Schema(name = "HostQueryRequest", description = "主机 查询请求对象")
|
||||||
public class HostQueryRequest extends PageRequest {
|
public class HostQueryRequest extends BaseQueryRequest {
|
||||||
|
|
||||||
@Schema(description = "搜索")
|
@Schema(description = "搜索")
|
||||||
private String searchValue;
|
private String searchValue;
|
||||||
@@ -50,6 +50,10 @@ public class HostQueryRequest extends PageRequest {
|
|||||||
@Schema(description = "id")
|
@Schema(description = "id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@Size(max = 8)
|
||||||
|
@Schema(description = "主机类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
@Size(max = 64)
|
@Size(max = 64)
|
||||||
@Schema(description = "主机名称")
|
@Schema(description = "主机名称")
|
||||||
private String name;
|
private String name;
|
||||||
@@ -62,14 +66,14 @@ public class HostQueryRequest extends PageRequest {
|
|||||||
@Schema(description = "主机地址")
|
@Schema(description = "主机地址")
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
@Size(max = 8)
|
|
||||||
@Schema(description = "主机类型")
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
@Size(max = 12)
|
@Size(max = 12)
|
||||||
@Schema(description = "系统类型")
|
@Schema(description = "系统类型")
|
||||||
private String osType;
|
private String osType;
|
||||||
|
|
||||||
|
@Size(max = 12)
|
||||||
|
@Schema(description = "系统架构")
|
||||||
|
private String archType;
|
||||||
|
|
||||||
@Size(max = 8)
|
@Size(max = 8)
|
||||||
@Schema(description = "主机状态")
|
@Schema(description = "主机状态")
|
||||||
private String status;
|
private String status;
|
||||||
@@ -81,7 +85,13 @@ public class HostQueryRequest extends PageRequest {
|
|||||||
@Schema(description = "描述")
|
@Schema(description = "描述")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "是否查询分组信息")
|
||||||
|
private Boolean queryGroup;
|
||||||
|
|
||||||
@Schema(description = "是否查询 tag 信息")
|
@Schema(description = "是否查询 tag 信息")
|
||||||
private Boolean queryTag;
|
private Boolean queryTag;
|
||||||
|
|
||||||
|
@Schema(description = "是否查询规格信息")
|
||||||
|
private Boolean querySpec;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.dromara.visor.module.asset.entity.vo;
|
package org.dromara.visor.module.asset.entity.request.host;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -28,29 +28,29 @@ import lombok.Builder;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.Map;
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主机配置 视图响应对象
|
* 主机 测试连接请求对象
|
||||||
*
|
*
|
||||||
* @author Jiahang Li
|
* @author Jiahang Li
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @since 2023/9/11 17:58
|
* @since 2023-9-11 14:16
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Schema(name = "HostConfigVO", description = "主机配置 视图响应对象")
|
@Schema(name = "HostTestConnectRequest", description = "主机 测试连接请求对象")
|
||||||
public class HostConfigVO {
|
public class HostTestConnectRequest {
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Schema(description = "id")
|
@Schema(description = "id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Schema(description = "type")
|
@NotBlank
|
||||||
|
@Schema(description = "主机类型")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
@Schema(description = "config")
|
|
||||||
private Map<String, Object> config;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,10 @@ import lombok.Builder;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -55,6 +58,11 @@ public class HostUpdateRequest implements Serializable {
|
|||||||
@Schema(description = "系统类型")
|
@Schema(description = "系统类型")
|
||||||
private String osType;
|
private String osType;
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
@Size(max = 12)
|
||||||
|
@Schema(description = "系统架构")
|
||||||
|
private String archType;
|
||||||
|
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Size(max = 64)
|
@Size(max = 64)
|
||||||
@Schema(description = "主机名称")
|
@Schema(description = "主机名称")
|
||||||
@@ -70,12 +78,11 @@ public class HostUpdateRequest implements Serializable {
|
|||||||
@Schema(description = "主机地址")
|
@Schema(description = "主机地址")
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
@NotNull
|
@NotEmpty
|
||||||
@Min(value = 1)
|
@Schema(description = "主机类型")
|
||||||
@Max(value = 65535)
|
private List<String> types;
|
||||||
@Schema(description = "主机端口")
|
|
||||||
private Integer port;
|
|
||||||
|
|
||||||
|
@NotEmpty
|
||||||
@Schema(description = "主机分组")
|
@Schema(description = "主机分组")
|
||||||
private List<Long> groupIdList;
|
private List<Long> groupIdList;
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ package org.dromara.visor.module.asset.entity.request.host;
|
|||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.dromara.visor.common.entity.PageRequest;
|
import org.dromara.visor.common.entity.BaseQueryRequest;
|
||||||
import org.dromara.visor.common.validator.group.Id;
|
import org.dromara.visor.common.validator.group.Id;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
@@ -46,7 +46,7 @@ import java.util.List;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "TerminalConnectLogQueryRequest", description = "终端连接日志 查询请求对象")
|
@Schema(name = "TerminalConnectLogQueryRequest", description = "终端连接日志 查询请求对象")
|
||||||
public class TerminalConnectLogQueryRequest extends PageRequest {
|
public class TerminalConnectLogQueryRequest extends BaseQueryRequest {
|
||||||
|
|
||||||
@NotNull(groups = Id.class)
|
@NotNull(groups = Id.class)
|
||||||
@Schema(description = "id")
|
@Schema(description = "id")
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ package org.dromara.visor.module.asset.entity.request.host;
|
|||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.dromara.visor.common.entity.PageRequest;
|
import org.dromara.visor.common.entity.BaseQueryRequest;
|
||||||
|
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -43,7 +43,7 @@ import java.util.Date;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "TerminalSftpLogQueryRequest", description = "SFTP 操作日志 查询请求对象")
|
@Schema(name = "TerminalSftpLogQueryRequest", description = "SFTP 操作日志 查询请求对象")
|
||||||
public class TerminalSftpLogQueryRequest extends PageRequest {
|
public class TerminalSftpLogQueryRequest extends BaseQueryRequest {
|
||||||
|
|
||||||
@Schema(description = "用户id")
|
@Schema(description = "用户id")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ package org.dromara.visor.module.asset.entity.request.upload;
|
|||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.dromara.visor.common.entity.PageRequest;
|
import org.dromara.visor.common.entity.BaseQueryRequest;
|
||||||
|
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -43,7 +43,7 @@ import java.util.Date;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Schema(name = "UploadTaskQueryRequest", description = "上传任务 查询请求对象")
|
@Schema(name = "UploadTaskQueryRequest", description = "上传任务 查询请求对象")
|
||||||
public class UploadTaskQueryRequest extends PageRequest {
|
public class UploadTaskQueryRequest extends BaseQueryRequest {
|
||||||
|
|
||||||
@Schema(description = "id")
|
@Schema(description = "id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import lombok.Data;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计划任务主机 视图响应对象
|
* 计划任务主机 视图响应对象
|
||||||
@@ -56,16 +55,4 @@ public class ExecJobHostVO implements Serializable {
|
|||||||
@Schema(description = "主机id")
|
@Schema(description = "主机id")
|
||||||
private Long hostId;
|
private Long hostId;
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
@Schema(description = "修改时间")
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
@Schema(description = "创建人")
|
|
||||||
private String creator;
|
|
||||||
|
|
||||||
@Schema(description = "修改人")
|
|
||||||
private String updater;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,12 @@ public class ExecJobVO implements Serializable {
|
|||||||
@Schema(description = "修改时间")
|
@Schema(description = "修改时间")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
@Schema(description = "修改人")
|
||||||
|
private String updater;
|
||||||
|
|
||||||
@Schema(description = "执行主机")
|
@Schema(description = "执行主机")
|
||||||
private List<Long> hostIdList;
|
private List<Long> hostIdList;
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user