update 更改整体配置策略 使用注册中心命名空间隔离

2.X
疯狂的狮子Li 3 years ago
parent eb67caf507
commit 6bf7371d89

@ -1,135 +0,0 @@
# redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
spring:
datasource:
system-master:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: password
gen:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: password
# 多数据源配置
dynamic:
druid:
initial-size: 5
min-idle: 5
maxActive: 20
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
filters: stat,slf4j
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
# seata: true # 开启seata代理开启后默认每个数据源都代理如果某个不需要代理可单独关闭
redis:
# 地址
host: localhost
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password:
# 连接超时时间
timeout: 10s
# 是否开启ssl
ssl: false
# redisson 配置
redisson:
# 线程池数量
threads: 16
# Netty线程池数量
nettyThreads: 32
# 传输模式
transportMode: "NIO"
# 单节点配置
singleServerConfig:
# 客户端名称
clientName: ${ruoyi.name}
# 最小空闲连接数
connectionMinimumIdleSize: 32
# 连接池大小
connectionPoolSize: 64
# 连接空闲超时,单位:毫秒
idleConnectionTimeout: 10000
# 命令等待超时,单位:毫秒
timeout: 3000
# 如果尝试在此限制之内发送成功,则开始启用 timeout 计时。
retryAttempts: 3
# 命令重试发送时间间隔,单位:毫秒
retryInterval: 1500
# 发布和订阅连接的最小空闲连接数
subscriptionConnectionMinimumIdleSize: 1
# 发布和订阅连接池大小
subscriptionConnectionPoolSize: 50
# 单个连接最大订阅数量
subscriptionsPerConnection: 5
# DNS监测时间间隔单位毫秒
dnsMonitoringInterval: 5000
# seata配置
seata:
# 默认关闭如需启用spring.datasource.dynami.seata需要同时开启
enabled: false
# Seata 应用编号,默认为 ${spring.application.name}
application-id: ${spring.application.name}
# Seata 事务组编号,用于 TC 集群名
tx-service-group: ${spring.application.name}-group
# 关闭自动代理
enable-auto-data-source-proxy: false
# 服务配置项
service:
# 虚拟组和分组的映射
vgroup-mapping:
ruoyi-system-group: default
config:
type: nacos
nacos:
serverAddr: ${spring.cloud.nacos.server-addr}
group: SEATA_GROUP
namespace:
registry:
type: nacos
nacos:
application: seata-server
server-addr: ${spring.cloud.nacos.server-addr}
namespace:
# 监控中心配置
monitor:
user:
name: ruoyi
password: 123456
ui:
title: RuoYi-Cloud-Plus服务监控中心
# 本地文件上传
file:
domain: http://127.0.0.1:9300
path: D:/ruoyi/uploadPath
prefix: /statics
# FastDFS配置
fdfs:
domain: http://8.129.231.12
soTimeout: 3000
connectTimeout: 2000
trackerList: 8.129.231.12:22122
# Minio配置
minio:
url: http://8.129.231.12:9000
accessKey: minioadmin
secretKey: minioadmin
bucketName: test

