diff --git a/docker/copy.sh b/docker/copy.sh
deleted file mode 100644
index 5d895913..00000000
--- a/docker/copy.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-
-# 复制项目的文件到对应docker路径,便于一键生成镜像。
-usage() {
- echo "Usage: sh copy.sh"
- exit 1
-}
-
-
-# copy sql
-echo "begin copy sql "
-cp ../sql/ry_20240629.sql ./mysql/db
-cp ../sql/ry_config_20240902.sql ./mysql/db
-
-# copy html
-echo "begin copy html "
-cp -r ../ruoyi-ui/dist/** ./nginx/html/dist
-
-
-# copy jar
-echo "begin copy ruoyi-gateway "
-cp ../ruoyi-gateway/target/ruoyi-gateway.jar ./ruoyi/gateway/jar
-
-echo "begin copy ruoyi-auth "
-cp ../ruoyi-auth/target/ruoyi-auth.jar ./ruoyi/auth/jar
-
-echo "begin copy ruoyi-visual "
-cp ../ruoyi-visual/ruoyi-monitor/target/ruoyi-visual-monitor.jar ./ruoyi/visual/monitor/jar
-
-echo "begin copy ruoyi-modules-system "
-cp ../ruoyi-modules/ruoyi-system/target/ruoyi-modules-system.jar ./ruoyi/modules/system/jar
-
-echo "begin copy ruoyi-modules-file "
-cp ../ruoyi-modules/ruoyi-file/target/ruoyi-modules-file.jar ./ruoyi/modules/file/jar
-
-echo "begin copy ruoyi-modules-job "
-cp ../ruoyi-modules/ruoyi-job/target/ruoyi-modules-job.jar ./ruoyi/modules/job/jar
-
-echo "begin copy ruoyi-modules-gen "
-cp ../ruoyi-modules/ruoyi-gen/target/ruoyi-modules-gen.jar ./ruoyi/modules/gen/jar
-
diff --git a/docker/deploy.sh b/docker/deploy.sh
deleted file mode 100644
index 02489092..00000000
--- a/docker/deploy.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-
-# 使用说明,用来提示输入参数
-usage() {
- echo "Usage: sh 执行脚本.sh [port|base|modules|stop|rm]"
- exit 1
-}
-
-# 开启所需端口
-port(){
- firewall-cmd --add-port=80/tcp --permanent
- firewall-cmd --add-port=8080/tcp --permanent
- firewall-cmd --add-port=8848/tcp --permanent
- firewall-cmd --add-port=9848/tcp --permanent
- firewall-cmd --add-port=9849/tcp --permanent
- firewall-cmd --add-port=6379/tcp --permanent
- firewall-cmd --add-port=3306/tcp --permanent
- firewall-cmd --add-port=9100/tcp --permanent
- firewall-cmd --add-port=9200/tcp --permanent
- firewall-cmd --add-port=9201/tcp --permanent
- firewall-cmd --add-port=9202/tcp --permanent
- firewall-cmd --add-port=9203/tcp --permanent
- firewall-cmd --add-port=9300/tcp --permanent
- service firewalld restart
-}
-
-# 启动基础环境(必须)
-base(){
- docker-compose up -d ruoyi-mysql ruoyi-redis ruoyi-nacos
-}
-
-# 启动程序模块(必须)
-modules(){
- docker-compose up -d ruoyi-nginx ruoyi-gateway ruoyi-auth ruoyi-modules-system
-}
-
-# 关闭所有环境/模块
-stop(){
- docker-compose stop
-}
-
-# 删除所有环境/模块
-rm(){
- docker-compose rm
-}
-
-# 根据输入参数,选择执行对应方法,不输入则执行使用说明
-case "$1" in
-"port")
- port
-;;
-"base")
- base
-;;
-"modules")
- modules
-;;
-"stop")
- stop
-;;
-"rm")
- rm
-;;
-*)
- usage
-;;
-esac
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
deleted file mode 100644
index 5fb8da1c..00000000
--- a/docker/docker-compose.yml
+++ /dev/null
@@ -1,140 +0,0 @@
-version : '3.8'
-services:
- ruoyi-nacos:
- container_name: ruoyi-nacos
- image: nacos/nacos-server
- build:
- context: ./nacos
- environment:
- - MODE=standalone
- volumes:
- - ./nacos/logs/:/home/nacos/logs
- - ./nacos/conf/application.properties:/home/nacos/conf/application.properties
- ports:
- - "8848:8848"
- - "9848:9848"
- - "9849:9849"
- depends_on:
- - ruoyi-mysql
- ruoyi-mysql:
- container_name: ruoyi-mysql
- image: mysql:5.7
- build:
- context: ./mysql
- ports:
- - "3306:3306"
- volumes:
- - ./mysql/conf:/etc/mysql/conf.d
- - ./mysql/logs:/logs
- - ./mysql/data:/var/lib/mysql
- command: [
- 'mysqld',
- '--innodb-buffer-pool-size=80M',
- '--character-set-server=utf8mb4',
- '--collation-server=utf8mb4_unicode_ci',
- '--default-time-zone=+8:00',
- '--lower-case-table-names=1'
- ]
- environment:
- MYSQL_DATABASE: 'ry-cloud'
- MYSQL_ROOT_PASSWORD: password
- ruoyi-redis:
- container_name: ruoyi-redis
- image: redis
- build:
- context: ./redis
- ports:
- - "6379:6379"
- volumes:
- - ./redis/conf/redis.conf:/home/ruoyi/redis/redis.conf
- - ./redis/data:/data
- command: redis-server /home/ruoyi/redis/redis.conf
- ruoyi-nginx:
- container_name: ruoyi-nginx
- image: nginx
- build:
- context: ./nginx
- ports:
- - "80:80"
- volumes:
- - ./nginx/html/dist:/home/ruoyi/projects/ruoyi-ui
- - ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
- - ./nginx/logs:/var/log/nginx
- - ./nginx/conf.d:/etc/nginx/conf.d
- depends_on:
- - ruoyi-gateway
- links:
- - ruoyi-gateway
- ruoyi-gateway:
- container_name: ruoyi-gateway
- build:
- context: ./ruoyi/gateway
- dockerfile: dockerfile
- ports:
- - "8080:8080"
- depends_on:
- - ruoyi-redis
- links:
- - ruoyi-redis
- ruoyi-auth:
- container_name: ruoyi-auth
- build:
- context: ./ruoyi/auth
- dockerfile: dockerfile
- ports:
- - "9200:9200"
- depends_on:
- - ruoyi-redis
- links:
- - ruoyi-redis
- ruoyi-modules-system:
- container_name: ruoyi-modules-system
- build:
- context: ./ruoyi/modules/system
- dockerfile: dockerfile
- ports:
- - "9201:9201"
- depends_on:
- - ruoyi-redis
- - ruoyi-mysql
- links:
- - ruoyi-redis
- - ruoyi-mysql
- ruoyi-modules-gen:
- container_name: ruoyi-modules-gen
- build:
- context: ./ruoyi/modules/gen
- dockerfile: dockerfile
- ports:
- - "9202:9202"
- depends_on:
- - ruoyi-mysql
- links:
- - ruoyi-mysql
- ruoyi-modules-job:
- container_name: ruoyi-modules-job
- build:
- context: ./ruoyi/modules/job
- dockerfile: dockerfile
- ports:
- - "9203:9203"
- depends_on:
- - ruoyi-mysql
- links:
- - ruoyi-mysql
- ruoyi-modules-file:
- container_name: ruoyi-modules-file
- build:
- context: ./ruoyi/modules/file
- dockerfile: dockerfile
- ports:
- - "9300:9300"
- volumes:
- - ./ruoyi/uploadPath:/home/ruoyi/uploadPath
- ruoyi-visual-monitor:
- container_name: ruoyi-visual-monitor
- build:
- context: ./ruoyi/visual/monitor
- dockerfile: dockerfile
- ports:
- - "9100:9100"
diff --git a/docker/mysql/db/readme.txt b/docker/mysql/db/readme.txt
deleted file mode 100644
index 0b22f3fe..00000000
--- a/docker/mysql/db/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-sqlĿ¼µнűdockerԶִС
\ No newline at end of file
diff --git a/docker/mysql/dockerfile b/docker/mysql/dockerfile
deleted file mode 100644
index b35dc5fd..00000000
--- a/docker/mysql/dockerfile
+++ /dev/null
@@ -1,7 +0,0 @@
-# 基础镜像
-FROM mysql:5.7
-# author
-MAINTAINER ruoyi
-
-# 执行sql脚本
-ADD ./db/*.sql /docker-entrypoint-initdb.d/
diff --git a/docker/nacos/conf/application.properties b/docker/nacos/conf/application.properties
deleted file mode 100644
index 7f2a61f2..00000000
--- a/docker/nacos/conf/application.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-spring.datasource.platform=mysql
-db.num=1
-db.url.0=jdbc:mysql://ruoyi-mysql:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
-db.user=root
-db.password=password
-
-nacos.naming.empty-service.auto-clean=true
-nacos.naming.empty-service.clean.initial-delay-ms=50000
-nacos.naming.empty-service.clean.period-time-ms=30000
-
-management.endpoints.web.exposure.include=*
-
-management.metrics.export.elastic.enabled=false
-management.metrics.export.influx.enabled=false
-
-server.tomcat.accesslog.enabled=true
-server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i
-
-server.tomcat.basedir=/home/ruoyi/nacos/tomcat/logs
-
-nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
-
-nacos.core.auth.system.type=nacos
-nacos.core.auth.enabled=false
-nacos.core.auth.default.token.expire.seconds=18000
-nacos.core.auth.default.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
-nacos.core.auth.caching.enabled=true
-nacos.core.auth.enable.userAgentAuthWhite=false
-nacos.core.auth.server.identity.key=serverIdentity
-nacos.core.auth.server.identity.value=security
-
-nacos.istio.mcp.server.enabled=false
diff --git a/docker/nacos/dockerfile b/docker/nacos/dockerfile
deleted file mode 100644
index a9f72d99..00000000
--- a/docker/nacos/dockerfile
+++ /dev/null
@@ -1,7 +0,0 @@
-# 基础镜像
-FROM nacos/nacos-server
-# author
-MAINTAINER ruoyi
-
-# 复制conf文件到路径
-COPY ./conf/application.properties /home/nacos/conf/application.properties
diff --git a/docker/nginx/conf/nginx.conf b/docker/nginx/conf/nginx.conf
deleted file mode 100644
index eccee523..00000000
--- a/docker/nginx/conf/nginx.conf
+++ /dev/null
@@ -1,41 +0,0 @@
-worker_processes 1;
-
-events {
- worker_connections 1024;
-}
-
-http {
- include mime.types;
- default_type application/octet-stream;
- sendfile on;
- keepalive_timeout 65;
-
- server {
- listen 80;
- server_name localhost;
-
- location / {
- root /home/ruoyi/projects/ruoyi-ui;
- try_files $uri $uri/ /index.html;
- index index.html index.htm;
- }
-
- location /prod-api/{
- proxy_set_header Host $http_host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header REMOTE-HOST $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_pass http://ruoyi-gateway:8080/;
- }
-
- # 避免actuator暴露
- if ($request_uri ~ "/actuator") {
- return 403;
- }
-
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- }
-}
\ No newline at end of file
diff --git a/docker/nginx/dockerfile b/docker/nginx/dockerfile
deleted file mode 100644
index e0025b1b..00000000
--- a/docker/nginx/dockerfile
+++ /dev/null
@@ -1,15 +0,0 @@
-# 基础镜像
-FROM nginx
-# author
-MAINTAINER ruoyi
-
-# 挂载目录
-VOLUME /home/ruoyi/projects/ruoyi-ui
-# 创建目录
-RUN mkdir -p /home/ruoyi/projects/ruoyi-ui
-# 指定路径
-WORKDIR /home/ruoyi/projects/ruoyi-ui
-# 复制conf文件到路径
-COPY ./conf/nginx.conf /etc/nginx/nginx.conf
-# 复制html文件到路径
-COPY ./html/dist /home/ruoyi/projects/ruoyi-ui
diff --git a/docker/nginx/html/dist/readme.txt b/docker/nginx/html/dist/readme.txt
deleted file mode 100644
index eea3a328..00000000
--- a/docker/nginx/html/dist/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-ǰruoyi-uiõľ̬ļnginxʡ
\ No newline at end of file
diff --git a/docker/redis/conf/redis.conf b/docker/redis/conf/redis.conf
deleted file mode 100644
index d762d650..00000000
--- a/docker/redis/conf/redis.conf
+++ /dev/null
@@ -1 +0,0 @@
-# requirepass 123456
\ No newline at end of file
diff --git a/docker/redis/dockerfile b/docker/redis/dockerfile
deleted file mode 100644
index dd7eaa80..00000000
--- a/docker/redis/dockerfile
+++ /dev/null
@@ -1,13 +0,0 @@
-# 基础镜像
-FROM redis
-# author
-MAINTAINER ruoyi
-
-# 挂载目录
-VOLUME /home/ruoyi/redis
-# 创建目录
-RUN mkdir -p /home/ruoyi/redis
-# 指定路径
-WORKDIR /home/ruoyi/redis
-# 复制conf文件到路径
-COPY ./conf/redis.conf /home/ruoyi/redis/redis.conf
diff --git a/docker/ruoyi/auth/dockerfile b/docker/ruoyi/auth/dockerfile
deleted file mode 100644
index 01e777f0..00000000
--- a/docker/ruoyi/auth/dockerfile
+++ /dev/null
@@ -1,15 +0,0 @@
-# 基础镜像
-FROM openjdk:8-jre
-# author
-MAINTAINER ruoyi
-
-# 挂载目录
-VOLUME /home/ruoyi
-# 创建目录
-RUN mkdir -p /home/ruoyi
-# 指定路径
-WORKDIR /home/ruoyi
-# 复制jar文件到路径
-COPY ./jar/ruoyi-auth.jar /home/ruoyi/ruoyi-auth.jar
-# 启动认证服务
-ENTRYPOINT ["java","-jar","ruoyi-auth.jar"]
\ No newline at end of file
diff --git a/docker/ruoyi/auth/jar/readme.txt b/docker/ruoyi/auth/jar/readme.txt
deleted file mode 100644
index c35ba276..00000000
--- a/docker/ruoyi/auth/jar/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-֤ĴõjarļdockerӦá
\ No newline at end of file
diff --git a/docker/ruoyi/gateway/dockerfile b/docker/ruoyi/gateway/dockerfile
deleted file mode 100644
index 016fdce7..00000000
--- a/docker/ruoyi/gateway/dockerfile
+++ /dev/null
@@ -1,15 +0,0 @@
-# 基础镜像
-FROM openjdk:8-jre
-# author
-MAINTAINER ruoyi
-
-# 挂载目录
-VOLUME /home/ruoyi
-# 创建目录
-RUN mkdir -p /home/ruoyi
-# 指定路径
-WORKDIR /home/ruoyi
-# 复制jar文件到路径
-COPY ./jar/ruoyi-gateway.jar /home/ruoyi/ruoyi-gateway.jar
-# 启动网关服务
-ENTRYPOINT ["java","-jar","ruoyi-gateway.jar"]
\ No newline at end of file
diff --git a/docker/ruoyi/gateway/jar/readme.txt b/docker/ruoyi/gateway/jar/readme.txt
deleted file mode 100644
index 5dfbec76..00000000
--- a/docker/ruoyi/gateway/jar/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-ģõjarļdockerӦá
\ No newline at end of file
diff --git a/docker/ruoyi/modules/file/dockerfile b/docker/ruoyi/modules/file/dockerfile
deleted file mode 100644
index 7178d134..00000000
--- a/docker/ruoyi/modules/file/dockerfile
+++ /dev/null
@@ -1,15 +0,0 @@
-# 基础镜像
-FROM openjdk:8-jre
-# author
-MAINTAINER ruoyi
-
-# 挂载目录
-VOLUME /home/ruoyi
-# 创建目录
-RUN mkdir -p /home/ruoyi
-# 指定路径
-WORKDIR /home/ruoyi
-# 复制jar文件到路径
-COPY ./jar/ruoyi-modules-file.jar /home/ruoyi/ruoyi-modules-file.jar
-# 启动文件服务
-ENTRYPOINT ["java","-jar","ruoyi-modules-file.jar"]
\ No newline at end of file
diff --git a/docker/ruoyi/modules/file/jar/readme.txt b/docker/ruoyi/modules/file/jar/readme.txt
deleted file mode 100644
index bf2b2a7f..00000000
--- a/docker/ruoyi/modules/file/jar/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-ļõjarļdockerӦá
\ No newline at end of file
diff --git a/docker/ruoyi/modules/gen/dockerfile b/docker/ruoyi/modules/gen/dockerfile
deleted file mode 100644
index def260d3..00000000
--- a/docker/ruoyi/modules/gen/dockerfile
+++ /dev/null
@@ -1,15 +0,0 @@
-# 基础镜像
-FROM openjdk:8-jre
-# author
-MAINTAINER ruoyi
-
-# 挂载目录
-VOLUME /home/ruoyi
-# 创建目录
-RUN mkdir -p /home/ruoyi
-# 指定路径
-WORKDIR /home/ruoyi
-# 复制jar文件到路径
-COPY ./jar/ruoyi-modules-gen.jar /home/ruoyi/ruoyi-modules-gen.jar
-# 启动代码生成服务
-ENTRYPOINT ["java","-jar","ruoyi-modules-gen.jar"]
\ No newline at end of file
diff --git a/docker/ruoyi/modules/gen/jar/readme.txt b/docker/ruoyi/modules/gen/jar/readme.txt
deleted file mode 100644
index 2f25c0af..00000000
--- a/docker/ruoyi/modules/gen/jar/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-ŴɴõjarļdockerӦá
\ No newline at end of file
diff --git a/docker/ruoyi/modules/job/dockerfile b/docker/ruoyi/modules/job/dockerfile
deleted file mode 100644
index 100ecae2..00000000
--- a/docker/ruoyi/modules/job/dockerfile
+++ /dev/null
@@ -1,15 +0,0 @@
-# 基础镜像
-FROM openjdk:8-jre
-# author
-MAINTAINER ruoyi
-
-# 挂载目录
-VOLUME /home/ruoyi
-# 创建目录
-RUN mkdir -p /home/ruoyi
-# 指定路径
-WORKDIR /home/ruoyi
-# 复制jar文件到路径
-COPY ./jar/ruoyi-modules-job.jar /home/ruoyi/ruoyi-modules-job.jar
-# 启动定时任务服务
-ENTRYPOINT ["java","-jar","ruoyi-modules-job.jar"]
\ No newline at end of file
diff --git a/docker/ruoyi/modules/job/jar/readme.txt b/docker/ruoyi/modules/job/jar/readme.txt
deleted file mode 100644
index 58aea0b1..00000000
--- a/docker/ruoyi/modules/job/jar/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-ŶʱõjarļdockerӦá
\ No newline at end of file
diff --git a/docker/ruoyi/modules/system/dockerfile b/docker/ruoyi/modules/system/dockerfile
deleted file mode 100644
index ced23b2e..00000000
--- a/docker/ruoyi/modules/system/dockerfile
+++ /dev/null
@@ -1,15 +0,0 @@
-# 基础镜像
-FROM openjdk:8-jre
-# author
-MAINTAINER ruoyi
-
-# 挂载目录
-VOLUME /home/ruoyi
-# 创建目录
-RUN mkdir -p /home/ruoyi
-# 指定路径
-WORKDIR /home/ruoyi
-# 复制jar文件到路径
-COPY ./jar/ruoyi-modules-system.jar /home/ruoyi/ruoyi-modules-system.jar
-# 启动系统服务
-ENTRYPOINT ["java","-jar","ruoyi-modules-system.jar"]
\ No newline at end of file
diff --git a/docker/ruoyi/modules/system/jar/readme.txt b/docker/ruoyi/modules/system/jar/readme.txt
deleted file mode 100644
index cfc2a927..00000000
--- a/docker/ruoyi/modules/system/jar/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-ϵͳģõjarļdockerӦá
\ No newline at end of file
diff --git a/docker/ruoyi/visual/monitor/dockerfile b/docker/ruoyi/visual/monitor/dockerfile
deleted file mode 100644
index ea9370a3..00000000
--- a/docker/ruoyi/visual/monitor/dockerfile
+++ /dev/null
@@ -1,15 +0,0 @@
-# 基础镜像
-FROM openjdk:8-jre
-# author
-MAINTAINER ruoyi
-
-# 挂载目录
-VOLUME /home/ruoyi
-# 创建目录
-RUN mkdir -p /home/ruoyi
-# 指定路径
-WORKDIR /home/ruoyi
-# 复制jar文件到路径
-COPY ./jar/ruoyi-visual-monitor.jar /home/ruoyi/ruoyi-visual-monitor.jar
-# 启动系统服务
-ENTRYPOINT ["java","-jar","ruoyi-visual-monitor.jar"]
\ No newline at end of file
diff --git a/docker/ruoyi/visual/monitor/jar/readme.txt b/docker/ruoyi/visual/monitor/jar/readme.txt
deleted file mode 100644
index 62b28410..00000000
--- a/docker/ruoyi/visual/monitor/jar/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-żĴõjarļdockerӦá
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index fefcdca7..ea0ec8fc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,6 +35,7 @@
4.1.2
1.6.9
2.14.4
+ 3.5.2
@@ -216,6 +217,15 @@
ruoyi-api-system
${ruoyi.version}
+
+ com.baomidou
+ mybatis-plus-boot-starter
+ ${mybatis-plus.version}
+
+
+ org.projectlombok
+ lombok
+
diff --git a/ruoyi-auth/src/main/resources/bootstrap.yml b/ruoyi-auth/src/main/resources/bootstrap.yml
index 5e6ec653..b3d1cbda 100644
--- a/ruoyi-auth/src/main/resources/bootstrap.yml
+++ b/ruoyi-auth/src/main/resources/bootstrap.yml
@@ -15,9 +15,11 @@ spring:
discovery:
# 服务注册地址
server-addr: 124.222.144.55:8848
+ namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
config:
# 配置中心地址
server-addr: 124.222.144.55:8848
+ namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
# 配置文件格式
file-extension: yml
# 共享配置
diff --git a/ruoyi-gateway/src/main/resources/bootstrap.yml b/ruoyi-gateway/src/main/resources/bootstrap.yml
index 2a4c4cb0..dd3075f9 100644
--- a/ruoyi-gateway/src/main/resources/bootstrap.yml
+++ b/ruoyi-gateway/src/main/resources/bootstrap.yml
@@ -15,9 +15,11 @@ spring:
discovery:
# 服务注册地址
server-addr: 124.222.144.55:8848
+ namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
config:
# 配置中心地址
server-addr: 124.222.144.55:8848
+ namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
# 配置文件格式
file-extension: yml
# 共享配置
diff --git a/ruoyi-modules/pom.xml b/ruoyi-modules/pom.xml
index 22c84bdd..6a6c18a1 100644
--- a/ruoyi-modules/pom.xml
+++ b/ruoyi-modules/pom.xml
@@ -13,6 +13,7 @@
ruoyi-gen
ruoyi-job
ruoyi-file
+ ruoyi-btc
ruoyi-modules
diff --git a/ruoyi-modules/ruoyi-btc/pom.xml b/ruoyi-modules/ruoyi-btc/pom.xml
new file mode 100644
index 00000000..6cb9c61b
--- /dev/null
+++ b/ruoyi-modules/ruoyi-btc/pom.xml
@@ -0,0 +1,80 @@
+
+
+
+ com.ruoyi
+ ruoyi-modules
+ 3.6.4
+
+ 4.0.0
+
+ ruoyi-modules-btc
+
+
+ ruoyi-modules-btc三方业务服务
+
+
+
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-discovery
+
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-config
+
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-sentinel
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+
+
+ com.ruoyi
+ ruoyi-api-system
+
+
+ org.projectlombok
+ lombok
+
+
+
+
+
+ ${project.artifactId}
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+ repackage
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ruoyi-modules/ruoyi-btc/src/main/java/com/ruoyi/btc/RuoYiBtcApplication.java b/ruoyi-modules/ruoyi-btc/src/main/java/com/ruoyi/btc/RuoYiBtcApplication.java
new file mode 100644
index 00000000..a6f4d7af
--- /dev/null
+++ b/ruoyi-modules/ruoyi-btc/src/main/java/com/ruoyi/btc/RuoYiBtcApplication.java
@@ -0,0 +1,20 @@
+package com.ruoyi.btc;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+
+/**
+ * 文件服务
+ *
+ * @author ruoyi
+ */
+@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
+public class RuoYiBtcApplication
+{
+ public static void main(String[] args)
+ {
+ SpringApplication.run(RuoYiBtcApplication.class, args);
+ System.out.println("(♥◠‿◠)ノ゙ 文件服务模块启动成功 ლ(´ڡ`ლ)゙ \n");
+ }
+}
diff --git a/ruoyi-modules/ruoyi-btc/src/main/java/com/ruoyi/btc/controller/PublicHalfController.java b/ruoyi-modules/ruoyi-btc/src/main/java/com/ruoyi/btc/controller/PublicHalfController.java
new file mode 100644
index 00000000..453866e0
--- /dev/null
+++ b/ruoyi-modules/ruoyi-btc/src/main/java/com/ruoyi/btc/controller/PublicHalfController.java
@@ -0,0 +1,33 @@
+package com.ruoyi.btc.controller;
+
+import com.ruoyi.btc.service.ISysPublicHalfService;
+import com.ruoyi.common.core.web.domain.AjaxResult;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 半流程API接口写这里
+ *
+ * @author z
+ */
+@RestController
+@Slf4j
+@RequestMapping("/half/api")
+@RequiredArgsConstructor
+public class PublicHalfController{
+ private final ISysPublicHalfService sysPublicHalfService;
+
+ /**
+ * 通用半流程撞库
+ */
+ @PostMapping("check")
+ public AjaxResult upload(MultipartFile file)
+ {
+
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/ruoyi-modules/ruoyi-btc/src/main/java/com/ruoyi/btc/service/ISysPublicHalfService.java b/ruoyi-modules/ruoyi-btc/src/main/java/com/ruoyi/btc/service/ISysPublicHalfService.java
new file mode 100644
index 00000000..e2563d9e
--- /dev/null
+++ b/ruoyi-modules/ruoyi-btc/src/main/java/com/ruoyi/btc/service/ISysPublicHalfService.java
@@ -0,0 +1,11 @@
+package com.ruoyi.btc.service;
+
+/**
+ * 文件上传接口
+ *
+ * @author ruoyi
+ */
+public interface ISysPublicHalfService
+{
+
+}
diff --git a/ruoyi-modules/ruoyi-btc/src/main/java/com/ruoyi/btc/service/impl/SysPublicHalfServiceImpl.java b/ruoyi-modules/ruoyi-btc/src/main/java/com/ruoyi/btc/service/impl/SysPublicHalfServiceImpl.java
new file mode 100644
index 00000000..e7791779
--- /dev/null
+++ b/ruoyi-modules/ruoyi-btc/src/main/java/com/ruoyi/btc/service/impl/SysPublicHalfServiceImpl.java
@@ -0,0 +1,17 @@
+package com.ruoyi.btc.service.impl;
+
+import com.ruoyi.btc.service.ISysPublicHalfService;
+import org.springframework.context.annotation.Primary;
+import org.springframework.stereotype.Service;
+
+/**
+ * 本地文件存储
+ *
+ * @author ruoyi
+ */
+@Primary
+@Service
+public class SysPublicHalfServiceImpl implements ISysPublicHalfService
+{
+
+}
diff --git a/ruoyi-modules/ruoyi-btc/src/main/resources/banner.txt b/ruoyi-modules/ruoyi-btc/src/main/resources/banner.txt
new file mode 100644
index 00000000..27cacb9c
--- /dev/null
+++ b/ruoyi-modules/ruoyi-btc/src/main/resources/banner.txt
@@ -0,0 +1,10 @@
+Spring Boot Version: ${spring-boot.version}
+Spring Application Name: ${spring.application.name}
+ _ __ _ _
+ (_) / _|(_)| |
+ _ __ _ _ ___ _ _ _ ______ | |_ _ | | ___
+| '__|| | | | / _ \ | | | || ||______|| _|| || | / _ \
+| | | |_| || (_) || |_| || | | | | || || __/
+|_| \__,_| \___/ \__, ||_| |_| |_||_| \___|
+ __/ |
+ |___/
\ No newline at end of file
diff --git a/ruoyi-modules/ruoyi-btc/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-btc/src/main/resources/bootstrap.yml
new file mode 100644
index 00000000..93c2745e
--- /dev/null
+++ b/ruoyi-modules/ruoyi-btc/src/main/resources/bootstrap.yml
@@ -0,0 +1,27 @@
+# Tomcat
+server:
+ port: 9301
+
+# Spring
+spring:
+ application:
+ # 应用名称
+ name: ruoyi-btc
+ profiles:
+ # 环境配置
+ active: dev
+ cloud:
+ nacos:
+ discovery:
+ # 服务注册地址
+ server-addr: 124.222.144.55:8848
+ namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
+ config:
+ # 配置中心地址
+ server-addr: 124.222.144.55:8848
+ namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
+ # 配置文件格式
+ file-extension: yml
+ # 共享配置
+ shared-configs:
+ - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
diff --git a/ruoyi-modules/ruoyi-btc/src/main/resources/logback.xml b/ruoyi-modules/ruoyi-btc/src/main/resources/logback.xml
new file mode 100644
index 00000000..ed6c17d3
--- /dev/null
+++ b/ruoyi-modules/ruoyi-btc/src/main/resources/logback.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+ ${log.pattern}
+
+
+
+
+
+ ${log.path}/info.log
+
+
+
+ ${log.path}/info.%d{yyyy-MM-dd}.log
+
+ 60
+
+
+ ${log.pattern}
+
+
+
+ INFO
+
+ ACCEPT
+
+ DENY
+
+
+
+
+ ${log.path}/error.log
+
+
+
+ ${log.path}/error.%d{yyyy-MM-dd}.log
+
+ 60
+
+
+ ${log.pattern}
+
+
+
+ ERROR
+
+ ACCEPT
+
+ DENY
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/config/MinioConfig.java b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/config/MinioConfig.java
index ee3e14c2..29beea08 100644
--- a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/config/MinioConfig.java
+++ b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/config/MinioConfig.java
@@ -1,82 +1,82 @@
-package com.ruoyi.file.config;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import io.minio.MinioClient;
-
-/**
- * Minio 配置信息
- *
- * @author ruoyi
- */
-@Configuration
-@ConfigurationProperties(prefix = "minio")
-public class MinioConfig
-{
- /**
- * 服务地址
- */
- private String url;
-
- /**
- * 用户名
- */
- private String accessKey;
-
- /**
- * 密码
- */
- private String secretKey;
-
- /**
- * 存储桶名称
- */
- private String bucketName;
-
- public String getUrl()
- {
- return url;
- }
-
- public void setUrl(String url)
- {
- this.url = url;
- }
-
- public String getAccessKey()
- {
- return accessKey;
- }
-
- public void setAccessKey(String accessKey)
- {
- this.accessKey = accessKey;
- }
-
- public String getSecretKey()
- {
- return secretKey;
- }
-
- public void setSecretKey(String secretKey)
- {
- this.secretKey = secretKey;
- }
-
- public String getBucketName()
- {
- return bucketName;
- }
-
- public void setBucketName(String bucketName)
- {
- this.bucketName = bucketName;
- }
-
- @Bean
- public MinioClient getMinioClient()
- {
- return MinioClient.builder().endpoint(url).credentials(accessKey, secretKey).build();
- }
-}
+package com.ruoyi.file.config;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import io.minio.MinioClient;
+
+/**
+ * Minio 配置信息
+ *
+ * @author ruoyi
+ */
+@Configuration
+@ConfigurationProperties(prefix = "minio")
+public class MinioConfig
+{
+ /**
+ * 服务地址
+ */
+ private String url;
+
+ /**
+ * 用户名
+ */
+ private String accessKey;
+
+ /**
+ * 密码
+ */
+ private String secretKey;
+
+ /**
+ * 存储桶名称
+ */
+ private String bucketName;
+
+ public String getUrl()
+ {
+ return url;
+ }
+
+ public void setUrl(String url)
+ {
+ this.url = url;
+ }
+
+ public String getAccessKey()
+ {
+ return accessKey;
+ }
+
+ public void setAccessKey(String accessKey)
+ {
+ this.accessKey = accessKey;
+ }
+
+ public String getSecretKey()
+ {
+ return secretKey;
+ }
+
+ public void setSecretKey(String secretKey)
+ {
+ this.secretKey = secretKey;
+ }
+
+ public String getBucketName()
+ {
+ return bucketName;
+ }
+
+ public void setBucketName(String bucketName)
+ {
+ this.bucketName = bucketName;
+ }
+
+ @Bean
+ public MinioClient getMinioClient()
+ {
+ return MinioClient.builder().endpoint(url).credentials(accessKey, secretKey).build();
+ }
+}
diff --git a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/config/ResourcesConfig.java b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/config/ResourcesConfig.java
index 3bca6686..80036702 100644
--- a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/config/ResourcesConfig.java
+++ b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/config/ResourcesConfig.java
@@ -1,50 +1,50 @@
-package com.ruoyi.file.config;
-
-import java.io.File;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-/**
- * 通用映射配置
- *
- * @author ruoyi
- */
-@Configuration
-public class ResourcesConfig implements WebMvcConfigurer
-{
- /**
- * 上传文件存储在本地的根路径
- */
- @Value("${file.path}")
- private String localFilePath;
-
- /**
- * 资源映射路径 前缀
- */
- @Value("${file.prefix}")
- public String localFilePrefix;
-
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry)
- {
- /** 本地文件上传路径 */
- registry.addResourceHandler(localFilePrefix + "/**")
- .addResourceLocations("file:" + localFilePath + File.separator);
- }
-
- /**
- * 开启跨域
- */
- @Override
- public void addCorsMappings(CorsRegistry registry) {
- // 设置允许跨域的路由
- registry.addMapping(localFilePrefix + "/**")
- // 设置允许跨域请求的域名
- .allowedOrigins("*")
- // 设置允许的方法
- .allowedMethods("GET");
- }
+package com.ruoyi.file.config;
+
+import java.io.File;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * 通用映射配置
+ *
+ * @author ruoyi
+ */
+@Configuration
+public class ResourcesConfig implements WebMvcConfigurer
+{
+ /**
+ * 上传文件存储在本地的根路径
+ */
+ @Value("${file.path}")
+ private String localFilePath;
+
+ /**
+ * 资源映射路径 前缀
+ */
+ @Value("${file.prefix}")
+ public String localFilePrefix;
+
+ @Override
+ public void addResourceHandlers(ResourceHandlerRegistry registry)
+ {
+ /** 本地文件上传路径 */
+ registry.addResourceHandler(localFilePrefix + "/**")
+ .addResourceLocations("file:" + localFilePath + File.separator);
+ }
+
+ /**
+ * 开启跨域
+ */
+ @Override
+ public void addCorsMappings(CorsRegistry registry) {
+ // 设置允许跨域的路由
+ registry.addMapping(localFilePrefix + "/**")
+ // 设置允许跨域请求的域名
+ .allowedOrigins("*")
+ // 设置允许的方法
+ .allowedMethods("GET");
+ }
}
\ No newline at end of file
diff --git a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/controller/SysFileController.java b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/controller/SysFileController.java
index 318db416..45f86b06 100644
--- a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/controller/SysFileController.java
+++ b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/controller/SysFileController.java
@@ -1,48 +1,48 @@
-package com.ruoyi.file.controller;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.multipart.MultipartFile;
-import com.ruoyi.common.core.domain.R;
-import com.ruoyi.common.core.utils.file.FileUtils;
-import com.ruoyi.file.service.ISysFileService;
-import com.ruoyi.system.api.domain.SysFile;
-
-/**
- * 文件请求处理
- *
- * @author ruoyi
- */
-@RestController
-public class SysFileController
-{
- private static final Logger log = LoggerFactory.getLogger(SysFileController.class);
-
- @Autowired
- private ISysFileService sysFileService;
-
- /**
- * 文件上传请求
- */
- @PostMapping("upload")
- public R upload(MultipartFile file)
- {
- try
- {
- // 上传并返回访问地址
- String url = sysFileService.uploadFile(file);
- SysFile sysFile = new SysFile();
- sysFile.setName(FileUtils.getName(url));
- sysFile.setUrl(url);
- return R.ok(sysFile);
- }
- catch (Exception e)
- {
- log.error("上传文件失败", e);
- return R.fail(e.getMessage());
- }
- }
+package com.ruoyi.file.controller;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.utils.file.FileUtils;
+import com.ruoyi.file.service.ISysFileService;
+import com.ruoyi.system.api.domain.SysFile;
+
+/**
+ * 文件请求处理
+ *
+ * @author ruoyi
+ */
+@RestController
+public class SysFileController
+{
+ private static final Logger log = LoggerFactory.getLogger(SysFileController.class);
+
+ @Autowired
+ private ISysFileService sysFileService;
+
+ /**
+ * 文件上传请求
+ */
+ @PostMapping("upload")
+ public R upload(MultipartFile file)
+ {
+ try
+ {
+ // 上传并返回访问地址
+ String url = sysFileService.uploadFile(file);
+ SysFile sysFile = new SysFile();
+ sysFile.setName(FileUtils.getName(url));
+ sysFile.setUrl(url);
+ return R.ok(sysFile);
+ }
+ catch (Exception e)
+ {
+ log.error("上传文件失败", e);
+ return R.fail(e.getMessage());
+ }
+ }
}
\ No newline at end of file
diff --git a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/FastDfsSysFileServiceImpl.java b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/FastDfsSysFileServiceImpl.java
index 989edb71..0f85449b 100644
--- a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/FastDfsSysFileServiceImpl.java
+++ b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/FastDfsSysFileServiceImpl.java
@@ -1,46 +1,46 @@
-package com.ruoyi.file.service;
-
-import java.io.InputStream;
-import com.alibaba.nacos.common.utils.IoUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.MultipartFile;
-import com.github.tobato.fastdfs.domain.fdfs.StorePath;
-import com.github.tobato.fastdfs.service.FastFileStorageClient;
-import com.ruoyi.common.core.utils.file.FileTypeUtils;
-
-/**
- * FastDFS 文件存储
- *
- * @author ruoyi
- */
-@Service
-public class FastDfsSysFileServiceImpl implements ISysFileService
-{
- /**
- * 域名或本机访问地址
- */
- @Value("${fdfs.domain}")
- public String domain;
-
- @Autowired
- private FastFileStorageClient storageClient;
-
- /**
- * FastDfs文件上传接口
- *
- * @param file 上传的文件
- * @return 访问地址
- * @throws Exception
- */
- @Override
- public String uploadFile(MultipartFile file) throws Exception
- {
- InputStream inputStream = file.getInputStream();
- StorePath storePath = storageClient.uploadFile(inputStream, file.getSize(),
- FileTypeUtils.getExtension(file), null);
- IoUtils.closeQuietly(inputStream);
- return domain + "/" + storePath.getFullPath();
- }
-}
+package com.ruoyi.file.service;
+
+import java.io.InputStream;
+import com.alibaba.nacos.common.utils.IoUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+import com.github.tobato.fastdfs.domain.fdfs.StorePath;
+import com.github.tobato.fastdfs.service.FastFileStorageClient;
+import com.ruoyi.common.core.utils.file.FileTypeUtils;
+
+/**
+ * FastDFS 文件存储
+ *
+ * @author ruoyi
+ */
+@Service
+public class FastDfsSysFileServiceImpl implements ISysFileService
+{
+ /**
+ * 域名或本机访问地址
+ */
+ @Value("${fdfs.domain}")
+ public String domain;
+
+ @Autowired
+ private FastFileStorageClient storageClient;
+
+ /**
+ * FastDfs文件上传接口
+ *
+ * @param file 上传的文件
+ * @return 访问地址
+ * @throws Exception
+ */
+ @Override
+ public String uploadFile(MultipartFile file) throws Exception
+ {
+ InputStream inputStream = file.getInputStream();
+ StorePath storePath = storageClient.uploadFile(inputStream, file.getSize(),
+ FileTypeUtils.getExtension(file), null);
+ IoUtils.closeQuietly(inputStream);
+ return domain + "/" + storePath.getFullPath();
+ }
+}
diff --git a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/ISysFileService.java b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/ISysFileService.java
index 5a353489..c95e6f25 100644
--- a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/ISysFileService.java
+++ b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/ISysFileService.java
@@ -1,20 +1,20 @@
-package com.ruoyi.file.service;
-
-import org.springframework.web.multipart.MultipartFile;
-
-/**
- * 文件上传接口
- *
- * @author ruoyi
- */
-public interface ISysFileService
-{
- /**
- * 文件上传接口
- *
- * @param file 上传的文件
- * @return 访问地址
- * @throws Exception
- */
- public String uploadFile(MultipartFile file) throws Exception;
-}
+package com.ruoyi.file.service;
+
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 文件上传接口
+ *
+ * @author ruoyi
+ */
+public interface ISysFileService
+{
+ /**
+ * 文件上传接口
+ *
+ * @param file 上传的文件
+ * @return 访问地址
+ * @throws Exception
+ */
+ public String uploadFile(MultipartFile file) throws Exception;
+}
diff --git a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/LocalSysFileServiceImpl.java b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/LocalSysFileServiceImpl.java
index c0e20681..3247e9bc 100644
--- a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/LocalSysFileServiceImpl.java
+++ b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/LocalSysFileServiceImpl.java
@@ -1,50 +1,50 @@
-package com.ruoyi.file.service;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Primary;
-import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.MultipartFile;
-import com.ruoyi.file.utils.FileUploadUtils;
-
-/**
- * 本地文件存储
- *
- * @author ruoyi
- */
-@Primary
-@Service
-public class LocalSysFileServiceImpl implements ISysFileService
-{
- /**
- * 资源映射路径 前缀
- */
- @Value("${file.prefix}")
- public String localFilePrefix;
-
- /**
- * 域名或本机访问地址
- */
- @Value("${file.domain}")
- public String domain;
-
- /**
- * 上传文件存储在本地的根路径
- */
- @Value("${file.path}")
- private String localFilePath;
-
- /**
- * 本地文件上传接口
- *
- * @param file 上传的文件
- * @return 访问地址
- * @throws Exception
- */
- @Override
- public String uploadFile(MultipartFile file) throws Exception
- {
- String name = FileUploadUtils.upload(localFilePath, file);
- String url = domain + localFilePrefix + name;
- return url;
- }
-}
+package com.ruoyi.file.service;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Primary;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+import com.ruoyi.file.utils.FileUploadUtils;
+
+/**
+ * 本地文件存储
+ *
+ * @author ruoyi
+ */
+@Primary
+@Service
+public class LocalSysFileServiceImpl implements ISysFileService
+{
+ /**
+ * 资源映射路径 前缀
+ */
+ @Value("${file.prefix}")
+ public String localFilePrefix;
+
+ /**
+ * 域名或本机访问地址
+ */
+ @Value("${file.domain}")
+ public String domain;
+
+ /**
+ * 上传文件存储在本地的根路径
+ */
+ @Value("${file.path}")
+ private String localFilePath;
+
+ /**
+ * 本地文件上传接口
+ *
+ * @param file 上传的文件
+ * @return 访问地址
+ * @throws Exception
+ */
+ @Override
+ public String uploadFile(MultipartFile file) throws Exception
+ {
+ String name = FileUploadUtils.upload(localFilePath, file);
+ String url = domain + localFilePrefix + name;
+ return url;
+ }
+}
diff --git a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/MinioSysFileServiceImpl.java b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/MinioSysFileServiceImpl.java
index 4a0b6c4b..f53d86f9 100644
--- a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/MinioSysFileServiceImpl.java
+++ b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/MinioSysFileServiceImpl.java
@@ -1,49 +1,49 @@
-package com.ruoyi.file.service;
-
-import java.io.InputStream;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.MultipartFile;
-import com.alibaba.nacos.common.utils.IoUtils;
-import com.ruoyi.file.config.MinioConfig;
-import com.ruoyi.file.utils.FileUploadUtils;
-import io.minio.MinioClient;
-import io.minio.PutObjectArgs;
-
-/**
- * Minio 文件存储
- *
- * @author ruoyi
- */
-@Service
-public class MinioSysFileServiceImpl implements ISysFileService
-{
- @Autowired
- private MinioConfig minioConfig;
-
- @Autowired
- private MinioClient client;
-
- /**
- * Minio文件上传接口
- *
- * @param file 上传的文件
- * @return 访问地址
- * @throws Exception
- */
- @Override
- public String uploadFile(MultipartFile file) throws Exception
- {
- String fileName = FileUploadUtils.extractFilename(file);
- InputStream inputStream = file.getInputStream();
- PutObjectArgs args = PutObjectArgs.builder()
- .bucket(minioConfig.getBucketName())
- .object(fileName)
- .stream(inputStream, file.getSize(), -1)
- .contentType(file.getContentType())
- .build();
- client.putObject(args);
- IoUtils.closeQuietly(inputStream);
- return minioConfig.getUrl() + "/" + minioConfig.getBucketName() + "/" + fileName;
- }
-}
+package com.ruoyi.file.service;
+
+import java.io.InputStream;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+import com.alibaba.nacos.common.utils.IoUtils;
+import com.ruoyi.file.config.MinioConfig;
+import com.ruoyi.file.utils.FileUploadUtils;
+import io.minio.MinioClient;
+import io.minio.PutObjectArgs;
+
+/**
+ * Minio 文件存储
+ *
+ * @author ruoyi
+ */
+@Service
+public class MinioSysFileServiceImpl implements ISysFileService
+{
+ @Autowired
+ private MinioConfig minioConfig;
+
+ @Autowired
+ private MinioClient client;
+
+ /**
+ * Minio文件上传接口
+ *
+ * @param file 上传的文件
+ * @return 访问地址
+ * @throws Exception
+ */
+ @Override
+ public String uploadFile(MultipartFile file) throws Exception
+ {
+ String fileName = FileUploadUtils.extractFilename(file);
+ InputStream inputStream = file.getInputStream();
+ PutObjectArgs args = PutObjectArgs.builder()
+ .bucket(minioConfig.getBucketName())
+ .object(fileName)
+ .stream(inputStream, file.getSize(), -1)
+ .contentType(file.getContentType())
+ .build();
+ client.putObject(args);
+ IoUtils.closeQuietly(inputStream);
+ return minioConfig.getUrl() + "/" + minioConfig.getBucketName() + "/" + fileName;
+ }
+}
diff --git a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/FileUploadUtils.java b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/FileUploadUtils.java
index b53c3fa3..6ae02049 100644
--- a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/FileUploadUtils.java
+++ b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/utils/FileUploadUtils.java
@@ -1,185 +1,185 @@
-package com.ruoyi.file.utils;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Paths;
-import java.util.Objects;
-import org.apache.commons.io.FilenameUtils;
-import org.springframework.web.multipart.MultipartFile;
-import com.ruoyi.common.core.exception.file.FileException;
-import com.ruoyi.common.core.exception.file.FileNameLengthLimitExceededException;
-import com.ruoyi.common.core.exception.file.FileSizeLimitExceededException;
-import com.ruoyi.common.core.exception.file.InvalidExtensionException;
-import com.ruoyi.common.core.utils.DateUtils;
-import com.ruoyi.common.core.utils.StringUtils;
-import com.ruoyi.common.core.utils.file.FileTypeUtils;
-import com.ruoyi.common.core.utils.file.MimeTypeUtils;
-import com.ruoyi.common.core.utils.uuid.Seq;
-
-/**
- * 文件上传工具类
- *
- * @author ruoyi
- */
-public class FileUploadUtils
-{
- /**
- * 默认大小 50M
- */
- public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024L;
-
- /**
- * 默认的文件名最大长度 100
- */
- public static final int DEFAULT_FILE_NAME_LENGTH = 100;
-
- /**
- * 根据文件路径上传
- *
- * @param baseDir 相对应用的基目录
- * @param file 上传的文件
- * @return 文件名称
- * @throws IOException
- */
- public static final String upload(String baseDir, MultipartFile file) throws IOException
- {
- try
- {
- return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
- }
- catch (FileException fe)
- {
- throw new IOException(fe.getDefaultMessage(), fe);
- }
- catch (Exception e)
- {
- throw new IOException(e.getMessage(), e);
- }
- }
-
- /**
- * 文件上传
- *
- * @param baseDir 相对应用的基目录
- * @param file 上传的文件
- * @param allowedExtension 上传文件类型
- * @return 返回上传成功的文件名
- * @throws FileSizeLimitExceededException 如果超出最大大小
- * @throws FileNameLengthLimitExceededException 文件名太长
- * @throws IOException 比如读写文件出错时
- * @throws InvalidExtensionException 文件校验异常
- */
- public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension)
- throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
- InvalidExtensionException
- {
- int fileNamelength = Objects.requireNonNull(file.getOriginalFilename()).length();
- if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
- {
- throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
- }
-
- assertAllowed(file, allowedExtension);
-
- String fileName = extractFilename(file);
-
- String absPath = getAbsoluteFile(baseDir, fileName).getAbsolutePath();
- file.transferTo(Paths.get(absPath));
- return getPathFileName(fileName);
- }
-
- /**
- * 编码文件名
- */
- public static final String extractFilename(MultipartFile file)
- {
- return StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(),
- FilenameUtils.getBaseName(file.getOriginalFilename()), Seq.getId(Seq.uploadSeqType), FileTypeUtils.getExtension(file));
- }
-
- private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
- {
- File desc = new File(uploadDir + File.separator + fileName);
-
- if (!desc.exists())
- {
- if (!desc.getParentFile().exists())
- {
- desc.getParentFile().mkdirs();
- }
- }
- return desc.isAbsolute() ? desc : desc.getAbsoluteFile();
- }
-
- private static final String getPathFileName(String fileName) throws IOException
- {
- String pathFileName = "/" + fileName;
- return pathFileName;
- }
-
- /**
- * 文件大小校验
- *
- * @param file 上传的文件
- * @throws FileSizeLimitExceededException 如果超出最大大小
- * @throws InvalidExtensionException 文件校验异常
- */
- public static final void assertAllowed(MultipartFile file, String[] allowedExtension)
- throws FileSizeLimitExceededException, InvalidExtensionException
- {
- long size = file.getSize();
- if (size > DEFAULT_MAX_SIZE)
- {
- throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024);
- }
-
- String fileName = file.getOriginalFilename();
- String extension = FileTypeUtils.getExtension(file);
- if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension))
- {
- if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION)
- {
- throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension,
- fileName);
- }
- else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION)
- {
- throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension,
- fileName);
- }
- else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION)
- {
- throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension,
- fileName);
- }
- else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION)
- {
- throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension,
- fileName);
- }
- else
- {
- throw new InvalidExtensionException(allowedExtension, extension, fileName);
- }
- }
- }
-
- /**
- * 判断MIME类型是否是允许的MIME类型
- *
- * @param extension 上传文件类型
- * @param allowedExtension 允许上传文件类型
- * @return true/false
- */
- public static final boolean isAllowedExtension(String extension, String[] allowedExtension)
- {
- for (String str : allowedExtension)
- {
- if (str.equalsIgnoreCase(extension))
- {
- return true;
- }
- }
- return false;
- }
+package com.ruoyi.file.utils;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Paths;
+import java.util.Objects;
+import org.apache.commons.io.FilenameUtils;
+import org.springframework.web.multipart.MultipartFile;
+import com.ruoyi.common.core.exception.file.FileException;
+import com.ruoyi.common.core.exception.file.FileNameLengthLimitExceededException;
+import com.ruoyi.common.core.exception.file.FileSizeLimitExceededException;
+import com.ruoyi.common.core.exception.file.InvalidExtensionException;
+import com.ruoyi.common.core.utils.DateUtils;
+import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.core.utils.file.FileTypeUtils;
+import com.ruoyi.common.core.utils.file.MimeTypeUtils;
+import com.ruoyi.common.core.utils.uuid.Seq;
+
+/**
+ * 文件上传工具类
+ *
+ * @author ruoyi
+ */
+public class FileUploadUtils
+{
+ /**
+ * 默认大小 50M
+ */
+ public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024L;
+
+ /**
+ * 默认的文件名最大长度 100
+ */
+ public static final int DEFAULT_FILE_NAME_LENGTH = 100;
+
+ /**
+ * 根据文件路径上传
+ *
+ * @param baseDir 相对应用的基目录
+ * @param file 上传的文件
+ * @return 文件名称
+ * @throws IOException
+ */
+ public static final String upload(String baseDir, MultipartFile file) throws IOException
+ {
+ try
+ {
+ return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
+ }
+ catch (FileException fe)
+ {
+ throw new IOException(fe.getDefaultMessage(), fe);
+ }
+ catch (Exception e)
+ {
+ throw new IOException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * 文件上传
+ *
+ * @param baseDir 相对应用的基目录
+ * @param file 上传的文件
+ * @param allowedExtension 上传文件类型
+ * @return 返回上传成功的文件名
+ * @throws FileSizeLimitExceededException 如果超出最大大小
+ * @throws FileNameLengthLimitExceededException 文件名太长
+ * @throws IOException 比如读写文件出错时
+ * @throws InvalidExtensionException 文件校验异常
+ */
+ public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension)
+ throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
+ InvalidExtensionException
+ {
+ int fileNamelength = Objects.requireNonNull(file.getOriginalFilename()).length();
+ if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
+ {
+ throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
+ }
+
+ assertAllowed(file, allowedExtension);
+
+ String fileName = extractFilename(file);
+
+ String absPath = getAbsoluteFile(baseDir, fileName).getAbsolutePath();
+ file.transferTo(Paths.get(absPath));
+ return getPathFileName(fileName);
+ }
+
+ /**
+ * 编码文件名
+ */
+ public static final String extractFilename(MultipartFile file)
+ {
+ return StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(),
+ FilenameUtils.getBaseName(file.getOriginalFilename()), Seq.getId(Seq.uploadSeqType), FileTypeUtils.getExtension(file));
+ }
+
+ private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
+ {
+ File desc = new File(uploadDir + File.separator + fileName);
+
+ if (!desc.exists())
+ {
+ if (!desc.getParentFile().exists())
+ {
+ desc.getParentFile().mkdirs();
+ }
+ }
+ return desc.isAbsolute() ? desc : desc.getAbsoluteFile();
+ }
+
+ private static final String getPathFileName(String fileName) throws IOException
+ {
+ String pathFileName = "/" + fileName;
+ return pathFileName;
+ }
+
+ /**
+ * 文件大小校验
+ *
+ * @param file 上传的文件
+ * @throws FileSizeLimitExceededException 如果超出最大大小
+ * @throws InvalidExtensionException 文件校验异常
+ */
+ public static final void assertAllowed(MultipartFile file, String[] allowedExtension)
+ throws FileSizeLimitExceededException, InvalidExtensionException
+ {
+ long size = file.getSize();
+ if (size > DEFAULT_MAX_SIZE)
+ {
+ throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024);
+ }
+
+ String fileName = file.getOriginalFilename();
+ String extension = FileTypeUtils.getExtension(file);
+ if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension))
+ {
+ if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION)
+ {
+ throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension,
+ fileName);
+ }
+ else if (allowedExtension == MimeTypeUtils.FLASH_EXTENSION)
+ {
+ throw new InvalidExtensionException.InvalidFlashExtensionException(allowedExtension, extension,
+ fileName);
+ }
+ else if (allowedExtension == MimeTypeUtils.MEDIA_EXTENSION)
+ {
+ throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension,
+ fileName);
+ }
+ else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION)
+ {
+ throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension,
+ fileName);
+ }
+ else
+ {
+ throw new InvalidExtensionException(allowedExtension, extension, fileName);
+ }
+ }
+ }
+
+ /**
+ * 判断MIME类型是否是允许的MIME类型
+ *
+ * @param extension 上传文件类型
+ * @param allowedExtension 允许上传文件类型
+ * @return true/false
+ */
+ public static final boolean isAllowedExtension(String extension, String[] allowedExtension)
+ {
+ for (String str : allowedExtension)
+ {
+ if (str.equalsIgnoreCase(extension))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
}
\ No newline at end of file
diff --git a/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml
index 01f26566..15a8f393 100644
--- a/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml
+++ b/ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml
@@ -15,9 +15,11 @@ spring:
discovery:
# 服务注册地址
server-addr: 124.222.144.55:8848
+ namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
config:
# 配置中心地址
server-addr: 124.222.144.55:8848
+ namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
# 配置文件格式
file-extension: yml
# 共享配置
diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml
index ebd802e4..e7776f1a 100644
--- a/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml
+++ b/ruoyi-modules/ruoyi-gen/src/main/resources/bootstrap.yml
@@ -15,9 +15,11 @@ spring:
discovery:
# 服务注册地址
server-addr: 124.222.144.55:8848
+ namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
config:
# 配置中心地址
server-addr: 124.222.144.55:8848
+ namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
# 配置文件格式
file-extension: yml
# 共享配置
diff --git a/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml
index 896020f5..99a0a25b 100644
--- a/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml
+++ b/ruoyi-modules/ruoyi-job/src/main/resources/bootstrap.yml
@@ -15,9 +15,11 @@ spring:
discovery:
# 服务注册地址
server-addr: 124.222.144.55:8848
+ namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
config:
# 配置中心地址
server-addr: 124.222.144.55:8848
+ namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
# 配置文件格式
file-extension: yml
# 共享配置
diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml
index d7b2aa14..f9f159f2 100644
--- a/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml
+++ b/ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml
@@ -15,9 +15,11 @@ spring:
discovery:
# 服务注册地址
server-addr: 124.222.144.55:8848
+ namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
config:
# 配置中心地址
server-addr: 124.222.144.55:8848
+ namespace: 9a5181d5-598c-4b27-9644-ef14e7fd250c
# 配置文件格式
file-extension: yml
# 共享配置