spring:
  cloud:
    gateway:
      server:
        webflux:
          routes:
            # 通用用户权限管理系统
            - id: wishing-upms
              uri: lb://wishing-upms
              predicates:
                - Path=/dgapi/upms/**
              filters:
                - StripPrefix=1
            # 后台管理
            - id: wishing-admin
              uri: lb://wishing-admin
              predicates:
                - Path=/dgapi/admin/**
              filters:
                - StripPrefix=0
            # 移动端管理
            - id: wishing-mobile
              uri: lb://wishing-mobile
              predicates:
                - Path=/dgapi/mobile/**
              filters:
                - StripPrefix=0
                - name: DiyRequestRateLimiter # ip限流
                  args:
                    redis-rate-limiter.burstCapacity: 200 #令牌桶的容积
                    redis-rate-limiter.replenishRate: 100 # 流速 每秒
                    key-resolver: "#{@remoteAddressKeyResolver}"
                - name: DiyRequestRateLimiter #同一个用户，同一个接口每秒只能访问5次
                  args:
                    redis-rate-limiter.burstCapacity: 20 #令牌桶的容积
                    redis-rate-limiter.replenishRate: 10 # 流速 每秒
                    key-resolver: "#{@apiKeyResolver}"