@ -1,135 +0,0 @@
# redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
spring:
datasource:
system-master:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: password
gen:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: password
# 多数据源配置
dynamic:
druid:
initial-size: 5
min-idle: 5
maxActive: 20
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
filters: stat,slf4j
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
# seata: true # 开启seata代理开启后默认每个数据源都代理如果某个不需要代理可单独关闭
redis:
# 地址
host: localhost
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password:
# 连接超时时间
timeout: 10s
# 是否开启ssl
ssl: false
# redisson 配置
redisson:
# 线程池数量
threads: 16
# Netty线程池数量
nettyThreads: 32
# 传输模式
transportMode: "NIO"
# 单节点配置
singleServerConfig:
# 客户端名称
clientName: ${ruoyi.name}
# 最小空闲连接数
connectionMinimumIdleSize: 32
# 连接池大小
connectionPoolSize: 64
# 连接空闲超时,单位:毫秒
idleConnectionTimeout: 10000
# 命令等待超时,单位:毫秒
timeout: 3000
# 如果尝试在此限制之内发送成功,则开始启用 timeout 计时。
retryAttempts: 3
# 命令重试发送时间间隔,单位:毫秒
retryInterval: 1500
# 发布和订阅连接的最小空闲连接数
subscriptionConnectionMinimumIdleSize: 1
# 发布和订阅连接池大小
subscriptionConnectionPoolSize: 50
# 单个连接最大订阅数量
subscriptionsPerConnection: 5
# DNS监测时间间隔单位毫秒
dnsMonitoringInterval: 5000
# seata配置
seata:
# 默认关闭如需启用spring.datasource.dynami.seata需要同时开启
enabled: false
# Seata 应用编号,默认为 ${spring.application.name}
application-id: ${spring.application.name}
# Seata 事务组编号,用于 TC 集群名
tx-service-group: ${spring.application.name}-group
# 关闭自动代理
enable-auto-data-source-proxy: false
# 服务配置项
service:
# 虚拟组和分组的映射
vgroup-mapping:
ruoyi-system-group: default
config:
type: nacos
nacos:
serverAddr: ${spring.cloud.nacos.server-addr}
group: SEATA_GROUP
namespace:
registry:
type: nacos
nacos:
application: seata-server
server-addr: ${spring.cloud.nacos.server-addr}
namespace:
# 监控中心配置
monitor:
user:
name: ruoyi
password: 123456
ui:
title: RuoYi-Cloud-Plus服务监控中心
# 本地文件上传
file:
domain: http://127.0.0.1:9300
path: D:/ruoyi/uploadPath
prefix: /statics
# FastDFS配置
fdfs:
domain: http://8.129.231.12
soTimeout: 3000
connectTimeout: 2000
trackerList: 8.129.231.12:22122
# Minio配置
minio:
url: http://8.129.231.12:9000
accessKey: minioadmin
secretKey: minioadmin
bucketName: test

