spring:
  data:
    redis:
      host: 10.0.0.10
      port: 6379
      password: 123456
  cloud:
    nacos:
      discovery:
        enabled: true
        register-enabled: false
        server-addr: 10.0.0.10:8848
        username: nacos
        password: nacos
      config:
        enabled: false
        import-check:
          enabled: false
    gateway:
      # Gateway 发现定位器配置
      server:
        webflux:
          discovery:
            locator:
              enabled: true
              lower-case-service-id: true
    loadbalancer:
      nacos:
        enabled: true
      retry:
        enabled: true
        max-retries-on-same-service-instance: 1
        max-retries-on-next-service-instance: 2
      cache:
        enabled: true
        ttl: 35s
      health-check:
        initial-delay: 0ms
        interval: 30s


aioj-backend-gateway:
  # 白名单配置
  white-list:
    - /api/v1/user/email/send-code
    - /api/file/**
    - /api/v1/auth/login
    - /api/v1/auth/register
    - /api/v1/auth/refresh
    - /api/v1/user/register
    - /api/v1/user/info
    - /api/v1/question/list
    - /api/v1/question/detail/**
    - /actuator/health
    - /swagger-ui/**
    - /doc.html
    - /doc.html/**
    - /webjars/**
    - /v3/api-docs/**
    - /**/v3/api-docs/**
    - /auth-service/**
    - /user-service/**

logging:
  level:
    root: INFO
    # Nacos 相关日志
    com.alibaba.nacos: INFO
    com.alibaba.cloud.nacos: INFO
    # LoadBalancer 日志
    org.springframework.cloud.loadbalancer: INFO
    # Gateway 日志 - 改为 INFO 减少输出，需要调试时改回 DEBUG
    org.springframework.cloud.gateway: INFO
    # 自定义过滤器日志
    cn.meowrain.aioj.backend.gateway: DEBUG


knife4j:
  gateway:
    enabled: true
    tags-sorter: alpha
    operations-sorter: alpha
    strategy: manual
    routes:
      - name: 认证服务
        service-name: auth-service
        url: /auth-service/api/v3/api-docs
        context-path: /auth-service
        order: 1
      - name: 用户服务
        service-name: user-service
        url: /user-service/api/v3/api-docs
        context-path: /user-service
        order: 2
      - name: 文件服务
        service-name: file-service
        url: /file-service/api/v3/api-docs
        context-path: /file-service
        order: 2