server: port: 8080 servlet: context-path: /api/v1 compression: enabled: true mime-types: application/json,text/html,text/xml,text/plain,application/javascript,text/css min-response-size: 1024 spring: application: name: kece-backend servlet: multipart: max-file-size: 100MB max-request-size: 100MB datasource: url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:kece}?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true&cachePrepStmts=true&prepStmtCacheSize=250&prepStmtCacheSqlLimit=2048&useServerPrepStmts=true&rewriteBatchedStatements=true username: ${DB_USER:kece} password: ${DB_PASSWORD:kece123} driver-class-name: com.mysql.cj.jdbc.Driver hikari: maximum-pool-size: 20 minimum-idle: 5 idle-timeout: 300000 max-lifetime: 1800000 connection-timeout: 20000 data: redis: host: ${REDIS_HOST:localhost} port: ${REDIS_PORT:6379} password: ${REDIS_PASSWORD:} database: 0 timeout: 5000ms flyway: enabled: true locations: classpath:db/migration baseline-on-migrate: true validate-on-migrate: true mybatis: mapper-locations: classpath:mapper/**/*.xml type-aliases-package: com.kece.**.entity configuration: map-underscore-to-camel-case: true # 默认不将 SQL 输出到 stdout(生产环境防泄露/防性能损耗);调试时可在 dev profile 单独开启 log-impl kece: jwt: secret: ${JWT_SECRET:kece-default-jwt-secret-key-please-change-in-production-min-32-chars} expiration: ${JWT_EXPIRATION:86400000} refresh-expiration: ${JWT_REFRESH_EXPIRATION:604800000} # 演示数据开关:默认关(生产环境不播种默认账号与示例数据,防默认口令风险); # 仅 dev profile 开启,本地开发启动即有演示题目/作答可验收。 demo-data: enabled: false --- spring: config: activate: on-profile: dev kece: demo-data: enabled: true springdoc: api-docs: path: /api-docs swagger-ui: path: /swagger-ui.html logging: level: com.kece: DEBUG org.springframework.web: INFO