From 88de2eb5dbec89acc9a2ce71d2f2b2df91c7c7ba Mon Sep 17 00:00:00 2001 From: huangsimin Date: Tue, 25 Jun 2019 17:58:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90PathPattern=20=E7=9A=84?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/ecpark/service/usergw/config/ConfigProperties.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usergw-service/src/main/java/cn/ecpark/service/usergw/config/ConfigProperties.java b/usergw-service/src/main/java/cn/ecpark/service/usergw/config/ConfigProperties.java index 62a2820..9b462b1 100644 --- a/usergw-service/src/main/java/cn/ecpark/service/usergw/config/ConfigProperties.java +++ b/usergw-service/src/main/java/cn/ecpark/service/usergw/config/ConfigProperties.java @@ -37,6 +37,8 @@ import org.springframework.web.reactive.result.condition.PatternsRequestConditio import org.springframework.web.reactive.result.condition.RequestMethodsRequestCondition; import org.springframework.web.reactive.result.method.RequestMappingInfo; import org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping; +import org.springframework.web.util.pattern.PathPattern; +import org.springframework.web.util.pattern.PathPatternParser; import cn.ecpark.service.usergw.utils.Convert; import lombok.extern.slf4j.Slf4j; @@ -133,8 +135,9 @@ public class ConfigProperties { // requestMapping.registerMapping(mapping, handler, method); Method targetMethod = ReflectionUtils.findMethod(ApiController.class, getHandlerMethodName("")); // 找到处理该路由的方法 - - PatternsRequestCondition patternsRequestCondition = new PatternsRequestCondition(api); + PathPatternParser pathPatternParser = new PathPatternParser(); + PathPattern p = pathPatternParser.parse("/test/xixi"); + PatternsRequestCondition patternsRequestCondition = new PatternsRequestCondition(p); RequestMethodsRequestCondition requestMethodsRequestCondition = new RequestMethodsRequestCondition(getRequestMethod(requestMethod)); RequestMappingInfo mapping_info = new RequestMappingInfo(patternsRequestCondition, requestMethodsRequestCondition, null, null, null, null, null);