server:
  port: 18085
  error:
    include-stacktrace: never

spring:
  profiles:
    active: @env@
  cloud:
    gateway:
      server:
        webflux:
          routes:
            # auth服务 Swagger 文档路由
            - id: auth-service-doc
              uri: lb://auth-service
              predicates:
                - Path=/auth-service/**
              filters:
                - StripPrefix=1
            # user服务 Swagger 文档路由
            - id: user-service-doc
              uri: lb://user-service
              predicates:
                - Path=/user-service/**
              filters:
                - StripPrefix=1
            # auth服务 Swagger 文档路由
            - id: file-service-doc
              uri: lb://file-service
              predicates:
                - Path=/file-service/**
              filters:
                - StripPrefix=1
            # auth业务接口
            - id: auth-service
              uri: lb://auth-service
              predicates:
                - Path=/api/v1/auth/**
              filters:
                - name: Retry
                  args:
                    retries: 3
                    statuses: BAD_GATEWAY,SERVICE_UNAVAILABLE
                    backoff:
                      firstBackoff: 50ms
                      maxBackoff: 500ms
            - id: user-service
              uri: lb://user-service
              predicates:
                - Path=/api/v1/user/**
              filters:
                - name: Retry
                  args:
                    retries: 3
                    statuses: BAD_GATEWAY,SERVICE_UNAVAILABLE
                    backoff:
                      firstBackoff: 50ms
                      maxBackoff: 500ms
            - id: file-service
              uri: lb://file-service
              predicates:
                - Path=/api/v1/file/**
              filters:
                - name: Retry
                  args:
                    retries: 3
                    statuses: BAD_GATEWAY,SERVICE_UNAVAILABLE
                    backoff:
                      firstBackoff: 50ms
                      maxBackoff: 500ms
            # 文件访问路由（公开，直接转发不去前缀）
            - id: file-access
              uri: lb://file-service
              predicates:
                - Path=/api/file/**
  # 设置应用启动后的就绪探针
  lifecycle:
    timeout-per-shutdown-phase: 30s

aioj-backend-gateway:
  # 白名单配置
  white-list:
    - /api/v1/auth/login
    - /api/v1/user/register
    - /api/v1/auth/refresh
    - /actuator/health
    - /swagger-ui/**
    - /v3/api-docs/**
    - /swagger-resources/**

aioj:
  log:
    enabled: true
    max-length: 20000
