Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
@@ -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.5
|
set -e
|
||||||
|
version=2.3.7
|
||||||
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.5
|
set -e
|
||||||
|
version=2.3.7
|
||||||
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.5
|
set -e
|
||||||
|
version=2.3.7
|
||||||
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.5
|
set -e
|
||||||
|
version=2.3.7
|
||||||
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.5
|
set -e
|
||||||
|
version=2.3.7
|
||||||
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.7
|
||||||
|
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";
|
||||||
@@ -36,7 +36,7 @@ public interface AppConst extends OrionConst {
|
|||||||
/**
|
/**
|
||||||
* 同 ${orion.version} 迭代时候需要手动更改
|
* 同 ${orion.version} 迭代时候需要手动更改
|
||||||
*/
|
*/
|
||||||
String VERSION = "2.3.5";
|
String VERSION = "2.3.7";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同 ${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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.5</revision>
|
<revision>2.3.7</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,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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ const fieldConfig = {
|
|||||||
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()
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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.4";
|
private static final String TARGET_VERSION = "2.3.6";
|
||||||
|
|
||||||
private static final String REPLACE_VERSION = "2.3.5";
|
private static final String REPLACE_VERSION = "2.3.7";
|
||||||
|
|
||||||
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"
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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")
|
||||||
@@ -90,15 +93,6 @@ public class HostController {
|
|||||||
return hostService.updateHostStatus(request);
|
return hostService.updateHostStatus(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DemoDisableApi
|
|
||||||
@OperatorLog(HostOperatorType.UPDATE_CONFIG)
|
|
||||||
@PutMapping("/update-config")
|
|
||||||
@Operation(summary = "更新主机配置")
|
|
||||||
@PreAuthorize("@ss.hasPermission('asset:host:update-config')")
|
|
||||||
public Integer updateHostConfig(@Validated @RequestBody HostUpdateConfigRequest request) {
|
|
||||||
return hostService.updateHostConfig(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
@IgnoreLog(IgnoreLogMode.RET)
|
@IgnoreLog(IgnoreLogMode.RET)
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "通过 id 查询主机")
|
@Operation(summary = "通过 id 查询主机")
|
||||||
@@ -108,15 +102,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 +147,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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
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.service.HostExtraService;
|
import org.dromara.visor.module.asset.service.HostExtraService;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -61,15 +60,8 @@ 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")
|
||||||
|
|||||||
@@ -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);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import lombok.Data;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主机基本信息 视图响应对象
|
* 主机基本信息 视图响应对象
|
||||||
@@ -50,7 +51,7 @@ public class HostBaseVO implements Serializable {
|
|||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Schema(description = "主机类型")
|
@Schema(description = "主机类型")
|
||||||
private String type;
|
private List<String> types;
|
||||||
|
|
||||||
@Schema(description = "主机名称")
|
@Schema(description = "主机名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.dromara.visor.module.asset.handler.host.extra.model.HostSpecExtraModel;
|
||||||
import org.dromara.visor.module.infra.entity.dto.tag.TagDTO;
|
import org.dromara.visor.module.infra.entity.dto.tag.TagDTO;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -54,11 +55,14 @@ public class HostVO implements Serializable {
|
|||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Schema(description = "主机类型")
|
@Schema(description = "主机类型")
|
||||||
private String type;
|
private List<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;
|
||||||
|
|
||||||
@@ -104,4 +108,7 @@ public class HostVO implements Serializable {
|
|||||||
@Schema(description = "颜色")
|
@Schema(description = "颜色")
|
||||||
private String color;
|
private String color;
|
||||||
|
|
||||||
|
@Schema(description = "规格")
|
||||||
|
private HostSpecExtraModel spec;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||||
|
*
|
||||||
|
* https://visor.dromara.org
|
||||||
|
* https://visor.dromara.org.cn
|
||||||
|
* https://visor.orionsec.cn
|
||||||
|
*
|
||||||
|
* Members:
|
||||||
|
* Jiahang Li - ljh1553488six@139.com - author
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.dromara.visor.module.asset.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主机系统架构类型
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024/4/16 21:58
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum HostArchTypeEnum {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* X86_64
|
||||||
|
*/
|
||||||
|
AMD64,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* arm64
|
||||||
|
*/
|
||||||
|
ARM64,
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
public boolean is(String type) {
|
||||||
|
if (type == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return type.equalsIgnoreCase(this.name());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HostArchTypeEnum of(String type) {
|
||||||
|
if (type == null) {
|
||||||
|
return AMD64;
|
||||||
|
}
|
||||||
|
type = type.toUpperCase();
|
||||||
|
for (HostArchTypeEnum value : values()) {
|
||||||
|
if (value.name().equals(type) || type.contains(value.name())) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return AMD64;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -28,6 +28,7 @@ import org.dromara.visor.common.handler.data.GenericsStrategyDefinition;
|
|||||||
import org.dromara.visor.common.handler.data.model.GenericsDataModel;
|
import org.dromara.visor.common.handler.data.model.GenericsDataModel;
|
||||||
import org.dromara.visor.common.handler.data.strategy.GenericsDataStrategy;
|
import org.dromara.visor.common.handler.data.strategy.GenericsDataStrategy;
|
||||||
import org.dromara.visor.module.asset.handler.host.extra.strategy.HostLabelExtraStrategy;
|
import org.dromara.visor.module.asset.handler.host.extra.strategy.HostLabelExtraStrategy;
|
||||||
|
import org.dromara.visor.module.asset.handler.host.extra.strategy.HostSpecExtraStrategy;
|
||||||
import org.dromara.visor.module.asset.handler.host.extra.strategy.HostSshExtraStrategy;
|
import org.dromara.visor.module.asset.handler.host.extra.strategy.HostSshExtraStrategy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,17 +45,24 @@ public enum HostExtraItemEnum implements GenericsStrategyDefinition {
|
|||||||
/**
|
/**
|
||||||
* SSH 额外配置
|
* SSH 额外配置
|
||||||
*/
|
*/
|
||||||
SSH(HostSshExtraStrategy.class),
|
SSH(HostSshExtraStrategy.class, true),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标签额外配置
|
* 标签额外配置
|
||||||
*/
|
*/
|
||||||
LABEL(HostLabelExtraStrategy.class),
|
LABEL(HostLabelExtraStrategy.class, true),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格信息配置
|
||||||
|
*/
|
||||||
|
SPEC(HostSpecExtraStrategy.class, false),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
private final Class<? extends GenericsDataStrategy<? extends GenericsDataModel>> strategyClass;
|
private final Class<? extends GenericsDataStrategy<? extends GenericsDataModel>> strategyClass;
|
||||||
|
|
||||||
|
private final boolean userExtra;
|
||||||
|
|
||||||
public static HostExtraItemEnum of(String item) {
|
public static HostExtraItemEnum of(String item) {
|
||||||
if (item == null) {
|
if (item == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -46,40 +46,33 @@ public enum HostOsTypeEnum {
|
|||||||
*/
|
*/
|
||||||
WINDOWS(".cmd"),
|
WINDOWS(".cmd"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* darwin
|
||||||
|
*/
|
||||||
|
DARWIN(".sh"),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String scriptSuffix;
|
private final String scriptSuffix;
|
||||||
|
|
||||||
|
public boolean is(String type) {
|
||||||
|
if (type == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return type.equalsIgnoreCase(this.name());
|
||||||
|
}
|
||||||
|
|
||||||
public static HostOsTypeEnum of(String type) {
|
public static HostOsTypeEnum of(String type) {
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
return LINUX;
|
return LINUX;
|
||||||
}
|
}
|
||||||
|
type = type.toUpperCase();
|
||||||
for (HostOsTypeEnum value : values()) {
|
for (HostOsTypeEnum value : values()) {
|
||||||
if (value.name().equals(type)) {
|
if (value.name().equals(type) || type.contains(value.name())) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return LINUX;
|
return LINUX;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否为 linux 系统
|
|
||||||
*
|
|
||||||
* @param type type
|
|
||||||
* @return isLinux
|
|
||||||
*/
|
|
||||||
public static boolean isLinux(String type) {
|
|
||||||
return LINUX.name().equals(type);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否为 windows 系统
|
|
||||||
*
|
|
||||||
* @param type type
|
|
||||||
* @return isWindows
|
|
||||||
*/
|
|
||||||
public static boolean isWindows(String type) {
|
|
||||||
return WINDOWS.name().equals(type);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,11 +24,18 @@ package org.dromara.visor.module.asset.enums;
|
|||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import org.dromara.visor.common.constant.Const;
|
||||||
import org.dromara.visor.common.handler.data.GenericsStrategyDefinition;
|
import org.dromara.visor.common.handler.data.GenericsStrategyDefinition;
|
||||||
import org.dromara.visor.common.handler.data.model.GenericsDataModel;
|
import org.dromara.visor.common.handler.data.model.GenericsDataModel;
|
||||||
import org.dromara.visor.common.handler.data.strategy.GenericsDataStrategy;
|
import org.dromara.visor.common.handler.data.strategy.GenericsDataStrategy;
|
||||||
import org.dromara.visor.module.asset.handler.host.config.strategy.HostSshConfigStrategy;
|
import org.dromara.visor.module.asset.handler.host.config.strategy.HostSshConfigStrategy;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主机配置类型枚举
|
* 主机配置类型枚举
|
||||||
*
|
*
|
||||||
@@ -61,4 +68,15 @@ public enum HostTypeEnum implements GenericsStrategyDefinition {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<String> split(String types) {
|
||||||
|
if (types == null) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return Arrays.stream(types.split(Const.COMMA))
|
||||||
|
.map(HostTypeEnum::of)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.map(Enum::name)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,14 @@ import javax.validation.constraints.*;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class HostSshConfigModel implements GenericsDataModel, UpdatePasswordAction {
|
public class HostSshConfigModel implements GenericsDataModel, UpdatePasswordAction {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主机端口
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
@Min(value = 1)
|
||||||
|
@Max(value = 65535)
|
||||||
|
private Integer port;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名
|
* 用户名
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ public class HostSshConfigStrategy extends AbstractGenericsDataStrategy<HostSshC
|
|||||||
@Override
|
@Override
|
||||||
public HostSshConfigModel getDefault() {
|
public HostSshConfigModel getDefault() {
|
||||||
return HostSshConfigModel.builder()
|
return HostSshConfigModel.builder()
|
||||||
|
.port(22)
|
||||||
.username(USERNAME)
|
.username(USERNAME)
|
||||||
.authType(HostSshAuthTypeEnum.PASSWORD.name())
|
.authType(HostSshAuthTypeEnum.PASSWORD.name())
|
||||||
.connectTimeout(Const.MS_S_10)
|
.connectTimeout(Const.MS_S_10)
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ import org.dromara.visor.module.asset.enums.ExecHostStatusEnum;
|
|||||||
import org.dromara.visor.module.asset.enums.HostOsTypeEnum;
|
import org.dromara.visor.module.asset.enums.HostOsTypeEnum;
|
||||||
import org.dromara.visor.module.asset.handler.host.exec.log.manager.ExecLogManager;
|
import org.dromara.visor.module.asset.handler.host.exec.log.manager.ExecLogManager;
|
||||||
import org.dromara.visor.module.asset.handler.host.jsch.SessionStores;
|
import org.dromara.visor.module.asset.handler.host.jsch.SessionStores;
|
||||||
import org.dromara.visor.module.asset.service.TerminalService;
|
import org.dromara.visor.module.asset.service.HostConnectService;
|
||||||
import org.dromara.visor.module.asset.utils.ExecUtils;
|
import org.dromara.visor.module.asset.utils.ExecUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -79,7 +79,7 @@ public abstract class BaseExecCommandHandler implements IExecCommandHandler {
|
|||||||
|
|
||||||
private static final ExecLogManager execLogManager = SpringHolder.getBean(ExecLogManager.class);
|
private static final ExecLogManager execLogManager = SpringHolder.getBean(ExecLogManager.class);
|
||||||
|
|
||||||
private static final TerminalService terminalService = SpringHolder.getBean(TerminalService.class);
|
private static final HostConnectService hostConnectService = SpringHolder.getBean(HostConnectService.class);
|
||||||
|
|
||||||
private static final ExecHostLogDAO execHostLogDAO = SpringHolder.getBean(ExecHostLogDAO.class);
|
private static final ExecHostLogDAO execHostLogDAO = SpringHolder.getBean(ExecHostLogDAO.class);
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ public abstract class BaseExecCommandHandler implements IExecCommandHandler {
|
|||||||
this.status = ExecHostStatusEnum.of(execHostLog.getStatus());
|
this.status = ExecHostStatusEnum.of(execHostLog.getStatus());
|
||||||
Valid.eq(this.status, ExecHostStatusEnum.WAITING, ErrorMessage.TASK_ABSENT, ErrorMessage.ILLEGAL_STATUS);
|
Valid.eq(this.status, ExecHostStatusEnum.WAITING, ErrorMessage.TASK_ABSENT, ErrorMessage.ILLEGAL_STATUS);
|
||||||
// 获取主机会话
|
// 获取主机会话
|
||||||
this.connect = terminalService.getTerminalConnectInfo(execHostLog.getHostId(), execLog.getUserId());
|
this.connect = hostConnectService.getSshConnectInfo(execHostLog.getHostId(), execLog.getUserId());
|
||||||
// 设置日志路径
|
// 设置日志路径
|
||||||
this.setLogPath();
|
this.setLogPath();
|
||||||
// 设置脚本路径
|
// 设置脚本路径
|
||||||
@@ -411,6 +411,7 @@ public abstract class BaseExecCommandHandler implements IExecCommandHandler {
|
|||||||
params.put("hostUuid", uuid);
|
params.put("hostUuid", uuid);
|
||||||
params.put("hostUuidShort", uuid.replace("-", Strings.EMPTY));
|
params.put("hostUuidShort", uuid.replace("-", Strings.EMPTY));
|
||||||
params.put("osType", connect.getOsType());
|
params.put("osType", connect.getOsType());
|
||||||
|
params.put("archType", connect.getArchType());
|
||||||
params.put("charset", connect.getCharset());
|
params.put("charset", connect.getCharset());
|
||||||
params.put("scriptPath", execHostLog.getScriptPath());
|
params.put("scriptPath", execHostLog.getScriptPath());
|
||||||
// 获取实际命令
|
// 获取实际命令
|
||||||
|
|||||||
@@ -0,0 +1,141 @@
|
|||||||
|
/*
|
||||||
|
* 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.handler.host.extra.model;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import org.dromara.visor.common.handler.data.model.GenericsDataModel;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主机拓展信息 - 规格模型
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2025/3/24 0:34
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class HostSpecExtraModel implements GenericsDataModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sn
|
||||||
|
*/
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统名称
|
||||||
|
*/
|
||||||
|
private String osName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cpu 核心数
|
||||||
|
*/
|
||||||
|
private Integer cpuCore;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cpu 频率
|
||||||
|
*/
|
||||||
|
private Double cpuFrequency;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* cpu 型号
|
||||||
|
*/
|
||||||
|
private String cpuModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内存大小
|
||||||
|
*/
|
||||||
|
private Double memorySize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 硬盘大小
|
||||||
|
*/
|
||||||
|
private Double diskSize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上行带宽
|
||||||
|
*/
|
||||||
|
private Integer inBandwidth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下行带宽
|
||||||
|
*/
|
||||||
|
private Integer outBandwidth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公网 ip 列表
|
||||||
|
*/
|
||||||
|
private List<String> publicIpAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内网 ip 列表
|
||||||
|
*/
|
||||||
|
private List<String> privateIpAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责人
|
||||||
|
*/
|
||||||
|
private String chargePerson;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createdTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 到期时间
|
||||||
|
*/
|
||||||
|
private Date expiredTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扩展信息
|
||||||
|
*/
|
||||||
|
@Singular
|
||||||
|
private List<HostSpecExtraItem> items;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扩展信息项
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class HostSpecExtraItem {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标签
|
||||||
|
*/
|
||||||
|
private String label;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 值
|
||||||
|
*/
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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.module.asset.handler.host.extra.strategy;
|
||||||
|
|
||||||
|
import org.dromara.visor.common.handler.data.strategy.AbstractGenericsDataStrategy;
|
||||||
|
import org.dromara.visor.module.asset.handler.host.extra.model.HostSpecExtraModel;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主机规格额外信息策略
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2025/3/24 0:21
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class HostSpecExtraStrategy extends AbstractGenericsDataStrategy<HostSpecExtraModel> {
|
||||||
|
|
||||||
|
public HostSpecExtraStrategy() {
|
||||||
|
super(HostSpecExtraModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HostSpecExtraModel getDefault() {
|
||||||
|
return new HostSpecExtraModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -48,8 +48,8 @@ import org.dromara.visor.module.asset.handler.host.terminal.model.request.Termin
|
|||||||
import org.dromara.visor.module.asset.handler.host.terminal.model.response.TerminalCheckResponse;
|
import org.dromara.visor.module.asset.handler.host.terminal.model.response.TerminalCheckResponse;
|
||||||
import org.dromara.visor.module.asset.handler.host.terminal.session.ITerminalSession;
|
import org.dromara.visor.module.asset.handler.host.terminal.session.ITerminalSession;
|
||||||
import org.dromara.visor.module.asset.handler.host.terminal.utils.TerminalUtils;
|
import org.dromara.visor.module.asset.handler.host.terminal.utils.TerminalUtils;
|
||||||
|
import org.dromara.visor.module.asset.service.HostConnectService;
|
||||||
import org.dromara.visor.module.asset.service.TerminalConnectLogService;
|
import org.dromara.visor.module.asset.service.TerminalConnectLogService;
|
||||||
import org.dromara.visor.module.asset.service.TerminalService;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.socket.WebSocketSession;
|
import org.springframework.web.socket.WebSocketSession;
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ public class TerminalCheckHandler extends AbstractTerminalHandler<TerminalCheckR
|
|||||||
private HostDAO hostDAO;
|
private HostDAO hostDAO;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private TerminalService terminalService;
|
private HostConnectService hostConnectService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private TerminalConnectLogService terminalConnectLogService;
|
private TerminalConnectLogService terminalConnectLogService;
|
||||||
@@ -102,7 +102,7 @@ public class TerminalCheckHandler extends AbstractTerminalHandler<TerminalCheckR
|
|||||||
Exception ex = null;
|
Exception ex = null;
|
||||||
try {
|
try {
|
||||||
// 获取连接信息
|
// 获取连接信息
|
||||||
connect = terminalService.getTerminalConnectInfo(host, userId);
|
connect = hostConnectService.getSshConnectInfo(host, userId);
|
||||||
connect.setConnectType(connectType.name());
|
connect.setConnectType(connectType.name());
|
||||||
// 设置到缓存中
|
// 设置到缓存中
|
||||||
channel.getAttributes().put(sessionId, connect);
|
channel.getAttributes().put(sessionId, connect);
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import org.dromara.visor.module.asset.handler.host.transfer.session.DownloadSess
|
|||||||
import org.dromara.visor.module.asset.handler.host.transfer.session.ITransferSession;
|
import org.dromara.visor.module.asset.handler.host.transfer.session.ITransferSession;
|
||||||
import org.dromara.visor.module.asset.handler.host.transfer.session.UploadSession;
|
import org.dromara.visor.module.asset.handler.host.transfer.session.UploadSession;
|
||||||
import org.dromara.visor.module.asset.handler.host.transfer.utils.TransferUtils;
|
import org.dromara.visor.module.asset.handler.host.transfer.utils.TransferUtils;
|
||||||
import org.dromara.visor.module.asset.service.TerminalService;
|
import org.dromara.visor.module.asset.service.HostConnectService;
|
||||||
import org.springframework.web.socket.WebSocketSession;
|
import org.springframework.web.socket.WebSocketSession;
|
||||||
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
@@ -55,7 +55,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class TransferHandler implements ITransferHandler {
|
public class TransferHandler implements ITransferHandler {
|
||||||
|
|
||||||
private static final TerminalService terminalService = SpringHolder.getBean(TerminalService.class);
|
private static final HostConnectService hostConnectService = SpringHolder.getBean(HostConnectService.class);
|
||||||
|
|
||||||
private final WebSocketSession channel;
|
private final WebSocketSession channel;
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ public class TransferHandler implements ITransferHandler {
|
|||||||
if (terminalConnection == null) {
|
if (terminalConnection == null) {
|
||||||
// 获取终端连接信息
|
// 获取终端连接信息
|
||||||
Long userId = WebSockets.getAttr(channel, ExtraFieldConst.USER_ID);
|
Long userId = WebSockets.getAttr(channel, ExtraFieldConst.USER_ID);
|
||||||
TerminalConnectDTO connectInfo = terminalService.getTerminalConnectInfo(hostId, userId);
|
TerminalConnectDTO connectInfo = hostConnectService.getSshConnectInfo(hostId, userId);
|
||||||
terminalConnection = new TerminalConnection(connectInfo, SessionStores.openSessionStore(connectInfo));
|
terminalConnection = new TerminalConnection(connectInfo, SessionStores.openSessionStore(connectInfo));
|
||||||
terminalConnections.put(hostId, terminalConnection);
|
terminalConnections.put(hostId, terminalConnection);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ import org.dromara.visor.module.asset.enums.UploadTaskFileStatusEnum;
|
|||||||
import org.dromara.visor.module.asset.handler.host.jsch.SessionStores;
|
import org.dromara.visor.module.asset.handler.host.jsch.SessionStores;
|
||||||
import org.dromara.visor.module.asset.handler.host.upload.model.FileUploadConfigDTO;
|
import org.dromara.visor.module.asset.handler.host.upload.model.FileUploadConfigDTO;
|
||||||
import org.dromara.visor.module.asset.handler.host.upload.model.FileUploadFileItemDTO;
|
import org.dromara.visor.module.asset.handler.host.upload.model.FileUploadFileItemDTO;
|
||||||
import org.dromara.visor.module.asset.service.TerminalService;
|
import org.dromara.visor.module.asset.service.HostConnectService;
|
||||||
import org.dromara.visor.module.asset.utils.SftpUtils;
|
import org.dromara.visor.module.asset.utils.SftpUtils;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@@ -65,7 +65,7 @@ import java.util.stream.Collectors;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class FileUploader implements IFileUploader {
|
public class FileUploader implements IFileUploader {
|
||||||
|
|
||||||
private static final TerminalService terminalService = SpringHolder.getBean(TerminalService.class);
|
private static final HostConnectService hostConnectService = SpringHolder.getBean(HostConnectService.class);
|
||||||
|
|
||||||
private static final UploadTaskFileDAO uploadTaskFileDAO = SpringHolder.getBean(UploadTaskFileDAO.class);
|
private static final UploadTaskFileDAO uploadTaskFileDAO = SpringHolder.getBean(UploadTaskFileDAO.class);
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ public class FileUploader implements IFileUploader {
|
|||||||
log.info("HostFileUploader.initSession start taskId: {}, hostId: {}", taskId, hostId);
|
log.info("HostFileUploader.initSession start taskId: {}, hostId: {}", taskId, hostId);
|
||||||
try {
|
try {
|
||||||
// 打开会话
|
// 打开会话
|
||||||
this.connectInfo = terminalService.getTerminalConnectInfo(hostId, config.getUserId());
|
this.connectInfo = hostConnectService.getSshConnectInfo(hostId, config.getUserId());
|
||||||
this.sessionStore = SessionStores.openSessionStore(connectInfo);
|
this.sessionStore = SessionStores.openSessionStore(connectInfo);
|
||||||
this.executor = sessionStore.getSftpExecutor(connectInfo.getFileNameCharset());
|
this.executor = sessionStore.getSftpExecutor(connectInfo.getFileNameCharset());
|
||||||
executor.connect();
|
executor.connect();
|
||||||
@@ -161,7 +161,7 @@ public class FileUploader implements IFileUploader {
|
|||||||
if (containsEnv) {
|
if (containsEnv) {
|
||||||
// 替换占位符
|
// 替换占位符
|
||||||
String username = connectInfo.getUsername();
|
String username = connectInfo.getUsername();
|
||||||
String home = PathUtils.getHomePath(HostOsTypeEnum.isWindows(connectInfo.getOsType()), username);
|
String home = PathUtils.getHomePath(HostOsTypeEnum.WINDOWS.is(connectInfo.getOsType()), username);
|
||||||
// 替换环境变量路径
|
// 替换环境变量路径
|
||||||
Map<String, String> env = Maps.newMap(4);
|
Map<String, String> env = Maps.newMap(4);
|
||||||
env.put(ExtraFieldConst.USERNAME, username);
|
env.put(ExtraFieldConst.USERNAME, username);
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import org.dromara.visor.module.asset.entity.request.asset.AssetAuthorizedDataQu
|
|||||||
import org.dromara.visor.module.asset.entity.vo.AuthorizedHostWrapperVO;
|
import org.dromara.visor.module.asset.entity.vo.AuthorizedHostWrapperVO;
|
||||||
import org.dromara.visor.module.asset.entity.vo.HostIdentityVO;
|
import org.dromara.visor.module.asset.entity.vo.HostIdentityVO;
|
||||||
import org.dromara.visor.module.asset.entity.vo.HostKeyVO;
|
import org.dromara.visor.module.asset.entity.vo.HostKeyVO;
|
||||||
import org.dromara.visor.module.asset.enums.HostTypeEnum;
|
|
||||||
import org.dromara.visor.module.infra.enums.DataPermissionTypeEnum;
|
import org.dromara.visor.module.infra.enums.DataPermissionTypeEnum;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -64,10 +63,10 @@ public interface AssetAuthorizedDataService {
|
|||||||
* @param type type
|
* @param type type
|
||||||
* @return hostId
|
* @return hostId
|
||||||
*/
|
*/
|
||||||
List<Long> getUserAuthorizedEnabledHostId(Long userId, HostTypeEnum type);
|
List<Long> getUserAuthorizedEnabledHostId(Long userId, String type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询用户已授权的主机
|
* 查询用户已授权并且启用的主机
|
||||||
*
|
*
|
||||||
* @param userId userId
|
* @param userId userId
|
||||||
* @param type type
|
* @param type type
|
||||||
|
|||||||
@@ -23,7 +23,8 @@
|
|||||||
package org.dromara.visor.module.asset.service;
|
package org.dromara.visor.module.asset.service;
|
||||||
|
|
||||||
import org.dromara.visor.common.handler.data.model.GenericsDataModel;
|
import org.dromara.visor.common.handler.data.model.GenericsDataModel;
|
||||||
import org.dromara.visor.module.asset.entity.domain.HostDO;
|
import org.dromara.visor.module.asset.entity.request.host.HostConfigQueryRequest;
|
||||||
|
import org.dromara.visor.module.asset.entity.request.host.HostConfigUpdateRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主机配置 服务类
|
* 主机配置 服务类
|
||||||
@@ -35,21 +36,29 @@ import org.dromara.visor.module.asset.entity.domain.HostDO;
|
|||||||
public interface HostConfigService {
|
public interface HostConfigService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取主机配置
|
* 更新主机配置
|
||||||
*
|
*
|
||||||
* @param id id
|
* @param request request
|
||||||
* @param <T> T
|
* @return effect
|
||||||
* @return host
|
|
||||||
*/
|
*/
|
||||||
<T extends GenericsDataModel> T getHostConfig(Long id);
|
Integer updateHostConfig(HostConfigUpdateRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取主机配置
|
* 获取主机配置
|
||||||
*
|
*
|
||||||
* @param host host
|
* @param hostId hostId
|
||||||
* @param <T> T
|
* @param type type
|
||||||
* @return host
|
* @param <T> T
|
||||||
|
* @return config
|
||||||
*/
|
*/
|
||||||
<T extends GenericsDataModel> T getHostConfig(HostDO host);
|
<T extends GenericsDataModel> T getHostConfig(Long hostId, String type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询主机配置
|
||||||
|
*
|
||||||
|
* @param request request
|
||||||
|
* @return config
|
||||||
|
*/
|
||||||
|
<T extends GenericsDataModel> T getHostConfigView(HostConfigQueryRequest request);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2023 - present Dromara, All rights reserved.
|
||||||
|
*
|
||||||
|
* https://visor.dromara.org
|
||||||
|
* https://visor.dromara.org.cn
|
||||||
|
* https://visor.orionsec.cn
|
||||||
|
*
|
||||||
|
* Members:
|
||||||
|
* Jiahang Li - ljh1553488six@139.com - author
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.dromara.visor.module.asset.service;
|
||||||
|
|
||||||
|
import org.dromara.visor.module.asset.entity.domain.HostDO;
|
||||||
|
import org.dromara.visor.module.asset.entity.dto.TerminalConnectDTO;
|
||||||
|
import org.dromara.visor.module.asset.entity.request.host.HostTestConnectRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主机连接服务
|
||||||
|
*
|
||||||
|
* @author Jiahang Li
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 2024/10/12 23:54
|
||||||
|
*/
|
||||||
|
public interface HostConnectService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试主机连接
|
||||||
|
*
|
||||||
|
* @param request request
|
||||||
|
*/
|
||||||
|
void testHostConnect(HostTestConnectRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 SSH 连接信息
|
||||||
|
*
|
||||||
|
* @param hostId hostId
|
||||||
|
* @return session
|
||||||
|
*/
|
||||||
|
TerminalConnectDTO getSshConnectInfo(Long hostId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用用户配置获取 SSH 连接信息
|
||||||
|
*
|
||||||
|
* @param hostId hostId
|
||||||
|
* @param userId userId
|
||||||
|
* @return session
|
||||||
|
*/
|
||||||
|
TerminalConnectDTO getSshConnectInfo(Long hostId, Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用用户配置获取 SSH 连接信息
|
||||||
|
*
|
||||||
|
* @param host host
|
||||||
|
* @param userId userId
|
||||||
|
* @return session
|
||||||
|
*/
|
||||||
|
TerminalConnectDTO getSshConnectInfo(HostDO host, Long userId);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -23,10 +23,11 @@
|
|||||||
package org.dromara.visor.module.asset.service;
|
package org.dromara.visor.module.asset.service;
|
||||||
|
|
||||||
import org.dromara.visor.common.handler.data.model.GenericsDataModel;
|
import org.dromara.visor.common.handler.data.model.GenericsDataModel;
|
||||||
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.enums.HostExtraItemEnum;
|
||||||
|
import org.dromara.visor.module.asset.handler.host.extra.model.HostSpecExtraModel;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -45,7 +46,7 @@ public interface HostExtraService {
|
|||||||
* @param item item
|
* @param item item
|
||||||
* @return extra
|
* @return extra
|
||||||
*/
|
*/
|
||||||
Map<String, Object> getHostExtra(Long hostId, String item);
|
Map<String, Object> getHostExtraView(Long hostId, String item);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取主机额外配置
|
* 获取主机额外配置
|
||||||
@@ -59,12 +60,12 @@ public interface HostExtraService {
|
|||||||
<T extends GenericsDataModel> T getHostExtra(Long userId, Long hostId, HostExtraItemEnum item);
|
<T extends GenericsDataModel> T getHostExtra(Long userId, Long hostId, HostExtraItemEnum item);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取多个主机拓展信息
|
* 获取主机规格信息
|
||||||
*
|
*
|
||||||
* @param request request
|
* @param hostIdList hostIdList
|
||||||
* @return type:extra
|
* @return models
|
||||||
*/
|
*/
|
||||||
Map<String, Map<String, Object>> getHostExtraList(HostExtraQueryRequest request);
|
Map<Long, HostSpecExtraModel> getHostSpecMap(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