@ -26,6 +26,8 @@ dubbo:
registry:
address: nacos://${spring.cloud.nacos.server-addr}
group: DUBBO_GROUP
# URL采用精简模式(与元数据中心配合)
simplified: true
# 消费者相关配置
consumer:
# 结果缓存(LRU算法)
@ -53,107 +55,63 @@ spring:
date-format: yyyy-MM-dd HH:mm:ss
serialization:
# 格式化输出
indent_output: false
INDENT_OUTPUT: false
# 忽略无法转换的对象
fail_on_empty_beans: false
deserialization:
# 允许对象忽略json中不存在的属性
fail_on_unknown_properties: false
cloud:
# 网关配置
gateway:
discovery:
locator:
lowerCaseServiceId: true
enabled: true
routes:
# 认证中心
- id: ruoyi-auth
uri: lb://ruoyi-auth
predicates:
- Path=/auth/**
filters:
# 验证码处理
- CacheRequestFilter
- ValidateCodeFilter
- StripPrefix=1
# 代码生成
- id: ruoyi-gen
uri: lb://ruoyi-gen
predicates:
- Path=/code/**
filters:
- StripPrefix=1
# 定时任务
- id: ruoyi-job
uri: lb://ruoyi-job
predicates:
- Path=/schedule/**
filters:
- StripPrefix=1
# 系统模块
- id: ruoyi-system
uri: lb://ruoyi-system
predicates:
- Path=/system/**
filters:
- StripPrefix=1
# 文件服务
- id: ruoyi-file
uri: lb://ruoyi-file
predicates:
- Path=/file/**
filters:
- StripPrefix=1
# sentinel 配置
sentinel:
# 取消控制台懒加载
eager: true
transport:
# 控制台地址
dashboard: localhost:8718
# 安全配置
security:
# 验证码
captcha:
# 是否开启验证码
enabled: true
# 验证码类型 math 数组计算 char 字符验证
type: MATH
# line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
category: CIRCLE
# 数字验证码位数
numberLength: 1
# 字符验证码长度
charLength: 4
# 防止XSS攻击
xss:
enabled: true
excludeUrls:
- /system/notice
# 不校验白名单
ignore:
whites:
- /auth/logout
- /auth/login
- /auth/register
- /*/v2/api-docs
- /csrf
# redis通用配置 子服务可以自行配置进行覆盖
redis:
host: localhost
port: 6379
password:
database: 0
timeout: 10s
ssl: false
# 暴露监控端点
management:
endpoints:
web:
exposure:
include: '*'
endpoint:
logfile:
external-file: ./logs/${spring.application.name}/console.log
# 日志配置
logging:
level:
org.springframework: warn
org.apache.dubbo: warn
com.alibaba.nacos: warn
config: classpath:logback.xml
# redisson 缓存配置
# redisson 配置
redisson:
# 线程池数量
threads: 16
# Netty线程池数量
nettyThreads: 32
# 传输模式
transportMode: "NIO"
# 单节点配置
singleServerConfig:
# 客户端名称
clientName: ${ruoyi.name}
# 最小空闲连接数
connectionMinimumIdleSize: 32
# 连接池大小
connectionPoolSize: 64
# 连接空闲超时,单位:毫秒
idleConnectionTimeout: 10000
# 命令等待超时,单位:毫秒
timeout: 3000
# 如果尝试在此限制之内发送成功,则开始启用 timeout 计时。
retryAttempts: 3
# 命令重试发送时间间隔,单位:毫秒
retryInterval: 1500
# 发布和订阅连接的最小空闲连接数
subscriptionConnectionMinimumIdleSize: 1
# 发布和订阅连接池大小
subscriptionConnectionPoolSize: 50
# 单个连接最大订阅数量
subscriptionsPerConnection: 5
# DNS监测时间间隔单位毫秒
dnsMonitoringInterval: 5000
# redisson 缓存配置
cacheGroup:
# 用例: @Cacheable(cacheNames="groupId", key="#XXX") 方可使用缓存组配置
- groupId: redissonCacheMap
@ -171,6 +129,26 @@ lock4j:
# 分布式锁的超时时间,默认为 30 毫秒
expire: 30000
# 暴露监控端点
management:
endpoints:
web:
exposure:
include: '*'
endpoint:
health:
show-details: ALWAYS
logfile:
external-file: ./logs/${spring.application.name}/console.log
# 日志配置
logging:
level:
org.springframework: warn
org.apache.dubbo: warn
com.alibaba.nacos: warn
config: classpath:logback.xml
# mybatis配置
mybatis:
# 搜索指定包别名
@ -182,3 +160,29 @@ mybatis:
swagger:
license: Powered By ruoyi
licenseUrl: https://ruoyi.vip
# seata配置
seata:
# 默认关闭如需启用spring.datasource.dynami.seata需要同时开启
enabled: false
# Seata 应用编号,默认为 ${spring.application.name}
application-id: ${spring.application.name}
# Seata 事务组编号,用于 TC 集群名
tx-service-group: ${spring.application.name}-group
# 服务配置项
service:
# 虚拟组和分组的映射
vgroup-mapping:
${spring.application.name}: default
config:
type: nacos
nacos:
serverAddr: ${spring.cloud.nacos.server-addr}
group: SEATA_GROUP
namespace:
registry:
type: nacos
nacos:
application: seata-server
server-addr: ${spring.cloud.nacos.server-addr}
namespace:

@ -0,0 +1,41 @@
datasource:
system-master:
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能
url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
username: root
password: password
gen:
url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
username: root
password: password
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
dynamic:
# 性能分析插件(有性能损耗 不建议生产环境使用)
p6spy: false
# 开启seata代理开启后默认每个数据源都代理如果某个不需要代理可单独关闭
seata: false
druid:
initial-size: 5
min-idle: 5
maxActive: 20
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
filters: stat,slf4j
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
# seata配置
seata:
# 关闭自动代理
enable-auto-data-source-proxy: false

