diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/filter/ParameterFormatterFilter.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/filter/ParameterFormatterFilter.java index 6d862fbf..f5c7dc35 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/filter/ParameterFormatterFilter.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/filter/ParameterFormatterFilter.java @@ -21,7 +21,7 @@ import static com.gitee.sop.gatewaycommon.gateway.filter.Orders.PARAMETER_FORMAT public class ParameterFormatterFilter implements GlobalFilter, Ordered { @Autowired(required = false) - private ParameterFormatter sopParameterFormatter; + private ParameterFormatter parameterFormatter; @Override public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { @@ -30,11 +30,11 @@ public class ParameterFormatterFilter implements GlobalFilter, Ordered { return chain.filter(exchange); } // 校验成功后进行参数转换 - if (sopParameterFormatter != null) { + if (parameterFormatter != null) { ServerWebExchange formatExchange = ServerWebExchangeUtil.format( exchange , apiParam - , sopParameterFormatter::format + , parameterFormatter::format , httpHeaders -> httpHeaders.set(ParamNames.HEADER_VERSION_NAME, apiParam.fetchVersion())); return chain.filter(formatExchange); } diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/filter/PreParameterFormatterFilter.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/filter/PreParameterFormatterFilter.java index e7f725b4..c58ec85c 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/filter/PreParameterFormatterFilter.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/filter/PreParameterFormatterFilter.java @@ -17,7 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired; public class PreParameterFormatterFilter extends BaseZuulFilter { @Autowired(required = false) - private ParameterFormatter sopParameterFormatter; + private ParameterFormatter parameterFormatter; @Override protected FilterType getFilterType() { @@ -33,8 +33,8 @@ public class PreParameterFormatterFilter extends BaseZuulFilter { protected Object doRun(RequestContext requestContext) throws ZuulException { ApiParam apiParam = ZuulContext.getApiParam(); // 校验成功后进行参数转换 - if (sopParameterFormatter != null) { - ZuulParameterUtil.format(apiParam, sopParameterFormatter::format); + if (parameterFormatter != null) { + ZuulParameterUtil.format(apiParam, parameterFormatter::format); requestContext.addZuulRequestHeader(ParamNames.HEADER_VERSION_NAME, apiParam.fetchVersion()); } return null;