# ================================================
# Urban Lifeline - 通用 Bootstrap 配置 (Docker)
# 所有微服务共享的基础配置
# ================================================

# ================== Spring Cloud Nacos ==================
spring:
  cloud:
    nacos:
      discovery:
        server-addr: ${NACOS_SERVER_ADDR:urban-lifeline-nacos:8848}
        namespace: ${NACOS_NAMESPACE:}
        group: ${NACOS_GROUP:DEFAULT_GROUP}

  # ================== DataSource ==================
  datasource:
    url: ${DB_URL:jdbc:postgresql://urban-lifeline-pg:5432/urban_lifeline}
    username: ${DB_USERNAME:postgres}
    password: ${DB_PASSWORD:postgres123456}
    driver-class-name: org.postgresql.Driver

  # ================== Redis ==================
  data:
    redis:
      host: ${REDIS_HOST:urban-lifeline-redis}
      port: ${REDIS_PORT:6379}
      database: ${REDIS_DATABASE:0}
      password: ${REDIS_PASSWORD:}
      
management:
  endpoints:
    web:
      exposure:
        include: health,info
  endpoint:
    health:
      show-details: always
# ================== Security AES ==================
security:
  aes:
    secret-key: ${AES_SECRET_KEY:MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=}

# ================== Dubbo ==================
dubbo:
  protocol:
    name: dubbo
    port: -1
  registry:
    address: nacos://${NACOS_SERVER_ADDR:urban-lifeline-nacos:8848}

# ================== MyBatis-Plus ==================
mybatis-plus:
  mapper-locations: classpath:mapper/**/*.xml
  type-aliases-package: org.xyzh.common.dto, org.xyzh.api

# ================== SpringDoc 基础配置 ==================
springdoc:
  api-docs:
    enabled: true
    path: /v3/api-docs
  swagger-ui:
    enabled: true
    path: /swagger-ui.html

# ================== Logging ==================
logging:
  config: classpath:log4j2.xml
  charset:
    console: UTF-8
    file: UTF-8
