# ================== Server ==================
server:
  port: 8182
  # servlet:
  #   context-path: /urban-lifeline/system  # 微服务架构下，context-path由Gateway管理
# ================== Auth ====================
urban-lifeline:
  auth:
    enabled: true

    # 认证接口：可以按服务自定义
    login-path: /urban-lifeline/auth/login
    logout-path: /urban-lifeline/auth/logout
    captcha-path: /urban-lifeline/auth/captcha
    refresh-path: /urban-lifeline/auth/refresh

    # 通用白名单（非认证接口）
    whitelist:
      # Swagger/OpenAPI 文档相关（建议不带 context-path）
      - /swagger-ui/**
      - /swagger-ui.html
      - /v3/api-docs/**
      - /webjars/**

      # 静态资源
      - /favicon.ico
      - /error

      # 健康检查
      - /actuator/health
      - /actuator/info
      
      # 其他需要放行的路径
      # - /public/**
      # - /api/public/**

security:
  aes:
    secret-key: 1234567890qwer


# ================== Spring ==================
spring:
  application:
    name: system-service
  
  # ================== Spring Cloud Nacos ==================
  cloud:
    nacos:
      discovery:
        server-addr: 127.0.0.1:8848
        namespace: dev
        group: DEFAULT_GROUP
  
  # ================== DataSource ==================
  datasource:
    # 按你的实际库名改一下，比如 urban-lifeline_system
    url: jdbc:postgresql://127.0.0.1:5432/urban_lifeline   # 换成你的 PG 库名
    username: postgres                                      # PG 用户
    password: postgres                                     # PG 密码
    driver-class-name: org.postgresql.Driver

  # ================== Redis ==================
  data:
    redis:
      host: 127.0.0.1       # 如果是 docker 跑的 redis，按实际 host / 端口改
      port: 6379
      database: 0
      password: 123456        # 如果有密码就填上，没密码可以去掉这一行
# ================== SpringDoc ==================
springdoc:
  api-docs:
    enabled: true
    path: /v3/api-docs
  swagger-ui:
    enabled: true
    path: /swagger-ui.html
    try-it-out-enabled: true
    show-common-extensions: true
    show-extensions: true
    show-request-duration: true
    filter: true
    tags-sorter: alpha
    operations-sorter: alpha
  group-configs:
    - group: 'default'
      display-name: '系统服务 API'
      paths-to-match: '/**'

# ================== Dubbo + Nacos 注册中心 ==================
dubbo:
  application:
    name: urban-lifeline-system
    qos-enable: false

  protocol:
    name: dubbo
    port: -1              # -1 表示随机端口，避免端口冲突；也可以写死一个端口

  registry:
    # Nacos 注册中心地址：使用 docker-compose 中映射到宿主机的 8848 端口
    address: nacos://127.0.0.1:8848
    # 如果 Nacos 有用户名密码，可以加上:
    # username: nacos
    # password: nacos

  # Dubbo 服务扫描包（你 @DubboService 标注的位置）
  scan:
    base-packages: org.xyzh.system.service.impl

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

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