78 lines
2.4 KiB
YAML
78 lines
2.4 KiB
YAML
# =================== 开发环境配置 ===================
|
|
spring:
|
|
config:
|
|
activate:
|
|
on-profile: dev
|
|
|
|
datasource:
|
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
# url: jdbc:mysql://${DB_HOST:8.148.151.56}:${DB_PORT:3306}/reading_platform?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true
|
|
url: jdbc:mysql://${DB_HOST:192.168.1.250}:${DB_PORT:3306}/reading_platform?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true
|
|
username: ${DB_USERNAME:reading_platform}
|
|
password: ${DB_PASSWORD:reading_platform_pwd}
|
|
type: com.alibaba.druid.pool.DruidDataSource
|
|
data:
|
|
redis:
|
|
# host: ${REDIS_HOST:8.148.151.56}
|
|
host: ${REDIS_HOST:192.168.1.250}
|
|
port: ${REDIS_PORT:6379}
|
|
password: ${REDIS_PASSWORD:QWErty123}
|
|
database: 4
|
|
timeout: 30000ms # 增加到 30 秒,避免网络延迟导致超时
|
|
lettuce:
|
|
pool:
|
|
max-active: 16 # 增加连接池大小
|
|
max-wait: 10000ms
|
|
max-idle: 16
|
|
min-idle: 4
|
|
|
|
flyway:
|
|
enabled: true
|
|
locations: classpath:db/migration
|
|
clean-disabled: true
|
|
validate-on-migrate: false
|
|
baseline-on-migrate: false
|
|
|
|
# Druid 连接池配置(开发环境)
|
|
druid:
|
|
initial-size: 5
|
|
min-idle: 5
|
|
max-active: 20
|
|
max-wait: 60000ms
|
|
time-between-eviction-runs-millis: 60000ms
|
|
min-evictable-idle-time-millis: 300000ms
|
|
validation-query: SELECT 1
|
|
test-while-idle: true
|
|
test-on-borrow: false
|
|
test-on-return: false
|
|
pool-prepared-statements: true
|
|
max-pool-prepared-statement-per-connection-size: 20
|
|
stat-view-servlet:
|
|
enabled: true
|
|
url-pattern: /druid/*
|
|
reset-enable: false
|
|
login-username: admin
|
|
login-password: admin
|
|
web-stat-filter:
|
|
enabled: true
|
|
url-pattern: /*
|
|
exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
|
|
|
|
# MyBatis-Plus 配置(开发环境 - 开启 SQL 日志)
|
|
mybatis-plus:
|
|
configuration:
|
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
|
|
|
# JWT 配置(开发环境 - 使用默认密钥)
|
|
jwt:
|
|
secret: ${JWT_SECRET:dev-secret-key-for-development-only-reading-platform-2024}
|
|
expiration: ${JWT_EXPIRATION:86400000}
|
|
|
|
# 日志配置(开发环境 - DEBUG 级别)
|
|
logging:
|
|
level:
|
|
root: INFO
|
|
com.reading.platform: DEBUG
|
|
com.baomidou.mybatisplus: DEBUG
|
|
org.springframework: WARN
|