Appearance
服务注册与发现-Nacos
Nacos
Nacos 致力于帮助您发现、配置和管理微服务。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据及流量管理。 Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。 Nacos 是构建以“服务”为中心的现代应用架构 (例如微服务范式、云原生范式) 的服务基础设施。
通用配置(common.yml)
common.yml是全局性的,所有的微服务模块都需要的共性的配置。集中在一起,方便统一设置。 下表列出了集中模式的配置示例。
yaml
acuity:
webmvc:
undertow: true
header: true
system: # 详情看: SystemProperties
# 登录时否验证密码有效性 (常用于开发环境快速登录)
verifyPassword: true
# 登录时否验证验证码有效性 (常用于开发环境快速登录)
verifyCaptcha: true
# 默认用户密码
defPwd: '123456'
# 密码最大输错次数 小于0不限制
maxPasswordErrorNum: 10
# 密码错误锁定用户时间 除了0表示锁定到今天结束,还支持m、h、d、w、M、y等单位
passwordErrorLockUserTime: '0'
# log记录 top.acuity.box.controller/service/biz包下 参数
recordAcuity: false
# log记录 top.acuity.box.controller/service/biz包下 所有方法的参数
recordAcuityArgs: true
# log记录 top.acuity.box.controller/service/biz包下 所有方法的返回值
recordAcuityResult: true
# swagger 文档通用配置, 主要配置了全局参数、版本号信息、联系人信息 详情看: SwaggerProperties
swagger:
license: Powered By acuity
licenseUrl: https://gitlab.acuity.top/acuity
termsOfServiceUrl: https://gitlab.acuity.top/acuity
contact: # 联系人信息
url: https://acuity.top
name: acuier
email: acuier@163.com
global-operation-parameters: # 全局参数
- name: Token
description: 用户信息
modelRef: String
parameterType: header
required: true
# 默认值只是方便本地开发时,少填参数,生产环境请禁用swagger或者禁用默认参数
defaultValue: "test"
- name: Authorization
description: 客户端信息
modelRef: String
parameterType: header
required: true
defaultValue: "YWN1aXR5X3dlYl9wcm86YWN1aXR5X3dlYl9wcm9fc2VjcmV0"
- name: TenantId
description: 租户ID
modelRef: String
parameterType: header
required: true
defaultValue: "1"
- name: ApplicationId
description: 应用ID
modelRef: String
parameterType: header
required: true
defaultValue: "1"
echo: #详情看: EchoProperties
# 是否启用 远程数据 手动注入
enabled: true
# 是否启用 远程数据 注解AOP注入
aop-enabled: true
# 字典类型 和 code 的分隔符
dictSeparator: '###'
# 多个字典code 之间的的分隔符
dictItemSeparator: ','
# 递归最大深度
maxDepth: 3
# 本地缓存配置信息 生产慎用
guavaCache:
enabled: false
maximumSize: 1000
refreshWriteTime: 2
refreshThreadPoolSize: 10
log: # 详情看:OptLogProperties
# 开启记录操作日志
enabled: true
# 记录到什么地方 DB:mysql LOGGER:日志文件
type: DB
xss:
# 是否开启 xss 过滤器 详情看:XssProperties
enabled: true
# 是否启用 RequestBody 注解标记的参数 反序列化时过滤XSS
requestBodyEnabled: false
ignoreParamValues:
- noxss
captcha:
# 登录界面的验证码配置 详情看:CaptchaProperties
type: ARITHMETIC
width: 158
height: 58
len: 2
charType: 2
async: # 全局线程池配置
corePoolSize: 2
maxPoolSize: 50
queueCapacity: 10000
keepAliveSeconds: 300
threadNamePrefix: 'acuity-async-executor-'
# knife4j 文档通用配置 详情看: Knife4jProperties
knife4j:
enable: true
setting:
enableReloadCacheParameter: true
enableVersion: true
enableDynamicParameter: true
enableFooter: false
enableFooterCustom: true
footerCustomContent: Apache License 2.0 | Copyright 2020 [acuity-cloud](https://gitlab.acuity.top/acuity)
server:
# 优雅停机
shutdown: GRACEFUL
servlet:
encoding:
enabled: true
charset: UTF-8
force: true
undertow:
threads:
io: 4 # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
worker: 80 # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
buffer-size: 2048 # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理 , 每块buffer的空间大小,越小的空间被利用越充分
direct-buffers: true # 是否分配的直接内存
spring:
mvc:
pathmatch:
# 升级springboot2.6.6后临时处理,防止swagger报错
matching-strategy: ANT_PATH_MATCHER
lifecycle:
# 优雅停机宽限期时间
timeout-per-shutdown-phase: 30s
servlet:
# 上传文件最大值
multipart:
max-file-size: 64MB
max-request-size: 32MB
management:
endpoints:
web:
base-path: /actuator
exposure:
include: '*'
endpoint:
health:
show-details: ALWAYS
enabled: true
feign:
httpclient:
enabled: false
okhttp:
enabled: true
hystrix:
enabled: false
sentinel:
enabled: true
client:
config:
default:
# feign client 调用全局超时时间
connectTimeout: 60000
readTimeout: 60000
#支持压缩的mime types
compression: # 请求压缩
request:
enabled: true
mime-types: text/xml,application/xml,application/json
min-request-size: 2048
response: # 响应压缩
enabled: true
acuity:
webmvc:
undertow: true
header: true
system: # 详情看: SystemProperties
# 登录时否验证密码有效性 (常用于开发环境快速登录)
verifyPassword: true
# 登录时否验证验证码有效性 (常用于开发环境快速登录)
verifyCaptcha: true
# 默认用户密码
defPwd: '123456'
# 密码最大输错次数 小于0不限制
maxPasswordErrorNum: 10
# 密码错误锁定用户时间 除了0表示锁定到今天结束,还支持m、h、d、w、M、y等单位
passwordErrorLockUserTime: '0'
# log记录 top.acuity.box.controller/service/biz包下 参数
recordAcuity: false
# log记录 top.acuity.box.controller/service/biz包下 所有方法的参数
recordAcuityArgs: true
# log记录 top.acuity.box.controller/service/biz包下 所有方法的返回值
recordAcuityResult: true
# swagger 文档通用配置, 主要配置了全局参数、版本号信息、联系人信息 详情看: SwaggerProperties
swagger:
license: Powered By acuity
licenseUrl: https://gitlab.acuity.top/acuity
termsOfServiceUrl: https://gitlab.acuity.top/acuity
contact: # 联系人信息
url: https://acuity.top
name: acuier
email: acuier@163.com
global-operation-parameters: # 全局参数
- name: Token
description: 用户信息
modelRef: String
parameterType: header
required: true
# 默认值只是方便本地开发时,少填参数,生产环境请禁用swagger或者禁用默认参数
defaultValue: "test"
- name: Authorization
description: 客户端信息
modelRef: String
parameterType: header
required: true
defaultValue: "YWN1aXR5X3dlYl9wcm86YWN1aXR5X3dlYl9wcm9fc2VjcmV0"
- name: TenantId
description: 租户ID
modelRef: String
parameterType: header
required: true
defaultValue: "1"
- name: ApplicationId
description: 应用ID
modelRef: String
parameterType: header
required: true
defaultValue: "1"
echo: #详情看: EchoProperties
# 是否启用 远程数据 手动注入
enabled: true
# 是否启用 远程数据 注解AOP注入
aop-enabled: true
# 字典类型 和 code 的分隔符
dictSeparator: '###'
# 多个字典code 之间的的分隔符
dictItemSeparator: ','
# 递归最大深度
maxDepth: 3
# 本地缓存配置信息 生产慎用
guavaCache:
enabled: false
maximumSize: 1000
refreshWriteTime: 2
refreshThreadPoolSize: 10
log: # 详情看:OptLogProperties
# 开启记录操作日志
enabled: true
# 记录到什么地方 DB:mysql LOGGER:日志文件
type: DB
xss:
# 是否开启 xss 过滤器 详情看:XssProperties
enabled: true
# 是否启用 RequestBody 注解标记的参数 反序列化时过滤XSS
requestBodyEnabled: false
ignoreParamValues:
- noxss
captcha:
# 登录界面的验证码配置 详情看:CaptchaProperties
type: ARITHMETIC
width: 158
height: 58
len: 2
charType: 2
async: # 全局线程池配置
corePoolSize: 2
maxPoolSize: 50
queueCapacity: 10000
keepAliveSeconds: 300
threadNamePrefix: 'acuity-async-executor-'
# knife4j 文档通用配置 详情看: Knife4jProperties
knife4j:
enable: true
setting:
enableReloadCacheParameter: true
enableVersion: true
enableDynamicParameter: true
enableFooter: false
enableFooterCustom: true
footerCustomContent: Apache License 2.0 | Copyright 2020 [acuity-cloud](https://gitlab.acuity.top/acuity)
server:
# 优雅停机
shutdown: GRACEFUL
servlet:
encoding:
enabled: true
charset: UTF-8
force: true
undertow:
threads:
io: 4 # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
worker: 80 # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
buffer-size: 2048 # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理 , 每块buffer的空间大小,越小的空间被利用越充分
direct-buffers: true # 是否分配的直接内存
spring:
mvc:
pathmatch:
# 升级springboot2.6.6后临时处理,防止swagger报错
matching-strategy: ANT_PATH_MATCHER
lifecycle:
# 优雅停机宽限期时间
timeout-per-shutdown-phase: 30s
servlet:
# 上传文件最大值
multipart:
max-file-size: 64MB
max-request-size: 32MB
management:
endpoints:
web:
base-path: /actuator
exposure:
include: '*'
endpoint:
health:
show-details: ALWAYS
enabled: true
feign:
httpclient:
enabled: false
okhttp:
enabled: true
hystrix:
enabled: false
sentinel:
enabled: true
client:
config:
default:
# feign client 调用全局超时时间
connectTimeout: 60000
readTimeout: 60000
#支持压缩的mime types
compression: # 请求压缩
request:
enabled: true
mime-types: text/xml,application/xml,application/json
min-request-size: 2048
response: # 响应压缩
enabled: true
yaml
acuity:
system: # 详情看: SystemProperties
# 登录时否验证密码有效性 (常用于开发环境快速登录)
verifyPassword: true
# 登录时否验证验证码有效性 (常用于开发环境快速登录)
verifyCaptcha: true
# 默认用户密码
defPwd: '123456'
# 密码最大输错次数 小于0不限制
maxPasswordErrorNum: 10
# 密码错误锁定用户时间 除了0表示锁定到今天结束,还支持m、h、d、w、M、y等单位
passwordErrorLockUserTime: '0'
# swagger 文档通用配置, 主要配置了全局参数、版本号信息、联系人信息 详情看: SwaggerProperties
swagger:
license: Powered By acuity
licenseUrl: https://gitlab.acuity.top/acuity
termsOfServiceUrl: https://gitlab.acuity.top/acuity
version: 4.5.2
contact: # 联系人信息
url: https://gitlab.acuity.top/acuity
name: acuity
email: acuier@163.com
global-operation-parameters: # 全局参数
- name: Token
description: 用户信息
modelRef: String
parameterType: header
required: true
# 默认值只是方便本地开发时,少填参数,生产环境请禁用swagger或者禁用默认参数
defaultValue: "test"
- name: Authorization
description: 客户端信息
modelRef: String
parameterType: header
required: true
defaultValue: "YWN1aXR5X3dlYl9wcm86YWN1aXR5X3dlYl9wcm9fc2VjcmV0"
- name: TenantId
description: 租户ID
modelRef: String
parameterType: header
required: true
defaultValue: "1"
- name: ApplicationId
description: 应用ID
modelRef: String
parameterType: header
required: true
defaultValue: "1"
echo: #详情看: EchoProperties
# 是否启用 远程数据 手动注入
enabled: true
# 是否启用 远程数据 注解AOP注入
aop-enabled: true
log: # 详情看:OptLogProperties
# 开启记录操作日志
enabled: true
# 记录到什么地方 DB:mysql LOGGER:日志文件
type: DB
xss:
# 是否开启 xss 过滤器 详情看:XssProperties
enabled: true
requestBodyEnabled: false
captcha:
# 登录界面的验证码配置 详情看:CaptchaProperties
type: ARITHMETIC
width: 158
height: 58
len: 2
charType: 2
async: # 全局线程池配置
corePoolSize: 2
maxPoolSize: 50
queueCapacity: 10000
keepAliveSeconds: 300
threadNamePrefix: 'acuity-async-executor-'
# knife4j 文档通用配置 详情看: Knife4jProperties
knife4j:
enable: true
setting:
enableReloadCacheParameter: true
enableVersion: true
enableDynamicParameter: true
enableFooter: false
enableFooterCustom: true
footerCustomContent: Apache License 2.0 | Copyright 2020 [acuity-box-cloud](https://gitlab.acuity.top/acuity)
server:
# 优雅停机
shutdown: GRACEFUL
servlet:
encoding:
enabled: true
charset: UTF-8
force: true
undertow:
threads:
io: 4 # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
worker: 80 # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
buffer-size: 2048 # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理 , 每块buffer的空间大小,越小的空间被利用越充分
direct-buffers: true # 是否分配的直接内存
spring:
mvc:
pathmatch:
# 升级springboot2.6.6后临时处理,防止swagger报错
matching-strategy: ANT_PATH_MATCHER
lifecycle:
# 优雅停机宽限期时间
timeout-per-shutdown-phase: 30s
servlet:
# 上传文件最大值
multipart:
max-file-size: 512MB
max-request-size: 512MB
# 通用dozer配置文件
dozer:
mappingFiles:
- classpath*:dozer/*.dozer.xml
management:
endpoints:
web:
base-path: /actuator
exposure:
include: '*'
endpoint:
health:
show-details: ALWAYS
enabled: true
feign:
httpclient:
enabled: false
okhttp:
enabled: true
hystrix:
enabled: false
sentinel:
enabled: true
client:
config:
default:
# feign client 调用全局超时时间
connectTimeout: 60000
readTimeout: 60000
#支持压缩的mime types
compression: # 请求压缩
request:
enabled: true
mime-types: text/xml,application/xml,application/json
min-request-size: 2048
response: # 响应压缩
enabled: true
acuity:
system: # 详情看: SystemProperties
# 登录时否验证密码有效性 (常用于开发环境快速登录)
verifyPassword: true
# 登录时否验证验证码有效性 (常用于开发环境快速登录)
verifyCaptcha: true
# 默认用户密码
defPwd: '123456'
# 密码最大输错次数 小于0不限制
maxPasswordErrorNum: 10
# 密码错误锁定用户时间 除了0表示锁定到今天结束,还支持m、h、d、w、M、y等单位
passwordErrorLockUserTime: '0'
# swagger 文档通用配置, 主要配置了全局参数、版本号信息、联系人信息 详情看: SwaggerProperties
swagger:
license: Powered By acuity
licenseUrl: https://gitlab.acuity.top/acuity
termsOfServiceUrl: https://gitlab.acuity.top/acuity
version: 4.5.2
contact: # 联系人信息
url: https://gitlab.acuity.top/acuity
name: acuity
email: acuier@163.com
global-operation-parameters: # 全局参数
- name: Token
description: 用户信息
modelRef: String
parameterType: header
required: true
# 默认值只是方便本地开发时,少填参数,生产环境请禁用swagger或者禁用默认参数
defaultValue: "test"
- name: Authorization
description: 客户端信息
modelRef: String
parameterType: header
required: true
defaultValue: "YWN1aXR5X3dlYl9wcm86YWN1aXR5X3dlYl9wcm9fc2VjcmV0"
- name: TenantId
description: 租户ID
modelRef: String
parameterType: header
required: true
defaultValue: "1"
- name: ApplicationId
description: 应用ID
modelRef: String
parameterType: header
required: true
defaultValue: "1"
echo: #详情看: EchoProperties
# 是否启用 远程数据 手动注入
enabled: true
# 是否启用 远程数据 注解AOP注入
aop-enabled: true
log: # 详情看:OptLogProperties
# 开启记录操作日志
enabled: true
# 记录到什么地方 DB:mysql LOGGER:日志文件
type: DB
xss:
# 是否开启 xss 过滤器 详情看:XssProperties
enabled: true
requestBodyEnabled: false
captcha:
# 登录界面的验证码配置 详情看:CaptchaProperties
type: ARITHMETIC
width: 158
height: 58
len: 2
charType: 2
async: # 全局线程池配置
corePoolSize: 2
maxPoolSize: 50
queueCapacity: 10000
keepAliveSeconds: 300
threadNamePrefix: 'acuity-async-executor-'
# knife4j 文档通用配置 详情看: Knife4jProperties
knife4j:
enable: true
setting:
enableReloadCacheParameter: true
enableVersion: true
enableDynamicParameter: true
enableFooter: false
enableFooterCustom: true
footerCustomContent: Apache License 2.0 | Copyright 2020 [acuity-box-cloud](https://gitlab.acuity.top/acuity)
server:
# 优雅停机
shutdown: GRACEFUL
servlet:
encoding:
enabled: true
charset: UTF-8
force: true
undertow:
threads:
io: 4 # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
worker: 80 # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
buffer-size: 2048 # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理 , 每块buffer的空间大小,越小的空间被利用越充分
direct-buffers: true # 是否分配的直接内存
spring:
mvc:
pathmatch:
# 升级springboot2.6.6后临时处理,防止swagger报错
matching-strategy: ANT_PATH_MATCHER
lifecycle:
# 优雅停机宽限期时间
timeout-per-shutdown-phase: 30s
servlet:
# 上传文件最大值
multipart:
max-file-size: 512MB
max-request-size: 512MB
# 通用dozer配置文件
dozer:
mappingFiles:
- classpath*:dozer/*.dozer.xml
management:
endpoints:
web:
base-path: /actuator
exposure:
include: '*'
endpoint:
health:
show-details: ALWAYS
enabled: true
feign:
httpclient:
enabled: false
okhttp:
enabled: true
hystrix:
enabled: false
sentinel:
enabled: true
client:
config:
default:
# feign client 调用全局超时时间
connectTimeout: 60000
readTimeout: 60000
#支持压缩的mime types
compression: # 请求压缩
request:
enabled: true
mime-types: text/xml,application/xml,application/json
min-request-size: 2048
response: # 响应压缩
enabled: true
yaml
acuity:
system:
# 登录时否验证密码有效性 (常用于开发环境快速登录)
verifyPassword: true
# 登录时否验证验证码有效性 (常用于开发环境快速登录)
verifyCaptcha: true
# 默认用户密码
defPwd: '123456'
# 密码最大输错次数 小于0不限制
maxPasswordErrorNum: 10
# 密码错误锁定用户时间 除了0表示锁定到今天结束,还支持m、h、d、w、M、y等单位
passwordErrorLockUserTime: '0'
# swagger 文档通用配置, 主要配置了全局参数、版本号信息、联系人信息 详情看: SwaggerProperties
swagger:
license: Powered By acuity
licenseUrl: https://gitlab.acuity.top/acuity
termsOfServiceUrl: https://gitlab.acuity.top/acuity
contact: # 联系人信息
url: https://gitlab.acuity.top/acuity
name: acuity
email: acuier@163.com
global-operation-parameters: # 全局参数
- name: Token
description: 用户信息
modelRef: String
parameterType: header
required: true
# 默认值只是方便本地开发时,少填参数,生产环境请禁用swagger或者禁用默认参数
defaultValue: "test"
- name: Authorization
description: 客户端信息
modelRef: String
parameterType: header
required: true
defaultValue: "YWN1aXR5X3dlYl9wcm86YWN1aXR5X3dlYl9wcm9fc2VjcmV0"
- name: ApplicationId
description: 应用ID
modelRef: String
parameterType: header
required: true
defaultValue: "1"
echo: #详情看: EchoProperties
# 是否启用 远程数据 手动注入
enabled: true
# 是否启用 远程数据 注解AOP注入
aop-enabled: true
log: # 详情看:OptLogProperties
# 开启记录操作日志
enabled: true
# 记录到什么地方 DB:mysql LOGGER:日志文件
type: DB
xss:
# 是否开启 xss 过滤器 详情看:XssProperties
enabled: true
requestBodyEnabled: false
captcha:
# 登录界面的验证码配置 详情看:CaptchaProperties
type: ARITHMETIC
width: 158
height: 58
len: 2
charType: 2
async: # 全局线程池配置
corePoolSize: 2
maxPoolSize: 50
queueCapacity: 10000
keepAliveSeconds: 300
threadNamePrefix: 'acuity-async-executor-'
# knife4j 文档通用配置 详情看: Knife4jProperties
knife4j:
enable: true
setting:
enableReloadCacheParameter: true
enableVersion: true
enableDynamicParameter: true
enableFooter: false
enableFooterCustom: true
footerCustomContent: Apache License 2.0 | Copyright 2020 [acuity-box-cloud](https://gitlab.acuity.top/acuity)
server:
# 优雅停机
shutdown: GRACEFUL
servlet:
encoding:
enabled: true
charset: UTF-8
force: true
undertow:
threads:
io: 4 # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
worker: 80 # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
buffer-size: 2048 # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理 , 每块buffer的空间大小,越小的空间被利用越充分
direct-buffers: true # 是否分配的直接内存
spring:
mvc:
pathmatch:
# 升级springboot2.6.6后临时处理,防止swagger报错
matching-strategy: ANT_PATH_MATCHER
lifecycle:
# 优雅停机宽限期时间
timeout-per-shutdown-phase: 30s
servlet:
# 上传文件最大值
multipart:
max-file-size: 512MB
max-request-size: 512MB
# 通用dozer配置文件
dozer:
mappingFiles:
- classpath*:dozer/*.dozer.xml
management:
endpoints:
web:
base-path: /actuator
exposure:
include: '*'
endpoint:
health:
show-details: ALWAYS
enabled: true
feign:
httpclient:
enabled: false
okhttp:
enabled: true
hystrix:
enabled: false
sentinel:
enabled: true
client:
config:
default:
# feign client 调用全局超时时间
connectTimeout: 60000
readTimeout: 60000
#支持压缩的mime types
compression: # 请求压缩
request:
enabled: true
mime-types: text/xml,application/xml,application/json
min-request-size: 2048
response: # 响应压缩
enabled: true
acuity:
system:
# 登录时否验证密码有效性 (常用于开发环境快速登录)
verifyPassword: true
# 登录时否验证验证码有效性 (常用于开发环境快速登录)
verifyCaptcha: true
# 默认用户密码
defPwd: '123456'
# 密码最大输错次数 小于0不限制
maxPasswordErrorNum: 10
# 密码错误锁定用户时间 除了0表示锁定到今天结束,还支持m、h、d、w、M、y等单位
passwordErrorLockUserTime: '0'
# swagger 文档通用配置, 主要配置了全局参数、版本号信息、联系人信息 详情看: SwaggerProperties
swagger:
license: Powered By acuity
licenseUrl: https://gitlab.acuity.top/acuity
termsOfServiceUrl: https://gitlab.acuity.top/acuity
contact: # 联系人信息
url: https://gitlab.acuity.top/acuity
name: acuity
email: acuier@163.com
global-operation-parameters: # 全局参数
- name: Token
description: 用户信息
modelRef: String
parameterType: header
required: true
# 默认值只是方便本地开发时,少填参数,生产环境请禁用swagger或者禁用默认参数
defaultValue: "test"
- name: Authorization
description: 客户端信息
modelRef: String
parameterType: header
required: true
defaultValue: "YWN1aXR5X3dlYl9wcm86YWN1aXR5X3dlYl9wcm9fc2VjcmV0"
- name: ApplicationId
description: 应用ID
modelRef: String
parameterType: header
required: true
defaultValue: "1"
echo: #详情看: EchoProperties
# 是否启用 远程数据 手动注入
enabled: true
# 是否启用 远程数据 注解AOP注入
aop-enabled: true
log: # 详情看:OptLogProperties
# 开启记录操作日志
enabled: true
# 记录到什么地方 DB:mysql LOGGER:日志文件
type: DB
xss:
# 是否开启 xss 过滤器 详情看:XssProperties
enabled: true
requestBodyEnabled: false
captcha:
# 登录界面的验证码配置 详情看:CaptchaProperties
type: ARITHMETIC
width: 158
height: 58
len: 2
charType: 2
async: # 全局线程池配置
corePoolSize: 2
maxPoolSize: 50
queueCapacity: 10000
keepAliveSeconds: 300
threadNamePrefix: 'acuity-async-executor-'
# knife4j 文档通用配置 详情看: Knife4jProperties
knife4j:
enable: true
setting:
enableReloadCacheParameter: true
enableVersion: true
enableDynamicParameter: true
enableFooter: false
enableFooterCustom: true
footerCustomContent: Apache License 2.0 | Copyright 2020 [acuity-box-cloud](https://gitlab.acuity.top/acuity)
server:
# 优雅停机
shutdown: GRACEFUL
servlet:
encoding:
enabled: true
charset: UTF-8
force: true
undertow:
threads:
io: 4 # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
worker: 80 # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
buffer-size: 2048 # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理 , 每块buffer的空间大小,越小的空间被利用越充分
direct-buffers: true # 是否分配的直接内存
spring:
mvc:
pathmatch:
# 升级springboot2.6.6后临时处理,防止swagger报错
matching-strategy: ANT_PATH_MATCHER
lifecycle:
# 优雅停机宽限期时间
timeout-per-shutdown-phase: 30s
servlet:
# 上传文件最大值
multipart:
max-file-size: 512MB
max-request-size: 512MB
# 通用dozer配置文件
dozer:
mappingFiles:
- classpath*:dozer/*.dozer.xml
management:
endpoints:
web:
base-path: /actuator
exposure:
include: '*'
endpoint:
health:
show-details: ALWAYS
enabled: true
feign:
httpclient:
enabled: false
okhttp:
enabled: true
hystrix:
enabled: false
sentinel:
enabled: true
client:
config:
default:
# feign client 调用全局超时时间
connectTimeout: 60000
readTimeout: 60000
#支持压缩的mime types
compression: # 请求压缩
request:
enabled: true
mime-types: text/xml,application/xml,application/json
min-request-size: 2048
response: # 响应压缩
enabled: true
网关配置(gateway.yml)
gateway.yml是网关的配置,配置网关路由、放行以及黑白名单和请求头校验等信息。 下表列出了各模式的配置示例。
yaml
acuity:
authentication:
# jwt 签名,长度至少32位。 建议每个公司都修改一下这个字符串
jwtSignKey: 'acuity-cloud_i_love_you_a_fantastic_project'
log:
enabled: false
webmvc:
undertow: false
header: false
database:
initDatabasePrefix:
- acuity_pro_base
ignore:
# 是否启用网关的 uri权限鉴权 (设置为false,则后台不校验访问权限)
authEnabled: true
# 前端校验按钮 是否区分大小写
caseSensitive: false
anyone: # 请求中 需要携带Tenant 且 需要携带Token(不需要登录),但不需要验证uri权限
ALL:
- /**/anyone/**
anyUser: # 请求中 需要携带Tenant,但 不需要携带Token(不需要登录) 和 不需要验证uri权限
ALL:
- /**/anyUser/**
anyTenant: # 请求中 不需要携带Tenant 且 不需要携带Token(不需要登录) 和 不需要验证uri权限
ALL:
- /**/anyTenant/**
spring:
autoconfigure:
exclude: io.seata.integration.http.HttpAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
cloud:
gateway:
x-forwarded:
prefixEnabled: false
discovery:
locator:
enabled: true
lowerCaseServiceId: true
routes:
- id: oauth
uri: lb://acuity-oauth-server
predicates:
- Path=/oauth/**
filters:
- StripPrefix=1
- id: system
uri: lb://acuity-system-server
predicates:
- Path=/system/**
filters:
- StripPrefix=1
- id: base
uri: lb://acuity-base-server
predicates:
- Path=/base/**
filters:
- StripPrefix=1
# websocket
- id: wsMsg
uri: lb:ws://acuity-base-server
predicates:
- Path=/wsMsg/**
filters:
- StripPrefix=1
- id: generator
uri: lb://acuity-generator-server
predicates:
- Path=/generator/**
filters:
- StripPrefix=1
server:
port: 18760
servlet:
context-path: /api
acuity:
authentication:
# jwt 签名,长度至少32位。 建议每个公司都修改一下这个字符串
jwtSignKey: 'acuity-cloud_i_love_you_a_fantastic_project'
log:
enabled: false
webmvc:
undertow: false
header: false
database:
initDatabasePrefix:
- acuity_pro_base
ignore:
# 是否启用网关的 uri权限鉴权 (设置为false,则后台不校验访问权限)
authEnabled: true
# 前端校验按钮 是否区分大小写
caseSensitive: false
anyone: # 请求中 需要携带Tenant 且 需要携带Token(不需要登录),但不需要验证uri权限
ALL:
- /**/anyone/**
anyUser: # 请求中 需要携带Tenant,但 不需要携带Token(不需要登录) 和 不需要验证uri权限
ALL:
- /**/anyUser/**
anyTenant: # 请求中 不需要携带Tenant 且 不需要携带Token(不需要登录) 和 不需要验证uri权限
ALL:
- /**/anyTenant/**
spring:
autoconfigure:
exclude: io.seata.integration.http.HttpAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
cloud:
gateway:
x-forwarded:
prefixEnabled: false
discovery:
locator:
enabled: true
lowerCaseServiceId: true
routes:
- id: oauth
uri: lb://acuity-oauth-server
predicates:
- Path=/oauth/**
filters:
- StripPrefix=1
- id: system
uri: lb://acuity-system-server
predicates:
- Path=/system/**
filters:
- StripPrefix=1
- id: base
uri: lb://acuity-base-server
predicates:
- Path=/base/**
filters:
- StripPrefix=1
# websocket
- id: wsMsg
uri: lb:ws://acuity-base-server
predicates:
- Path=/wsMsg/**
filters:
- StripPrefix=1
- id: generator
uri: lb://acuity-generator-server
predicates:
- Path=/generator/**
filters:
- StripPrefix=1
server:
port: 18760
servlet:
context-path: /api
yaml
acuity:
authentication:
# jwt 签名,长度至少32位。 建议每个公司都修改一下这个字符串
jwtSignKey: 'acuity-cloud_i_love_you_a_fantastic_project'
log:
enabled: false
webmvc:
enabled: false
database:
isSeata: false
ignore:
# 是否启用网关的 uri权限鉴权 (设置为false,则后台不校验访问权限)
authEnabled: true
# 前端校验按钮 是否区分大小写
caseSensitive: false
anyone: # 请求中 需要携带Tenant 且 需要携带Token(不需要登录),但不需要验证uri权限
ALL:
- /**/anyone/**
- /activiti/service/model/*/json
- /activiti/service/model/*/save
- /activiti/service/editor/stencilset
anyUser: # 请求中 需要携带Tenant,但 不需要携带Token(不需要登录) 和 不需要验证uri权限
ALL:
- /**/anyUser/**
anyTenant: # 请求中 不需要携带Tenant 且 不需要携带Token(不需要登录) 和 不需要验证uri权限
ALL:
- /**/anyTenant/**
spring:
autoconfigure:
exclude: io.seata.integration.http.HttpAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
cloud:
gateway:
x-forwarded:
prefixEnabled: false
discovery:
locator:
enabled: true
lowerCaseServiceId: true
routes:
# 新建服务配置复制到中间
# 新建服务配置复制到中间
- id: oauth
uri: lb://acuity-oauth-server
predicates:
- Path=/oauth/**
filters:
- StripPrefix=1
- id: system
uri: lb://acuity-system-server
predicates:
- Path=/system/**
filters:
- StripPrefix=1
- id: base
uri: lb://acuity-base-server
predicates:
- Path=/base/**
filters:
- StripPrefix=1
# websocket
- id: wsMsg
uri: lb:ws://acuity-base-server
predicates:
- Path=/wsMsg/**
filters:
- StripPrefix=1
- id: generator
uri: lb://acuity-generator-server
predicates:
- Path=/generator/**
filters:
- StripPrefix=1
- id: activiti
uri: lb://acuity-activiti-server
predicates:
- Path=/activiti/**
filters:
- StripPrefix=1
# - id: demo
# uri: lb://acuity-demo-server
# predicates:
# - Path=/demo/**
# filters:
# - StripPrefix=1
# - id: example
# uri: lb://acuity-example-server
# predicates:
# - Path=/example/**
# filters:
# - StripPrefix=1
server:
port: 18760
servlet:
context-path: /api
acuity:
authentication:
# jwt 签名,长度至少32位。 建议每个公司都修改一下这个字符串
jwtSignKey: 'acuity-cloud_i_love_you_a_fantastic_project'
log:
enabled: false
webmvc:
enabled: false
database:
isSeata: false
ignore:
# 是否启用网关的 uri权限鉴权 (设置为false,则后台不校验访问权限)
authEnabled: true
# 前端校验按钮 是否区分大小写
caseSensitive: false
anyone: # 请求中 需要携带Tenant 且 需要携带Token(不需要登录),但不需要验证uri权限
ALL:
- /**/anyone/**
- /activiti/service/model/*/json
- /activiti/service/model/*/save
- /activiti/service/editor/stencilset
anyUser: # 请求中 需要携带Tenant,但 不需要携带Token(不需要登录) 和 不需要验证uri权限
ALL:
- /**/anyUser/**
anyTenant: # 请求中 不需要携带Tenant 且 不需要携带Token(不需要登录) 和 不需要验证uri权限
ALL:
- /**/anyTenant/**
spring:
autoconfigure:
exclude: io.seata.integration.http.HttpAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
cloud:
gateway:
x-forwarded:
prefixEnabled: false
discovery:
locator:
enabled: true
lowerCaseServiceId: true
routes:
# 新建服务配置复制到中间
# 新建服务配置复制到中间
- id: oauth
uri: lb://acuity-oauth-server
predicates:
- Path=/oauth/**
filters:
- StripPrefix=1
- id: system
uri: lb://acuity-system-server
predicates:
- Path=/system/**
filters:
- StripPrefix=1
- id: base
uri: lb://acuity-base-server
predicates:
- Path=/base/**
filters:
- StripPrefix=1
# websocket
- id: wsMsg
uri: lb:ws://acuity-base-server
predicates:
- Path=/wsMsg/**
filters:
- StripPrefix=1
- id: generator
uri: lb://acuity-generator-server
predicates:
- Path=/generator/**
filters:
- StripPrefix=1
- id: activiti
uri: lb://acuity-activiti-server
predicates:
- Path=/activiti/**
filters:
- StripPrefix=1
# - id: demo
# uri: lb://acuity-demo-server
# predicates:
# - Path=/demo/**
# filters:
# - StripPrefix=1
# - id: example
# uri: lb://acuity-example-server
# predicates:
# - Path=/example/**
# filters:
# - StripPrefix=1
server:
port: 18760
servlet:
context-path: /api
yaml
acuity:
authentication:
# jwt 签名,长度至少32位。 建议每个公司都修改一下这个字符串
jwtSignKey: 'acuity-cloud_i_love_you_a_fantastic_project'
log:
enabled: false
webmvc:
enabled: false
ignore:
# 是否启用网关的 uri权限鉴权 (设置为false,则后台不校验访问权限)
authEnabled: true
# 前端校验按钮 是否区分大小写
caseSensitive: false
anyone: # 请求中 需要携带Tenant 且 需要携带Token(不需要登录),但不需要验证uri权限
ALL:
- /**/anyone/**
- /activiti/service/model/*/json
- /activiti/service/model/*/save
- /activiti/service/editor/stencilset
anyUser: # 请求中 需要携带Tenant,但 不需要携带Token(不需要登录) 和 不需要验证uri权限
ALL:
- /**/anyUser/**
anyTenant: # 请求中 不需要携带Tenant 且 不需要携带Token(不需要登录) 和 不需要验证uri权限
ALL:
- /**/anyTenant/**
spring:
autoconfigure:
exclude: io.seata.integration.http.HttpAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
cloud:
gateway:
x-forwarded:
prefixEnabled: false
discovery:
locator:
enabled: true
lowerCaseServiceId: true
routes:
# 新建服务配置复制到中间
# 新建服务配置复制到中间
- id: oauth
uri: lb://acuity-oauth-server
predicates:
- Path=/oauth/**
filters:
- StripPrefix=1
- id: system
uri: lb://acuity-system-server
predicates:
- Path=/system/**
filters:
- StripPrefix=1
- id: base
uri: lb://acuity-base-server
predicates:
- Path=/base/**
filters:
- StripPrefix=1
# websocket
- id: wsMsg
uri: lb:ws://acuity-base-server
predicates:
- Path=/wsMsg/**
filters:
- StripPrefix=1
- id: generator
uri: lb://acuity-generator-server
predicates:
- Path=/generator/**
filters:
- StripPrefix=1
- id: activiti
uri: lb://acuity-activiti-server
predicates:
- Path=/activiti/**
filters:
- StripPrefix=1
server:
port: 18760
servlet:
context-path: /api
acuity:
authentication:
# jwt 签名,长度至少32位。 建议每个公司都修改一下这个字符串
jwtSignKey: 'acuity-cloud_i_love_you_a_fantastic_project'
log:
enabled: false
webmvc:
enabled: false
ignore:
# 是否启用网关的 uri权限鉴权 (设置为false,则后台不校验访问权限)
authEnabled: true
# 前端校验按钮 是否区分大小写
caseSensitive: false
anyone: # 请求中 需要携带Tenant 且 需要携带Token(不需要登录),但不需要验证uri权限
ALL:
- /**/anyone/**
- /activiti/service/model/*/json
- /activiti/service/model/*/save
- /activiti/service/editor/stencilset
anyUser: # 请求中 需要携带Tenant,但 不需要携带Token(不需要登录) 和 不需要验证uri权限
ALL:
- /**/anyUser/**
anyTenant: # 请求中 不需要携带Tenant 且 不需要携带Token(不需要登录) 和 不需要验证uri权限
ALL:
- /**/anyTenant/**
spring:
autoconfigure:
exclude: io.seata.integration.http.HttpAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
cloud:
gateway:
x-forwarded:
prefixEnabled: false
discovery:
locator:
enabled: true
lowerCaseServiceId: true
routes:
# 新建服务配置复制到中间
# 新建服务配置复制到中间
- id: oauth
uri: lb://acuity-oauth-server
predicates:
- Path=/oauth/**
filters:
- StripPrefix=1
- id: system
uri: lb://acuity-system-server
predicates:
- Path=/system/**
filters:
- StripPrefix=1
- id: base
uri: lb://acuity-base-server
predicates:
- Path=/base/**
filters:
- StripPrefix=1
# websocket
- id: wsMsg
uri: lb:ws://acuity-base-server
predicates:
- Path=/wsMsg/**
filters:
- StripPrefix=1
- id: generator
uri: lb://acuity-generator-server
predicates:
- Path=/generator/**
filters:
- StripPrefix=1
- id: activiti
uri: lb://acuity-activiti-server
predicates:
- Path=/activiti/**
filters:
- StripPrefix=1
server:
port: 18760
servlet:
context-path: /api
数据库配置(database.yml)
yaml
acuity:
# validation-query 参数对不同数据库的支持参考:https://www.cnblogs.com/BonnieWss/p/9100402.html
druid-oracle: &druid-oracle
validation-query: SELECT 'x' FROM DUAL
druid-mysql: &druid-mysql
validation-query: SELECT 'x'
druid-sqlserver: &druid-sqlserver
validation-query: SELECT 'x'
oracle: &db-oracle
username: "acuity_pro_defaults"
password: "acuity_pro_defaults"
driverClassName: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@127.0.0.1:1521:helowin
mysql: &db-mysql
username: "root"
password: "20180101"
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://ubuntu.wsl:13306/acuity_pro_defaults?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&nullCatalogMeansCurrent=true
sqlserver: &db-sqlserver
username: "sa"
password: "20180101"
driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=acuity_pro_defaults
init:
separator: GO
database: # 字段介绍参考 DatabaseProperties
# COLUMN模式中隔离 租户 的列名 oracle数据库initDatabasePrefix不能超过11个字符
initDatabasePrefix:
- acuity_pro_base
tenantIdColumn: "created_org_id"
multiTenantType: DATASOURCE_COLUMN
# 是否不允许写入数据 WriteInterceptor
isNotWrite: false
# 是否启用数据权限
isDataScope: true
# 是否启用 sql性能规范插件
isBlockAttack: false
# 是否启用 sql性能规范插件
isIllegalSql: false
# 是否启用分布式事务
isSeata: false
# 生产环境请设置p6spy = false
p6spy: true
# 单页分页条数限制
maxLimit: -1
# 溢出总页数后是否进行处理
overflow: true
# 生成 countSql 优化掉 join, 现在只支持 left join
optimizeJoin: true
# id生成策略
id-type: CACHE
hutoolId:
workerId: 0
dataCenterId: 0
cache-id:
time-bits: 31
worker-bits: 22
seq-bits: 10
epochStr: "2020-09-15"
boost-power: 3
padding-factor: 50
# mysql 通用配置
spring:
autoconfigure:
exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
datasource:
dynamic:
enabled: true
# 从这里开始(dynamic),中间的这段配置用于 acuity.database.multiTenantType == DATASOURCE 时
p6spy: ${acuity.database.p6spy:false}
seata: ${acuity.database.isSeata:false}
primary: "0"
datasource:
"0":
<<: *db-mysql
# <<: *db-sqlserver
# <<: *db-oracle
druid:
<<: *druid-mysql
# <<: *druid-oracle
# <<: *druid-sqlserver
initialSize: 10
minIdle: 10
maxActive: 200
max-wait: 60000
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
test-on-borrow: false
test-on-return: false
test-while-idle: true
time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis: 300000 #配置一个连接在池中最小生存的时间,单位是毫秒
filters: stat,wall
wall:
enabled: true
strictSyntaxCheck: false
comment-allow: true
multiStatementAllow: true
noneBaseStatementAllow: true
# 从这里结束(dynamic),中间的这段配置用于 acuity.database.multiTenantType == DATASOURCE 时
druid:
enable: true
# 以下的2段配置,同时适用于所有模式
web-stat-filter: # WebStatFilter配置,说明请参考Druid Wiki,配置_配置WebStatFilter
enabled: true
url-pattern: /*
exclusions: "*.js , *.gif ,*.jpg ,*.png ,*.css ,*.ico , /druid/*"
session-stat-max-count: 1000
profile-enable: true
session-stat-enable: false
stat-view-servlet: #展示Druid的统计信息,StatViewServlet的用途包括:1.提供监控信息展示的html页面2.提供监控信息的JSON API
enabled: true
url-pattern: /druid/* #根据配置中的url-pattern来访问内置监控页面,如果是上面的配置,内置监控页面的首页是/druid/index.html例如:http://ubuntu.wsl:9000/druid/index.html
reset-enable: true #允许清空统计数据
login-username: ""
login-password: ""
# 允许访问IP
allow: ""
mybatis-plus:
mapper-locations:
- classpath*:mapper_**/**/*Mapper.xml
# - classpath*:mapper_**/**/**/*Mapper.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: top.acuity.box.*.entity;top.acuity.commons.database.mybatis.typehandler
typeEnumsPackage: top.acuity.box.*.enumeration
global-config:
db-config:
id-type: INPUT
insert-strategy: NOT_NULL
update-strategy: NOT_NULL
where-strategy: NOT_EMPTY
configuration:
#配置返回数据库(column下划线命名&&返回java实体是驼峰命名),自动匹配无需as(没开启这个,SQL需要写as: select user_id as userId)
map-underscore-to-camel-case: true
cache-enabled: false
#配置JdbcTypeForNull, oracle数据库必须配置
jdbc-type-for-null: "null"
default-enum-type-handler: top.acuity.commons.database.mybatis.handlers.MybatisEnumTypeHandler
# 分布式事务相关
seata:
enabled: ${acuity.database.isSeata}
enableAutoDataSourceProxy: ${acuity.database.isSeata}
tx-service-group: acuity_cloud_seata_tx_group
registry:
type: nacos
nacos:
server-addr: ${acuity.nacos.ip}:${acuity.nacos.port}
username: ${acuity.nacos.username}
password: ${acuity.nacos.password}
namespace: ${acuity.seata.namespace}
config:
type: nacos
nacos:
server-addr: ${acuity.nacos.ip}:${acuity.nacos.port}
username: ${acuity.nacos.username}
password: ${acuity.nacos.password}
namespace: ${acuity.seata.namespace}
dataId: seataServer.properties
service:
grouplist:
default: ${acuity.seata.ip:}:${acuity.seata.port:}
vgroup-mapping:
acuity_cloud_seata_tx_group: default
disable-global-transaction: false
client:
rm:
report-success-enable: false
acuity:
# validation-query 参数对不同数据库的支持参考:https://www.cnblogs.com/BonnieWss/p/9100402.html
druid-oracle: &druid-oracle
validation-query: SELECT 'x' FROM DUAL
druid-mysql: &druid-mysql
validation-query: SELECT 'x'
druid-sqlserver: &druid-sqlserver
validation-query: SELECT 'x'
oracle: &db-oracle
username: "acuity_pro_defaults"
password: "acuity_pro_defaults"
driverClassName: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@127.0.0.1:1521:helowin
mysql: &db-mysql
username: "root"
password: "20180101"
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://ubuntu.wsl:13306/acuity_pro_defaults?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&nullCatalogMeansCurrent=true
sqlserver: &db-sqlserver
username: "sa"
password: "20180101"
driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=acuity_pro_defaults
init:
separator: GO
database: # 字段介绍参考 DatabaseProperties
# COLUMN模式中隔离 租户 的列名 oracle数据库initDatabasePrefix不能超过11个字符
initDatabasePrefix:
- acuity_pro_base
tenantIdColumn: "created_org_id"
multiTenantType: DATASOURCE_COLUMN
# 是否不允许写入数据 WriteInterceptor
isNotWrite: false
# 是否启用数据权限
isDataScope: true
# 是否启用 sql性能规范插件
isBlockAttack: false
# 是否启用 sql性能规范插件
isIllegalSql: false
# 是否启用分布式事务
isSeata: false
# 生产环境请设置p6spy = false
p6spy: true
# 单页分页条数限制
maxLimit: -1
# 溢出总页数后是否进行处理
overflow: true
# 生成 countSql 优化掉 join, 现在只支持 left join
optimizeJoin: true
# id生成策略
id-type: CACHE
hutoolId:
workerId: 0
dataCenterId: 0
cache-id:
time-bits: 31
worker-bits: 22
seq-bits: 10
epochStr: "2020-09-15"
boost-power: 3
padding-factor: 50
# mysql 通用配置
spring:
autoconfigure:
exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
datasource:
dynamic:
enabled: true
# 从这里开始(dynamic),中间的这段配置用于 acuity.database.multiTenantType == DATASOURCE 时
p6spy: ${acuity.database.p6spy:false}
seata: ${acuity.database.isSeata:false}
primary: "0"
datasource:
"0":
<<: *db-mysql
# <<: *db-sqlserver
# <<: *db-oracle
druid:
<<: *druid-mysql
# <<: *druid-oracle
# <<: *druid-sqlserver
initialSize: 10
minIdle: 10
maxActive: 200
max-wait: 60000
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
test-on-borrow: false
test-on-return: false
test-while-idle: true
time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis: 300000 #配置一个连接在池中最小生存的时间,单位是毫秒
filters: stat,wall
wall:
enabled: true
strictSyntaxCheck: false
comment-allow: true
multiStatementAllow: true
noneBaseStatementAllow: true
# 从这里结束(dynamic),中间的这段配置用于 acuity.database.multiTenantType == DATASOURCE 时
druid:
enable: true
# 以下的2段配置,同时适用于所有模式
web-stat-filter: # WebStatFilter配置,说明请参考Druid Wiki,配置_配置WebStatFilter
enabled: true
url-pattern: /*
exclusions: "*.js , *.gif ,*.jpg ,*.png ,*.css ,*.ico , /druid/*"
session-stat-max-count: 1000
profile-enable: true
session-stat-enable: false
stat-view-servlet: #展示Druid的统计信息,StatViewServlet的用途包括:1.提供监控信息展示的html页面2.提供监控信息的JSON API
enabled: true
url-pattern: /druid/* #根据配置中的url-pattern来访问内置监控页面,如果是上面的配置,内置监控页面的首页是/druid/index.html例如:http://ubuntu.wsl:9000/druid/index.html
reset-enable: true #允许清空统计数据
login-username: ""
login-password: ""
# 允许访问IP
allow: ""
mybatis-plus:
mapper-locations:
- classpath*:mapper_**/**/*Mapper.xml
# - classpath*:mapper_**/**/**/*Mapper.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: top.acuity.box.*.entity;top.acuity.commons.database.mybatis.typehandler
typeEnumsPackage: top.acuity.box.*.enumeration
global-config:
db-config:
id-type: INPUT
insert-strategy: NOT_NULL
update-strategy: NOT_NULL
where-strategy: NOT_EMPTY
configuration:
#配置返回数据库(column下划线命名&&返回java实体是驼峰命名),自动匹配无需as(没开启这个,SQL需要写as: select user_id as userId)
map-underscore-to-camel-case: true
cache-enabled: false
#配置JdbcTypeForNull, oracle数据库必须配置
jdbc-type-for-null: "null"
default-enum-type-handler: top.acuity.commons.database.mybatis.handlers.MybatisEnumTypeHandler
# 分布式事务相关
seata:
enabled: ${acuity.database.isSeata}
enableAutoDataSourceProxy: ${acuity.database.isSeata}
tx-service-group: acuity_cloud_seata_tx_group
registry:
type: nacos
nacos:
server-addr: ${acuity.nacos.ip}:${acuity.nacos.port}
username: ${acuity.nacos.username}
password: ${acuity.nacos.password}
namespace: ${acuity.seata.namespace}
config:
type: nacos
nacos:
server-addr: ${acuity.nacos.ip}:${acuity.nacos.port}
username: ${acuity.nacos.username}
password: ${acuity.nacos.password}
namespace: ${acuity.seata.namespace}
dataId: seataServer.properties
service:
grouplist:
default: ${acuity.seata.ip:}:${acuity.seata.port:}
vgroup-mapping:
acuity_cloud_seata_tx_group: default
disable-global-transaction: false
client:
rm:
report-success-enable: false
yaml
acuity:
oracle: &db-oracle
db-type: oracle
validation-query: SELECT 'x' FROM DUAL
filters: stat,wall,slf4j # druid不支持使用p6spy打印日志,所以采用druid 的 slf4j 过滤器来打印可执行日志
username: 'acuity_pro_column'
password: 'acuity_pro_column'
driverClassName: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@172.26.3.67:1521:helowin
mysql: &db-mysql
db-type: mysql
validation-query: SELECT 'x'
filters: stat,wall
username: 'root'
password: '20180101'
# 生产使用原生驱动,开发使用p6spy驱动打印日志
# driverClassName: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://ubuntu.wsl:13306/acuity_pro_column?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&nullCatalogMeansCurrent=true
driverClassName: com.p6spy.engine.spy.P6SpyDriver
url: jdbc:p6spy:mysql://ubuntu.wsl:13306/acuity_pro_column?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&nullCatalogMeansCurrent=true
sqlserver: &db-sqlserver
username: 'sa'
password: '1234@abcd'
driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://172.26.3.67:1433;DatabaseName=acuity_pro_column
#driverClassName: com.p6spy.engine.spy.P6SpyDriver
# url: jdbc:p6spy:sqlserver://172.26.3.67:1433;DatabaseName=acuity_pro_column
db-type: sqlserver
validation-query: SELECT 'x'
filters: stat,wall
init:
separator: GO
database: # 字段介绍参考 DatabaseProperties
# COLUMN模式中隔离 租户 的列名
tenantIdColumn: 'tenant_id'
multiTenantType: COLUMN
# 是否不允许写入数据 WriteInterceptor
isNotWrite: false
# 是否启用数据权限
isDataScope: true
# 是否启用 sql性能规范插件
isBlockAttack: false
# 是否启用 sql性能规范插件
isIllegalSql: false
# 是否启用分布式事务
isSeata: true
# 生产环境请设置p6spy = false
p6spy: true
# 单页分页条数限制
maxLimit: -1
# 溢出总页数后是否进行处理
overflow: true
# 生成 countSql 优化掉 join, 现在只支持 left join
optimizeJoin: true
# id生成策略
id-type: CACHE
hutoolId:
workerId: 0
dataCenterId: 0
cache-id:
time-bits: 31
worker-bits: 22
seq-bits: 10
epochStr: '2020-09-15'
boost-power: 3
padding-factor: 50
# mysql 通用配置
spring:
autoconfigure:
exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
datasource:
dynamic:
enabled: false
druid:
enable: true
# 从这里开始(druid),中间的这段配置用于 acuity.database.multiTenantType != DATASOURCE 时
<<: *db-mysql
# <<: *db-sqlserver
# <<: *db-oracle
initialSize: 10
minIdle: 10
maxActive: 200
max-wait: 60000
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
test-on-borrow: false
test-on-return: false
test-while-idle: true
time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis: 300000 #配置一个连接在池中最小生存的时间,单位是毫秒
#filters: stat,wall
filter:
wall:
enabled: true
config:
strictSyntaxCheck: false
commentAllow: true
multiStatementAllow: true
noneBaseStatementAllow: true
slf4j:
enabled: false # 使用slf4j打印可执行日志时,改成true
statement-executable-sql-log-enable: true
# 从这里结束(druid),中间的这段配置用于 acuity.database.multiTenantType != DATASOURCE 时
# 以下的2段配置,同时适用于所有模式
web-stat-filter: # WebStatFilter配置,说明请参考Druid Wiki,配置_配置WebStatFilter
enabled: true
url-pattern: /*
exclusions: "*.js , *.gif ,*.jpg ,*.png ,*.css ,*.ico , /druid/*"
session-stat-max-count: 1000
profile-enable: true
session-stat-enable: false
stat-view-servlet: #展示Druid的统计信息,StatViewServlet的用途包括:1.提供监控信息展示的html页面2.提供监控信息的JSON API
enabled: true
url-pattern: /druid/* #根据配置中的url-pattern来访问内置监控页面,如果是上面的配置,内置监控页面的首页是/druid/index.html例如:http://127.0.0.1:9000/druid/index.html
reset-enable: true #允许清空统计数据
login-username: ''
login-password: ''
allow: ''
mybatis-plus:
mapper-locations:
- classpath*:mapper_**/**/*Mapper.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: top.acuity.box.*.entity;top.acuity.commons.database.mybatis.typehandler
typeEnumsPackage: top.acuity.box.*.enumeration
global-config:
db-config:
id-type: INPUT
insert-strategy: NOT_NULL
update-strategy: NOT_NULL
where-strategy: NOT_EMPTY
configuration:
#配置返回数据库(column下划线命名&&返回java实体是驼峰命名),自动匹配无需as(没开启这个,SQL需要写as: select user_id as userId)
map-underscore-to-camel-case: true
cache-enabled: false
#配置JdbcTypeForNull, oracle数据库必须配置
jdbc-type-for-null: 'null'
default-enum-type-handler: top.acuity.commons.database.mybatis.handlers.MybatisEnumTypeHandler
# 分布式事务相关
seata:
enabled: ${acuity.database.isSeata}
enableAutoDataSourceProxy: ${acuity.database.isSeata}
tx-service-group: acuity_cloud_seata_tx_group
registry:
type: nacos
nacos:
server-addr: ${acuity.nacos.ip}:${acuity.nacos.port}
username: ${acuity.nacos.username}
password: ${acuity.nacos.password}
namespace: ${acuity.seata.namespace}
config:
type: nacos
nacos:
server-addr: ${acuity.nacos.ip}:${acuity.nacos.port}
username: ${acuity.nacos.username}
password: ${acuity.nacos.password}
namespace: ${acuity.seata.namespace}
dataId: seataServer.properties
service:
grouplist:
default: ${acuity.seata.ip:}:${acuity.seata.port:}
vgroup-mapping:
acuity_cloud_seata_tx_group: default
disable-global-transaction: false
client:
rm:
report-success-enable: false
acuity:
oracle: &db-oracle
db-type: oracle
validation-query: SELECT 'x' FROM DUAL
filters: stat,wall,slf4j # druid不支持使用p6spy打印日志,所以采用druid 的 slf4j 过滤器来打印可执行日志
username: 'acuity_pro_column'
password: 'acuity_pro_column'
driverClassName: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@172.26.3.67:1521:helowin
mysql: &db-mysql
db-type: mysql
validation-query: SELECT 'x'
filters: stat,wall
username: 'root'
password: '20180101'
# 生产使用原生驱动,开发使用p6spy驱动打印日志
# driverClassName: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://ubuntu.wsl:13306/acuity_pro_column?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&nullCatalogMeansCurrent=true
driverClassName: com.p6spy.engine.spy.P6SpyDriver
url: jdbc:p6spy:mysql://ubuntu.wsl:13306/acuity_pro_column?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&nullCatalogMeansCurrent=true
sqlserver: &db-sqlserver
username: 'sa'
password: '1234@abcd'
driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://172.26.3.67:1433;DatabaseName=acuity_pro_column
#driverClassName: com.p6spy.engine.spy.P6SpyDriver
# url: jdbc:p6spy:sqlserver://172.26.3.67:1433;DatabaseName=acuity_pro_column
db-type: sqlserver
validation-query: SELECT 'x'
filters: stat,wall
init:
separator: GO
database: # 字段介绍参考 DatabaseProperties
# COLUMN模式中隔离 租户 的列名
tenantIdColumn: 'tenant_id'
multiTenantType: COLUMN
# 是否不允许写入数据 WriteInterceptor
isNotWrite: false
# 是否启用数据权限
isDataScope: true
# 是否启用 sql性能规范插件
isBlockAttack: false
# 是否启用 sql性能规范插件
isIllegalSql: false
# 是否启用分布式事务
isSeata: true
# 生产环境请设置p6spy = false
p6spy: true
# 单页分页条数限制
maxLimit: -1
# 溢出总页数后是否进行处理
overflow: true
# 生成 countSql 优化掉 join, 现在只支持 left join
optimizeJoin: true
# id生成策略
id-type: CACHE
hutoolId:
workerId: 0
dataCenterId: 0
cache-id:
time-bits: 31
worker-bits: 22
seq-bits: 10
epochStr: '2020-09-15'
boost-power: 3
padding-factor: 50
# mysql 通用配置
spring:
autoconfigure:
exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
datasource:
dynamic:
enabled: false
druid:
enable: true
# 从这里开始(druid),中间的这段配置用于 acuity.database.multiTenantType != DATASOURCE 时
<<: *db-mysql
# <<: *db-sqlserver
# <<: *db-oracle
initialSize: 10
minIdle: 10
maxActive: 200
max-wait: 60000
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
test-on-borrow: false
test-on-return: false
test-while-idle: true
time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis: 300000 #配置一个连接在池中最小生存的时间,单位是毫秒
#filters: stat,wall
filter:
wall:
enabled: true
config:
strictSyntaxCheck: false
commentAllow: true
multiStatementAllow: true
noneBaseStatementAllow: true
slf4j:
enabled: false # 使用slf4j打印可执行日志时,改成true
statement-executable-sql-log-enable: true
# 从这里结束(druid),中间的这段配置用于 acuity.database.multiTenantType != DATASOURCE 时
# 以下的2段配置,同时适用于所有模式
web-stat-filter: # WebStatFilter配置,说明请参考Druid Wiki,配置_配置WebStatFilter
enabled: true
url-pattern: /*
exclusions: "*.js , *.gif ,*.jpg ,*.png ,*.css ,*.ico , /druid/*"
session-stat-max-count: 1000
profile-enable: true
session-stat-enable: false
stat-view-servlet: #展示Druid的统计信息,StatViewServlet的用途包括:1.提供监控信息展示的html页面2.提供监控信息的JSON API
enabled: true
url-pattern: /druid/* #根据配置中的url-pattern来访问内置监控页面,如果是上面的配置,内置监控页面的首页是/druid/index.html例如:http://127.0.0.1:9000/druid/index.html
reset-enable: true #允许清空统计数据
login-username: ''
login-password: ''
allow: ''
mybatis-plus:
mapper-locations:
- classpath*:mapper_**/**/*Mapper.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: top.acuity.box.*.entity;top.acuity.commons.database.mybatis.typehandler
typeEnumsPackage: top.acuity.box.*.enumeration
global-config:
db-config:
id-type: INPUT
insert-strategy: NOT_NULL
update-strategy: NOT_NULL
where-strategy: NOT_EMPTY
configuration:
#配置返回数据库(column下划线命名&&返回java实体是驼峰命名),自动匹配无需as(没开启这个,SQL需要写as: select user_id as userId)
map-underscore-to-camel-case: true
cache-enabled: false
#配置JdbcTypeForNull, oracle数据库必须配置
jdbc-type-for-null: 'null'
default-enum-type-handler: top.acuity.commons.database.mybatis.handlers.MybatisEnumTypeHandler
# 分布式事务相关
seata:
enabled: ${acuity.database.isSeata}
enableAutoDataSourceProxy: ${acuity.database.isSeata}
tx-service-group: acuity_cloud_seata_tx_group
registry:
type: nacos
nacos:
server-addr: ${acuity.nacos.ip}:${acuity.nacos.port}
username: ${acuity.nacos.username}
password: ${acuity.nacos.password}
namespace: ${acuity.seata.namespace}
config:
type: nacos
nacos:
server-addr: ${acuity.nacos.ip}:${acuity.nacos.port}
username: ${acuity.nacos.username}
password: ${acuity.nacos.password}
namespace: ${acuity.seata.namespace}
dataId: seataServer.properties
service:
grouplist:
default: ${acuity.seata.ip:}:${acuity.seata.port:}
vgroup-mapping:
acuity_cloud_seata_tx_group: default
disable-global-transaction: false
client:
rm:
report-success-enable: false
yaml
acuity:
# validation-query 参数对不同数据库的支持参考:https://www.cnblogs.com/BonnieWss/p/9100402.html
oracle: &db-oracle
db-type: oracle
validation-query: SELECT 'x' FROM DUAL
filters: stat,wall,slf4j # druid不支持使用p6spy打印日志,所以采用druid 的 slf4j 过滤器来打印可执行日志
username: 'acuity_pro_none'
password: 'acuity_pro_none'
driverClassName: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@172.26.3.67:1521:helowin
mysql: &db-mysql
filters: stat,wall
db-type: mysql
validation-query: SELECT 'x'
username: 'root'
password: '20180101'
# 生产使用原生驱动,开发使用p6spy驱动打印日志
# driverClassName: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://127.0.0.1:3306/acuity_pro_none?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&nullCatalogMeansCurrent=true
driverClassName: com.p6spy.engine.spy.P6SpyDriver
url: jdbc:p6spy:mysql://ubuntu.wsl:13306/acuity_pro_none?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&nullCatalogMeansCurrent=true
sqlserver: &db-sqlserver
username: 'sa'
password: '1234@abcd'
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://172.26.3.67:1433;DatabaseName=acuity_none
driverClassName: com.p6spy.engine.spy.P6SpyDriver
url: jdbc:p6spy:sqlserver://172.26.3.67:1433;DatabaseName=acuity_pro_none
db-type: sqlserver
validation-query: SELECT 'x'
filters: stat,wall
init:
separator: GO
database: # 字段介绍参考 DatabaseProperties
multiTenantType: NONE
# 是否不允许写入数据 WriteInterceptor
isNotWrite: false
# 是否启用数据权限
isDataScope: true
# 是否启用 sql性能规范插件
isBlockAttack: false
# 是否启用 sql性能规范插件
isIllegalSql: false
# 是否启用分布式事务
isSeata: false
# 生产环境请设置p6spy = false
p6spy: true
# 单页分页条数限制
maxLimit: -1
# 溢出总页数后是否进行处理
overflow: true
# 生成 countSql 优化掉 join, 现在只支持 left join
optimizeJoin: true
# id生成策略
id-type: CACHE
hutoolId:
workerId: 0
dataCenterId: 0
cache-id:
time-bits: 31
worker-bits: 22
seq-bits: 10
epochStr: '2020-09-15'
boost-power: 3
padding-factor: 50
# mysql 通用配置
spring:
autoconfigure:
exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
datasource:
dynamic:
enabled: false
druid:
enable: true
# 从这里开始(druid),中间的这段配置用于 acuity.database.multiTenantType != DATASOURCE 时
<<: *db-mysql
# <<: *db-sqlserver
# <<: *db-oracle
initialSize: 10
minIdle: 10
maxActive: 200
max-wait: 60000
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
test-on-borrow: false
test-on-return: false
test-while-idle: true
time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis: 300000 #配置一个连接在池中最小生存的时间,单位是毫秒
filter:
wall:
enabled: true
config:
strictSyntaxCheck: false
commentAllow: true
multiStatementAllow: true
noneBaseStatementAllow: true
slf4j:
enabled: false # 使用slf4j打印可执行日志时,改成true
statement-executable-sql-log-enable: true
# 从这里结束(druid),中间的这段配置用于 acuity.database.multiTenantType != DATASOURCE 时
# 以下的2段配置,同时适用于所有模式
web-stat-filter: # WebStatFilter配置,说明请参考Druid Wiki,配置_配置WebStatFilter
enabled: true
url-pattern: /*
exclusions: "*.js , *.gif ,*.jpg ,*.png ,*.css ,*.ico , /druid/*"
session-stat-max-count: 1000
profile-enable: true
session-stat-enable: false
stat-view-servlet: #展示Druid的统计信息,StatViewServlet的用途包括:1.提供监控信息展示的html页面2.提供监控信息的JSON API
enabled: true
url-pattern: /druid/* #根据配置中的url-pattern来访问内置监控页面,如果是上面的配置,内置监控页面的首页是/druid/index.html例如:http://127.0.0.1:9000/druid/index.html
reset-enable: true #允许清空统计数据
login-username: ''
login-password: ''
allow: ''
mybatis-plus:
mapper-locations:
- classpath*:mapper_**/**/*Mapper.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: top.acuity.box.*.entity;top.acuity.commons.database.mybatis.typehandler
typeEnumsPackage: top.acuity.box.*.enumeration
global-config:
db-config:
id-type: INPUT
insert-strategy: NOT_NULL
update-strategy: NOT_NULL
where-strategy: NOT_EMPTY
configuration:
#配置返回数据库(column下划线命名&&返回java实体是驼峰命名),自动匹配无需as(没开启这个,SQL需要写as: select user_id as userId)
map-underscore-to-camel-case: true
cache-enabled: false
#配置JdbcTypeForNull, oracle数据库必须配置
jdbc-type-for-null: 'null'
default-enum-type-handler: top.acuity.commons.database.mybatis.handlers.MybatisEnumTypeHandler
acuity:
# validation-query 参数对不同数据库的支持参考:https://www.cnblogs.com/BonnieWss/p/9100402.html
oracle: &db-oracle
db-type: oracle
validation-query: SELECT 'x' FROM DUAL
filters: stat,wall,slf4j # druid不支持使用p6spy打印日志,所以采用druid 的 slf4j 过滤器来打印可执行日志
username: 'acuity_pro_none'
password: 'acuity_pro_none'
driverClassName: oracle.jdbc.driver.OracleDriver
url: jdbc:oracle:thin:@172.26.3.67:1521:helowin
mysql: &db-mysql
filters: stat,wall
db-type: mysql
validation-query: SELECT 'x'
username: 'root'
password: '20180101'
# 生产使用原生驱动,开发使用p6spy驱动打印日志
# driverClassName: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://127.0.0.1:3306/acuity_pro_none?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&nullCatalogMeansCurrent=true
driverClassName: com.p6spy.engine.spy.P6SpyDriver
url: jdbc:p6spy:mysql://ubuntu.wsl:13306/acuity_pro_none?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&nullCatalogMeansCurrent=true
sqlserver: &db-sqlserver
username: 'sa'
password: '1234@abcd'
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://172.26.3.67:1433;DatabaseName=acuity_none
driverClassName: com.p6spy.engine.spy.P6SpyDriver
url: jdbc:p6spy:sqlserver://172.26.3.67:1433;DatabaseName=acuity_pro_none
db-type: sqlserver
validation-query: SELECT 'x'
filters: stat,wall
init:
separator: GO
database: # 字段介绍参考 DatabaseProperties
multiTenantType: NONE
# 是否不允许写入数据 WriteInterceptor
isNotWrite: false
# 是否启用数据权限
isDataScope: true
# 是否启用 sql性能规范插件
isBlockAttack: false
# 是否启用 sql性能规范插件
isIllegalSql: false
# 是否启用分布式事务
isSeata: false
# 生产环境请设置p6spy = false
p6spy: true
# 单页分页条数限制
maxLimit: -1
# 溢出总页数后是否进行处理
overflow: true
# 生成 countSql 优化掉 join, 现在只支持 left join
optimizeJoin: true
# id生成策略
id-type: CACHE
hutoolId:
workerId: 0
dataCenterId: 0
cache-id:
time-bits: 31
worker-bits: 22
seq-bits: 10
epochStr: '2020-09-15'
boost-power: 3
padding-factor: 50
# mysql 通用配置
spring:
autoconfigure:
exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
datasource:
dynamic:
enabled: false
druid:
enable: true
# 从这里开始(druid),中间的这段配置用于 acuity.database.multiTenantType != DATASOURCE 时
<<: *db-mysql
# <<: *db-sqlserver
# <<: *db-oracle
initialSize: 10
minIdle: 10
maxActive: 200
max-wait: 60000
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
test-on-borrow: false
test-on-return: false
test-while-idle: true
time-between-eviction-runs-millis: 60000 #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
min-evictable-idle-time-millis: 300000 #配置一个连接在池中最小生存的时间,单位是毫秒
filter:
wall:
enabled: true
config:
strictSyntaxCheck: false
commentAllow: true
multiStatementAllow: true
noneBaseStatementAllow: true
slf4j:
enabled: false # 使用slf4j打印可执行日志时,改成true
statement-executable-sql-log-enable: true
# 从这里结束(druid),中间的这段配置用于 acuity.database.multiTenantType != DATASOURCE 时
# 以下的2段配置,同时适用于所有模式
web-stat-filter: # WebStatFilter配置,说明请参考Druid Wiki,配置_配置WebStatFilter
enabled: true
url-pattern: /*
exclusions: "*.js , *.gif ,*.jpg ,*.png ,*.css ,*.ico , /druid/*"
session-stat-max-count: 1000
profile-enable: true
session-stat-enable: false
stat-view-servlet: #展示Druid的统计信息,StatViewServlet的用途包括:1.提供监控信息展示的html页面2.提供监控信息的JSON API
enabled: true
url-pattern: /druid/* #根据配置中的url-pattern来访问内置监控页面,如果是上面的配置,内置监控页面的首页是/druid/index.html例如:http://127.0.0.1:9000/druid/index.html
reset-enable: true #允许清空统计数据
login-username: ''
login-password: ''
allow: ''
mybatis-plus:
mapper-locations:
- classpath*:mapper_**/**/*Mapper.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: top.acuity.box.*.entity;top.acuity.commons.database.mybatis.typehandler
typeEnumsPackage: top.acuity.box.*.enumeration
global-config:
db-config:
id-type: INPUT
insert-strategy: NOT_NULL
update-strategy: NOT_NULL
where-strategy: NOT_EMPTY
configuration:
#配置返回数据库(column下划线命名&&返回java实体是驼峰命名),自动匹配无需as(没开启这个,SQL需要写as: select user_id as userId)
map-underscore-to-camel-case: true
cache-enabled: false
#配置JdbcTypeForNull, oracle数据库必须配置
jdbc-type-for-null: 'null'
default-enum-type-handler: top.acuity.commons.database.mybatis.handlers.MybatisEnumTypeHandler