spring:
  application:
    name: infogenie-backend-java

  datasource:
    url: jdbc:mysql://${DB_HOST:10.1.1.100}:${DB_PORT:3306}/${DB_NAME:infogenie-test}?useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
    username: ${DB_USER:infogenie-test}
    password: ${DB_PASSWORD:infogenie-test}
    driver-class-name: com.mysql.cj.jdbc.Driver
    hikari:
      maximum-pool-size: 25
      minimum-idle: 5
      max-lifetime: 300000
      connection-timeout: 30000
      # Allow startup without DB in edge cases; JPA will still fail fast on first use
      initialization-fail-timeout: 30000

  jpa:
    hibernate:
      ddl-auto: update
    show-sql: false
    open-in-view: false
    properties:
      hibernate:
        format_sql: false

  # Redis — connection details only matter when app.redis-enabled=true.
  # Lettuce does NOT connect at startup unless a command is issued, so leaving
  # these as non-existent host values is safe when Redis is disabled.
  data:
    redis:
      host: ${REDIS_HOST:10.1.1.100}
      port: ${REDIS_PORT:6379}
      password: ${REDIS_PASSWORD:tyh@19900420}
      database: ${REDIS_DB:10}
      timeout: 5000ms
      lettuce:
        pool:
          max-active: 8
          max-idle: 8
          min-idle: 0

server:
  port: ${APP_PORT:5002}
  servlet:
    encoding:
      charset: UTF-8
      enabled: true
      force: true

app:
  auth-center-url: ${AUTH_CENTER_API_URL:https://auth.api.shumengya.top}
  site-admin-token: ${INFOGENIE_SITE_ADMIN_TOKEN:shumengya520}
  redis-enabled: ${REDIS_ENABLED:true}
  redis-key-prefix: ${REDIS_KEY_PREFIX:infogenie:java:}
  redis-site-ttl: ${REDIS_SITE_TTL:300}

logging:
  level:
    com.smyhub.infogenie: DEBUG
    org.springframework.web: INFO
    org.hibernate.SQL: WARN
