server:
  port: 8080
spring:
  application:
    name: api-gateway
  profiles:
    active: dev
  cloud:
    nacos:
      config:
        server-addr: 43.226.44.101:8848
        namespace: ${NACOS_NAMESPACE:public}
        group: ${NACOS_GROUP:DEFAULT_GROUP}
        file-extension: yaml
        shared-configs:
          - data-id: common-config.yaml
            group: DEFAULT_GROUP
            refresh: true
          - data-id: gateway-routes.yaml
            group: DEFAULT_GROUP
            refresh: true
        extension-configs:
          - data-id: api-gateway-config.yaml
            group: DEFAULT_GROUP
            refresh: true
      discovery:
        server-addr: 43.226.44.101:8848
        namespace: ${NACOS_NAMESPACE:public}
        group: ${NACOS_GROUP:DEFAULT_GROUP}
        enabled: true
    gateway:
      discovery:
        locator:
          enabled: true
          lower-case-service-id: true
      routes:
        # 租户服务
        - id: tenant-service
          uri: lb://tenant-service
          predicates:
            - Path=/api/admin/tenants/**
          filters:
            - StripPrefix=0
        # 用户服务
        - id: user-service
          uri: lb://user-service
          predicates:
            - Path=/api/users/**
          filters:
            - StripPrefix=0
        # 通知服务
        - id: notification-service
          uri: lb://notification-service
          predicates:
            - Path=/api/notifications/**
          filters:
            - StripPrefix=0
  redis:
    host: 111.229.80.149
    port: 6379
    password: Y(@r5tGk9$Lp2
    timeout: 5000
    lettuce:
      pool:
        max-active: 8
        max-idle: 8
        min-idle: 0

# Sentinel限流配置
feign:
  sentinel:
    enabled: true

# Actuator监控
management:
  endpoints:
    web:
      exposure:
        include: health,info,metrics,gateway
  endpoint:
    health:
      show-details: always
    gateway:
      enabled: true

logging:
  level:
    com.erp.gateway: INFO
    org.springframework.cloud.gateway: DEBUG
