自定义过滤工厂类
DemoGatewayFilterFactory
package com.learning.springcloud.custom;import org.apache.commons.lang.StringUtils;
import org.springframework.cloud.gateway.filter.GatewayFilter;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;import java.util.Arrays;
import java.util.List;@Component
public class DemoGatewayFilterFactory extends AbstractGatewayFilterFactory<DemoGatewayFilterFactory.Config> {public DemoGatewayFilterFactory() {super(Config.class);}public List<String> shortcutFieldOrder() {return Arrays.asList("name", "value");}@Overridepublic GatewayFilter