@ -0,0 +1,5 @@
# dubbo 订阅配置
dubbo:
cloud:
# 需要远程调用的服务 多个用逗号分割
subscribed-services: ruoyi-system

@ -0,0 +1,25 @@
# dubbo 订阅配置
dubbo:
cloud:
# 需要远程调用的服务 多个用逗号分割
subscribed-services: ruoyi-system
# 本地文件上传
file:
domain: http://127.0.0.1:9300
path: D:/ruoyi/uploadPath
prefix: /statics
# FastDFS配置
fdfs:
domain: http://8.129.231.12
soTimeout: 3000
connectTimeout: 2000
trackerList: 8.129.231.12:22122
# Minio配置
minio:
url: http://8.129.231.12:9000
accessKey: minioadmin
secretKey: minioadmin
bucketName: test

@ -0,0 +1,93 @@
# dubbo 订阅配置
dubbo:
cloud:
# 需要远程调用的服务 多个用逗号分割
subscribed-services: ruoyi-auth,ruoyi-system
# 安全配置
security:
# 验证码
captcha:
# 是否开启验证码
enabled: true
# 验证码类型 math 数组计算 char 字符验证
type: MATH
# line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
category: CIRCLE
# 数字验证码位数
numberLength: 1
# 字符验证码长度
charLength: 4
# 防止XSS攻击
xss:
enabled: true
excludeUrls:
- /system/notice
# 不校验白名单
ignore:
whites:
- /auth/logout
- /auth/login
- /auth/register
- /*/v2/api-docs
- /csrf
spring:
cloud:
# 网关配置
gateway:
discovery:
locator:
lowerCaseServiceId: true
enabled: true
routes:
# 认证中心
- id: ruoyi-auth
uri: lb://ruoyi-auth
predicates:
- Path=/auth/**
filters:
# 验证码处理
- CacheRequestFilter
- ValidateCodeFilter
- StripPrefix=1
# 代码生成
- id: ruoyi-gen
uri: lb://ruoyi-gen
predicates:
- Path=/code/**
filters:
- StripPrefix=1
# 定时任务
- id: ruoyi-job
uri: lb://ruoyi-job
predicates:
- Path=/schedule/**
filters:
- StripPrefix=1
# 系统模块
- id: ruoyi-system
uri: lb://ruoyi-system
predicates:
- Path=/system/**
filters:
- StripPrefix=1
# 文件服务
- id: ruoyi-file
uri: lb://ruoyi-file
predicates:
- Path=/file/**
filters:
- StripPrefix=1
# sentinel 配置
sentinel:
# nacos配置持久化
datasource:
ds1:
nacos:
server-addr: ${spring.cloud.nacos.server-addr}
dataId: sentinel-${spring.application.name}
groupId: ${spring.cloud.nacos.config.group}
data-type: json
rule-type: flow

@ -0,0 +1,40 @@
# dubbo 订阅配置
dubbo:
cloud:
# 需要远程调用的服务 多个用逗号分割
subscribed-services: ruoyi-system
# swagger配置
swagger:
title: 代码生成接口文档
spring:
datasource:
dynamic:
# 设置默认的数据源或者数据源组,默认值即为 master
primary: master
datasource:
# 主库数据源
master:
driver-class-name: com.mysql.cj.jdbc.Driver
url: ${datasource.system-master.url}
username: ${datasource.system-master.username}
password: ${datasource.system-master.password}
# 从库数据源
slave:
lazy: true
driver-class-name:
url:
username:
password:
# 代码生成
gen:
# 作者
author: ruoyi
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
packageName: com.ruoyi.system
# 自动去除表前缀默认是false
autoRemovePre: false
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
tablePrefix: sys_

@ -0,0 +1,7 @@
# 监控中心配置
monitor:
user:
name: ruoyi
password: 123456
ui:
title: RuoYi-Cloud-Plus服务监控中心

@ -0,0 +1,29 @@
# dubbo 订阅配置
dubbo:
cloud:
# 需要远程调用的服务 多个用逗号分割
subscribed-services: ruoyi-file
# swagger配置
swagger:
title: 系统模块接口文档
spring:
datasource:
dynamic:
# 设置默认的数据源或者数据源组,默认值即为 master
primary: master
datasource:
# 主库数据源
master:
driver-class-name: com.mysql.cj.jdbc.Driver
url: ${datasource.system-master.url}
username: ${datasource.system-master.username}
password: ${datasource.system-master.password}
# 从库数据源
slave:
lazy: true
driver-class-name:
url:
username:
password:

@ -54,7 +54,6 @@
<nacos.server>127.0.0.1:8848</nacos.server>
<nacos.discovery.group>DEFAULT_GROUP</nacos.discovery.group>
<nacos.config.group>DEFAULT_GROUP</nacos.config.group>
<sentinel.server>127.0.0.1:8718</sentinel.server>
</properties>
<activation>
<!-- 默认环境 -->
@ -68,7 +67,6 @@
<nacos.server>127.0.0.1:8848</nacos.server>
<nacos.discovery.group>DEFAULT_GROUP</nacos.discovery.group>
<nacos.config.group>DEFAULT_GROUP</nacos.config.group>
<sentinel.server>127.0.0.1:8718</sentinel.server>
</properties>
</profile>
</profiles>

@ -11,12 +11,6 @@ spring:
# 环境配置
active: @profiles.active@
--- # dubbo 订阅配置
dubbo:
cloud:
# 需要远程调用的服务 多个用逗号分割
subscribed-services: ruoyi-system
--- # nacos 配置
spring:
cloud:
@ -26,14 +20,14 @@ spring:
discovery:
# 注册组
group: @nacos.discovery.group@
namespace: ${spring.profiles.active}
config:
# 配置组
group: @nacos.config.group@
namespace: ${spring.profiles.active}
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- data-id: application.${spring.cloud.nacos.config.file-extension}
refresh: true
- data-id: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
refresh: true

@ -29,8 +29,8 @@ public class DubboRequestFilter implements Filter {
if (RpcContext.getContext().isConsumerSide()) {
client = CommonConstants.CONSUMER;
}
String baselog = "Client[" + client + "],InterfaceName=[" + invocation.getInvoker().getInterface().getName() + "],MethodName=[" + invocation.getMethodName() + "]";
log.info("DUBBO - 服务调用: {},Parameter=[{}]", baselog, invocation.getArguments());
String baselog = "Client[" + client + "],InterfaceName=[" + invocation.getInvoker().getInterface().getSimpleName() + "],MethodName=[" + invocation.getMethodName() + "]";
log.info("DUBBO - 服务调用: {},Parameter={}", baselog, invocation.getArguments());
long startTime = System.currentTimeMillis();
// 执行接口调用逻辑
@ -39,9 +39,9 @@ public class DubboRequestFilter implements Filter {
long elapsed = System.currentTimeMillis() - startTime;
// 如果发生异常 则打印异常日志
if (result.hasException() && invoker.getInterface().equals(GenericService.class)) {
log.error("DUBBO - 服务异常: {},Exception=[{}]", baselog, result.getException());
log.error("DUBBO - 服务异常: {},Exception={}", baselog, result.getException());
} else {
log.info("DUBBO - 服务响应: {},SpendTime=[{}ms],Response=[{}]", baselog, elapsed, JsonUtils.toJsonString(new Object[]{result.getValue()}));
log.info("DUBBO - 服务响应: {},SpendTime=[{}ms],Response={}", baselog, elapsed, JsonUtils.toJsonString(new Object[]{result.getValue()}));
}
return result;
}

@ -11,12 +11,6 @@ spring:
# 环境配置
active: @profiles.active@
--- # dubbo 订阅配置
dubbo:
cloud:
# 需要远程调用的服务 多个用逗号分割
subscribed-services: ruoyi-auth,ruoyi-system
--- # nacos 配置
spring:
cloud:
@ -26,33 +20,14 @@ spring:
discovery:
# 注册组
group: @nacos.discovery.group@
namespace: ${spring.profiles.active}
config:
# 配置组
group: @nacos.config.group@
namespace: ${spring.profiles.active}
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- data-id: application.${spring.cloud.nacos.config.file-extension}
refresh: true
- data-id: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
refresh: true
--- # sentinel 配置
spring:
cloud:
sentinel:
# 取消控制台懒加载
eager: true
transport:
# 控制台地址
dashboard: @sentinel.server@
# nacos配置持久化
datasource:
ds1:
nacos:
server-addr: ${spring.cloud.nacos.server-addr}
dataId: sentinel-${spring.application.name}
groupId: ${spring.cloud.nacos.config.group}
data-type: json
rule-type: flow

@ -11,12 +11,6 @@ spring:
# 环境配置
active: @profiles.active@
--- # dubbo 订阅配置
dubbo:
cloud:
# 需要远程调用的服务 多个用逗号分割
subscribed-services: ruoyi-system
--- # nacos 配置
spring:
cloud:
@ -26,14 +20,14 @@ spring:
discovery:
# 注册组
group: @nacos.discovery.group@
namespace: ${spring.profiles.active}
config:
# 配置组
group: @nacos.config.group@
namespace: ${spring.profiles.active}
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- data-id: application.${spring.cloud.nacos.config.file-extension}
refresh: true
- data-id: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
refresh: true

@ -11,18 +11,6 @@ spring:
# 环境配置
active: @profiles.active@
# swagger配置
swagger:
title: 代码生成接口文档
license: ${swagger.license}
licenseUrl: ${swagger.licenseUrl}
--- # dubbo 订阅配置
dubbo:
cloud:
# 需要远程调用的服务 多个用逗号分割
subscribed-services: ruoyi-system
--- # nacos 配置
spring:
cloud:
@ -32,43 +20,16 @@ spring:
discovery:
# 注册组
group: @nacos.discovery.group@
namespace: ${spring.profiles.active}
config:
# 配置组
group: @nacos.config.group@
namespace: ${spring.profiles.active}
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- data-id: application.${spring.cloud.nacos.config.file-extension}
refresh: true
- data-id: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
- data-id: datasource.${spring.cloud.nacos.config.file-extension}
refresh: true
--- # 数据源
spring:
datasource:
dynamic:
datasource:
# 主库数据源
master:
driver-class-name: ${spring.datasource.gen.driver-class-name}
url: ${spring.datasource.gen.url}
username: ${spring.datasource.gen.username}
password: ${spring.datasource.gen.password}
# 从库数据源
# slave:
# username:
# password:
# url:
# driver-class-name:
--- # 代码生成
gen:
# 作者
author: ruoyi
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
packageName: com.ruoyi.system
# 自动去除表前缀默认是false
autoRemovePre: false
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
tablePrefix: sys_

@ -11,18 +11,6 @@ spring:
# 环境配置
active: @profiles.active@
# swagger配置
swagger:
title: 系统模块接口文档
license: ${swagger.license}
licenseUrl: ${swagger.licenseUrl}
--- # dubbo 订阅配置
dubbo:
cloud:
# 需要远程调用的服务 多个用逗号分割
subscribed-services: ruoyi-file
--- # nacos 配置
spring:
cloud:
@ -32,32 +20,16 @@ spring:
discovery:
# 注册组
group: @nacos.discovery.group@
namespace: ${spring.profiles.active}
config:
# 配置组
group: @nacos.config.group@
namespace: ${spring.profiles.active}
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- data-id: application.${spring.cloud.nacos.config.file-extension}
refresh: true
- data-id: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
- data-id: datasource.${spring.cloud.nacos.config.file-extension}
refresh: true
--- # 数据源
spring:
datasource:
dynamic:
datasource:
# 主库数据源
master:
driver-class-name: ${spring.datasource.system-master.driver-class-name}
url: ${spring.datasource.system-master.url}
username: ${spring.datasource.system-master.username}
password: ${spring.datasource.system-master.password}
# 从库数据源
# slave:
# username:
# password:
# url:
# driver-class-name:

@ -20,25 +20,14 @@ spring:
discovery:
# 注册组
group: @nacos.discovery.group@
namespace: ${spring.profiles.active}
config:
# 配置组
group: @nacos.config.group@
namespace: ${spring.profiles.active}
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- data-id: application.${spring.cloud.nacos.config.file-extension}
refresh: true
- data-id: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
refresh: true
--- # 监控中心配置
spring:
security:
user:
name: ${monitor.user.name}
password: ${monitor.user.password}
boot:
admin:
ui:
title: ${monitor.ui.title}

@ -32,10 +32,26 @@ CREATE TABLE `config_info` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info';
insert into config_info(id, data_id, group_id, content, md5, gmt_create, gmt_modified, src_user, src_ip, app_name, tenant_id, c_desc, c_use, effect, type, c_schema) values
(1,'application.yml','DEFAULT_GROUP','# 将项目路径config/下对应文件中内容复制到此处\n','760986157e62a0c1e0dadf9d2a6acf40','2019-11-29 16:31:01','2021-11-30 12:03:01','','0:0:0:0:0:0:0:1','','','通用配置基础配置','null','null','yaml','null'),
(2,'application-dev.yml','DEFAULT_GROUP','# 将项目路径config/下对应文件中内容复制到此处\n','80e38bff4ba7482da62a2803e550f6b2','2019-11-29 16:32:02','2021-11-30 12:04:02','','0:0:0:0:0:0:0:1','','','通用配置开发环境','null','null','yaml','null'),
(3,'application-prod.yml','DEFAULT_GROUP','# 将项目路径config/下对应文件中内容复制到此处\n','1774e05ccf3f4c73a1b9a8b17fde1f2d','2019-11-29 16:33:03','2021-11-30 12:05:03','','0:0:0:0:0:0:0:1','','','通用配置正式环境','null','null','yaml','null'),
(4,'sentinel-ruoyi-gateway','DEFAULT_GROUP','# 将项目路径config/下对应文件中内容复制到此处\n','9f3a3069261598f74220bc47958ec252','2020-11-20 00:00:00','2020-11-20 00:00:00',NULL,'0:0:0:0:0:0:0:1','','','限流策略','null','null','json','null');
(1, 'application.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:18:55', '2022-01-09 15:18:55', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '通用配置基础配置', NULL, NULL, 'yaml', NULL),
(2, 'datasource.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:19:07', '2022-01-09 15:19:07', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '数据源配置', NULL, NULL, 'yaml', NULL),
(3, 'ruoyi-gateway.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:19:43', '2022-01-09 15:22:42', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '网关模块', NULL, NULL, 'yaml', NULL),
(4, 'ruoyi-auth.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:19:43', '2022-01-09 15:22:29', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '认证中心', NULL, NULL, 'yaml', NULL),
(5, 'ruoyi-monitor.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:20:18', '2022-01-09 15:22:15', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '监控中心', NULL, NULL, 'yaml', NULL),
(6, 'ruoyi-system.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:20:18', '2022-01-09 15:22:03', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '系统模块', NULL, NULL, 'yaml', NULL),
(7, 'ruoyi-gen.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:20:18', '2022-01-09 15:21:51', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '代码生成', NULL, NULL, 'yaml', NULL),
(8, 'ruoyi-job.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:20:18', '2022-01-09 15:21:36', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '定时任务', NULL, NULL, 'yaml', NULL),
(9, 'ruoyi-file.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:20:35', '2022-01-09 15:21:21', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '文件服务', NULL, NULL, 'yaml', NULL),
(10, 'sentinel-ruoyi-gateway.json', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '限流策略', NULL, NULL, 'json', NULL),
(101, 'application.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '通用配置基础配置', NULL, NULL, 'yaml', NULL),
(102, 'datasource.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '数据源配置', NULL, NULL, 'yaml', NULL),
(103, 'ruoyi-gateway.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '网关模块', NULL, NULL, 'yaml', NULL),
(104, 'ruoyi-auth.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '认证中心', NULL, NULL, 'yaml', NULL),
(105, 'ruoyi-monitor.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '监控中心', NULL, NULL, 'yaml', NULL),
(106, 'ruoyi-system.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '系统模块', NULL, NULL, 'yaml', NULL),
(107, 'ruoyi-gen.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '代码生成', NULL, NULL, 'yaml', NULL),
(108, 'ruoyi-job.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '定时任务', NULL, NULL, 'yaml', NULL),
(109, 'ruoyi-file.yml', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '文件服务', NULL, NULL, 'yaml', NULL),
(110, 'sentinel-ruoyi-gateway.json', 'DEFAULT_GROUP', '# 将项目路径config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '限流策略', NULL, NULL, 'json', NULL);
/******************************************/
/* 表名称 = config_info_aggr */
@ -186,6 +202,10 @@ CREATE TABLE `tenant_info` (
KEY `idx_tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='tenant_info';
insert into tenant_info(id, kp, tenant_id, tenant_name, tenant_desc, create_source, gmt_create, gmt_modified) values
(1, '1', 'dev', 'dev', '开发环境', NULL, 1641741261189, 1641741261189),
(2, '1', 'prod', 'prod', '生产环境', NULL, 1641741270448, 1641741287236);
CREATE TABLE `users` (
`username` varchar(50) NOT NULL PRIMARY KEY,
`password` varchar(500) NOT NULL,

@ -63,18 +63,3 @@ CREATE TABLE IF NOT EXISTS `lock_table`
KEY `idx_branch_id` (`branch_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4;
-- for AT mode you must to init this sql for you business database. the seata server not need it.
CREATE TABLE IF NOT EXISTS `undo_log`
(
`branch_id` BIGINT(20) NOT NULL COMMENT 'branch transaction id',
`xid` VARCHAR(100) NOT NULL COMMENT 'global transaction id',
`context` VARCHAR(128) NOT NULL COMMENT 'undo_log context,such as serialization',
`rollback_info` LONGBLOB NOT NULL COMMENT 'rollback info',
`log_status` INT(11) NOT NULL COMMENT '0:normal status,1:defense status',
`log_created` DATETIME(6) NOT NULL COMMENT 'create datetime',
`log_modified` DATETIME(6) NOT NULL COMMENT 'modify datetime',
UNIQUE KEY `ux_undo_log` (`xid`, `branch_id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 1
DEFAULT CHARSET = utf8mb4 COMMENT ='AT transaction mode undo table';

@ -632,3 +632,18 @@ create table gen_table_column (
update_time datetime comment '更新时间',
primary key (column_id)
) engine=innodb auto_increment=1 comment = '代码生成业务表字段';
-- for AT mode you must to init this sql for you business database. the seata server not need it.
CREATE TABLE IF NOT EXISTS `undo_log`
(
`branch_id` BIGINT(20) NOT NULL COMMENT 'branch transaction id',
`xid` VARCHAR(100) NOT NULL COMMENT 'global transaction id',
`context` VARCHAR(128) NOT NULL COMMENT 'undo_log context,such as serialization',
`rollback_info` LONGBLOB NOT NULL COMMENT 'rollback info',
`log_status` INT(11) NOT NULL COMMENT '0:normal status,1:defense status',
`log_created` DATETIME(6) NOT NULL COMMENT 'create datetime',
`log_modified` DATETIME(6) NOT NULL COMMENT 'modify datetime',
UNIQUE KEY `ux_undo_log` (`xid`, `branch_id`)
) ENGINE = InnoDB
AUTO_INCREMENT = 1
DEFAULT CHARSET = utf8mb4 COMMENT ='AT transaction mode undo table';
Loading…
Cancel
Save