update 优化 获取系统url存储重复问题

feature/model
疯狂的狮子li 2 years ago
parent 37290d023e
commit 1fd09f8ca3

@ -29,10 +29,7 @@ public class AllUrlHandler implements InitializingBean {
RequestMappingHandlerMapping mapping = SpringUtils.getBean("requestMappingHandlerMapping", RequestMappingHandlerMapping.class);
Map<RequestMappingInfo, HandlerMethod> map = mapping.getHandlerMethods();
map.keySet().forEach(info -> {
// 获取方法上边的注解 替代path variable 为 *
Objects.requireNonNull(info.getPathPatternsCondition().getPatterns())
.forEach(url -> set.add(ReUtil.replaceAll(url.getPatternString(), PATTERN, "*")));
// 获取类上边的注解, 替代path variable 为 *
// 获取注解上边的 path 替代 path variable 为 *
Objects.requireNonNull(info.getPathPatternsCondition().getPatterns())
.forEach(url -> set.add(ReUtil.replaceAll(url.getPatternString(), PATTERN, "*")));
});

Loading…
Cancel
Save