mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-14 02:55:07 +08:00
完善 WebConfiguration 注释,帮助阅读的人理解 /api 前缀
This commit is contained in:
@ -1 +0,0 @@
|
||||
<http://www.iocoder.cn/Spring-Boot/Spring-Security/?github>
|
@ -0,0 +1 @@
|
||||
<https://www.iocoder.cn/Spring-Boot/Resilience4j/?yudao>
|
@ -27,9 +27,10 @@ public class WebConfiguration implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void configurePathMatch(PathMatchConfigurer configurer) {
|
||||
// 设置 API 前缀,仅仅匹配 controller 包下的
|
||||
configurer.addPathPrefix(webProperties.getApiPrefix(), clazz ->
|
||||
clazz.isAnnotationPresent(RestController.class)
|
||||
&& clazz.getPackage().getName().startsWith(webProperties.getControllerPackage()));
|
||||
&& clazz.getPackage().getName().startsWith(webProperties.getControllerPackage())); // 仅仅匹配 controller 包
|
||||
}
|
||||
|
||||
// ========== Filter 相关 ==========
|
||||
|
Reference in New Issue
Block a user