kindergarten_java/reading-platform-java/src/main/resources/application-dev.yml

76 lines
2.1 KiB
YAML
Raw Normal View History

# =================== 开发环境配置 ===================
2026-02-28 16:41:39 +08:00
spring:
config:
activate:
on-profile: dev
2026-02-28 16:41:39 +08:00
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
username: ${DB_USERNAME:root}
password: ${DB_PASSWORD:reading_platform_pwd}
type: com.alibaba.druid.pool.DruidDataSource
data:
redis:
host: ${REDIS_HOST:8.148.151.56}
port: ${REDIS_PORT:6379}
password: ${REDIS_PASSWORD:}
database: 0
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}
2026-02-28 16:41:39 +08:00
# 日志配置(开发环境 - DEBUG 级别)
2026-02-28 16:41:39 +08:00
logging:
level:
root: INFO
com.reading.platform: DEBUG
com.baomidou.mybatisplus: DEBUG
org.springframework: WARN