MCPcopy Create free account
hub / github.com/Bit0r/java-util / WmsWebMvcConfig

Class WmsWebMvcConfig

src/main/java/config/WmsWebMvcConfig.java:10–28  ·  view source on GitHub ↗

url全部加上/test

Source from the content-addressed store, hash-verified

8 * url全部加上/test
9 */
10@Configuration
11public class WmsWebMvcConfig implements WebMvcConfigurer {
12
13 private static final String BASE_PATH = "/test";
14
15 @Override
16 public void configurePathMatch(PathMatchConfigurer configurer) {
17 // 添加全局的基础路径
18 configurer.setUseTrailingSlashMatch(true)
19 .addPathPrefix(BASE_PATH, this::isWmsController);
20 }
21
22 // 只对 com.zc.wms 包下的控制器应用前缀
23 private boolean isWmsController(Class<?> clazz) {
24 // 仅当类位于 com.yi.xm 包下时,才添加路径前缀
25 return clazz.getPackage().getName().startsWith("com.yi.xm");
26 }
27
28}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected