feat: 添加 spring-boot-datasource starter.

This commit is contained in:
ljh01459796
2023-06-23 18:25:49 +08:00
parent 2cf36da82d
commit 3d16e4e68b
13 changed files with 265 additions and 11 deletions

View File

@@ -36,6 +36,10 @@
<groupId>com.orion.ops</groupId>
<artifactId>orion-ops-spring-boot-starter-swagger</artifactId>
</dependency>
<dependency>
<groupId>com.orion.ops</groupId>
<artifactId>orion-ops-spring-boot-starter-datasource</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>

View File

@@ -0,0 +1,10 @@
spring:
datasource:
druid:
url:
username:
password:
initial-size: 0
min-idle: 1
max-active: 5

View File

@@ -0,0 +1,28 @@
spring:
datasource:
druid:
url:
username:
password:
# 初始连接数
initial-size: 5
# 最小连接池数量
min-idle: 5
# 最大连接池数量
max-active: 20
web-stat-filter:
enabled: true
stat-view-servlet:
enabled: true
filter:
stat:
enabled: true
springdoc:
api-docs:
enabled: false
swagger-ui:
enabled: false
knife4j:
enable: false

View File

@@ -9,7 +9,6 @@ spring:
main:
# 允许循环依赖
allow-circular-references: true
# Servlet 配置
servlet:
# 文件上传相关配置项
multipart:
@@ -20,6 +19,40 @@ spring:
mvc:
pathmatch:
matching-strategy: ANT_PATH_MATCHER
datasource:
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
# 初始连接数
initial-size: 5
# 最小连接池数量
min-idle: 5
# 最大连接池数量
max-active: 20
# 配置获取连接等待超时的时间
max-wait: 600000
# 检测间隔
time-between-eviction-runs-millis: 60000
# 最小生存的时间
min-evictable-idle-time-millis: 300000
# 最大生存的时间
max-evictable-idle-time-millis: 900000
validation-query: SELECT 1
web-stat-filter:
enabled: true
stat-view-servlet:
enabled: true
url-pattern: /druid/*
login-username:
login-password:
filter:
stat:
enabled: true
log-slow-sql: true
slow-sql-millis: 800
merge-sql: true
wall:
config:
multi-statement-allow: true
springdoc:
api-docs: