Files
todo-backend/src/main/resources/application.yml

62 lines
1.5 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}
hikari:
initialization-fail-timeout: 60000
# 自动执行建表SQL
sql:
init:
mode: always
schema-locations: classpath:sql/init.sql
# 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