Files
todo-backend/src/main/resources/application.yml
Agent e09440ba63
All checks were successful
continuous-integration/drone/push Build is passing
feat: 添加启动时自动建表功能
2026-03-24 14:15:51 +00:00

55 lines
1.4 KiB
YAML

server:
port: 8080
spring:
application:
name: building
# PostgreSQL数据库配置 - 环境变量注入
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://${SPRING_DATASOURCE_HOST:localhost}:${SPRING_DATASOURCE_PORT:5432}/${SPRING_DATASOURCE_DB:building_materials}
username: ${SPRING_DATASOURCE_USERNAME:postgres}
password: ${SPRING_DATASOURCE_PASSWORD:postgres}
# Redis配置 - 环境变量注入
redis:
host: ${SPRING_REDIS_HOST:localhost}
port: ${SPRING_REDIS_PORT:6379}
password: ${SPRING_REDIS_PASSWORD:}
database: 0
timeout: 3000ms
lettuce:
pool:
max-active: 8
max-wait: -1ms
max-idle: 8
min-idle: 0
# MyBatis-Plus配置
mybatis-plus:
configuration:
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
id-type: assign_uuid
logic-delete-field: status
logic-delete-value: 0
logic-not-delete-value: 1
# 自动建表
mapper-locations: classpath*:/mapper/**/*.xml
type-aliases-package: com.example.building.entity
# JWT配置 - 环境变量注入
jwt:
secret: ${JWT_SECRET:building-materials-secret-key-2024}
expiration: ${JWT_EXPIRATION:7200000}
refresh-expiration: ${JWT_REFRESH_EXPIRATION:604800000}
# 日志配置
logging:
level:
com.example.building: debug
org.springframework: info