时间断言工厂(ZonedDateTime.now())
AfterRoutePredicateFactory
接收一个日期参数,判断请求日期 是否在指定日期之后
路由配置
server:
port: 8088
spring:
application:
name: api-gateway
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8847
username: nacos
password: nacos
gateway:
routes:
- id: order_route # 路由唯一标识
#uri: http://localhost:8020 # 需要转发的地址
uri: lb://order-service # 需要转发的地址
# 断言规则 用于路由规则的匹配
predicates:
- After=2024-01-01T23:00:11.518+08:00[GMT+08:00]
# http://localhost:8088/order-serv/order/add => http://localhost:8020/order-serv/order/add
filters:
- StripPrefix=1 # 转发去掉第一层路径
# http://localhost:8020/order-serv/order/add => http://loca