Api Controller 统一接口

v1.4.1
Parker 4 years ago
parent 70d11f7c25
commit 38922dbcc3

@ -0,0 +1,27 @@
package org.opsli.core.conf;
import org.opsli.common.annotation.ApiRestController;
import org.opsli.core.prop.ApiPathProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import javax.annotation.Resource;
/**
* 访
* @author C西
*/
@Configuration
public class SpringWebMvcConfig implements WebMvcConfigurer {
@Resource
private ApiPathProperties apiPathProperties;
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer
.addPathPrefix(apiPathProperties.getGlobalPrefix(),c -> c.isAnnotationPresent(ApiRestController.class));
}
}
Loading…
Cancel
Save