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

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

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

  # ================== Redis ==================
  data:
    redis:
      host: ${REDIS_HOST:127.0.0.1}
      port: ${REDIS_PORT:6379}
      database: ${REDIS_DATABASE:0}
      password: ${REDIS_PASSWORD:123456}

# ================== Security AES ==================
security:
  aes:
    # AES-256 密钥（Base64编码，必须与所有服务保持一致）
    # 警告：这是开发环境密钥，生产环境请使用密钥管理系统
    secret-key: ${AES_SECRET_KEY:MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=}

# ================== Dubbo ==================
dubbo:
  protocol:
    name: dubbo
    port: -1
  registry:
    address: nacos://${NACOS_SERVER_ADDR:127.0.0.1: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
