46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
|
|
# 高级配置 - 可插拔组件
|
||
|
|
spring:
|
||
|
|
config:
|
||
|
|
activate:
|
||
|
|
on-profile: advanced
|
||
|
|
|
||
|
|
# 数据库选择: h2 / mysql / postgresql
|
||
|
|
datasource:
|
||
|
|
driver-class-name: ${DB_DRIVER:org.h2.Driver}
|
||
|
|
url: ${DB_URL:jdbc:h2:file:~/h2/springboot_scaffold}
|
||
|
|
username: ${DB_USER:sa}
|
||
|
|
password: ${DB_PASS:}
|
||
|
|
|
||
|
|
# Redis 缓存
|
||
|
|
redis:
|
||
|
|
host: ${REDIS_HOST:localhost}
|
||
|
|
port: ${REDIS_PORT:6379}
|
||
|
|
password: ${REDIS_PASS:}
|
||
|
|
database: ${REDIS_DB:0}
|
||
|
|
timeout: 3000ms
|
||
|
|
lettuce:
|
||
|
|
pool:
|
||
|
|
max-active: 8
|
||
|
|
max-idle: 8
|
||
|
|
min-idle: 0
|
||
|
|
|
||
|
|
# 鉴权方案选择: none / jwt / satoken
|
||
|
|
auth:
|
||
|
|
type: ${AUTH_TYPE:none} # none | jwt | satoken
|
||
|
|
jwt:
|
||
|
|
secret: ${JWT_SECRET:your-secret-key}
|
||
|
|
expiration: ${JWT_EXPIRATION:86400000} # 24小时
|
||
|
|
satoken:
|
||
|
|
timeout: ${SA_TIMEOUT:86400} # 24小时
|
||
|
|
activity-timeout: ${SA_ACTIVITY_TIMEOUT:1800} # 30分钟
|
||
|
|
|
||
|
|
# 缓存配置
|
||
|
|
cache:
|
||
|
|
type: ${CACHE_TYPE:caffeine} # caffeine | redis
|
||
|
|
redis:
|
||
|
|
time-to-live: 600000 # 10分钟
|
||
|
|
|
||
|
|
# MyBatis 多数据库适配
|
||
|
|
mybatis:
|
||
|
|
configuration:
|
||
|
|
database-id: ${DB_TYPE:h2} # h2 | mysql | postgresql
|