添加枚举字段注解扫描注入
This commit is contained in:
@@ -8,6 +8,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
|
||||
import quant.rich.emoney.interceptor.BaseInterceptor;
|
||||
import quant.rich.emoney.interceptor.EnumOptionsInterceptor;
|
||||
import quant.rich.emoney.service.ConfigService;
|
||||
|
||||
/**
|
||||
@@ -22,6 +23,9 @@ public class EmoneyAutoConfig implements WebMvcConfigurer {
|
||||
|
||||
@Autowired
|
||||
BaseInterceptor baseInterceptor;
|
||||
|
||||
@Autowired
|
||||
EnumOptionsInterceptor enumOptionsInterceptor;
|
||||
|
||||
@Autowired
|
||||
ConfigService configService;
|
||||
@@ -34,5 +38,6 @@ public class EmoneyAutoConfig implements WebMvcConfigurer {
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(baseInterceptor).addPathPatterns("/**");
|
||||
registry.addInterceptor(enumOptionsInterceptor).addPathPatterns("/**");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,11 @@ public class ReflectionsConfig {
|
||||
@Bean("reflections")
|
||||
Reflections reflections() {
|
||||
return new Reflections(new ConfigurationBuilder()
|
||||
.addScanners(Scanners.MethodsAnnotated, Scanners.SubTypes, Scanners.TypesAnnotated)
|
||||
.addScanners(
|
||||
Scanners.MethodsAnnotated,
|
||||
Scanners.SubTypes,
|
||||
Scanners.FieldsAnnotated,
|
||||
Scanners.TypesAnnotated)
|
||||
.forPackages("quant.rich.emoney"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user