|
@@ -1,12 +1,16 @@
|
|
|
package com.persagy.apm.energy.report.common;
|
|
|
|
|
|
+import com.persagy.apm.common.handler.PoemsContextFilter;
|
|
|
import com.persagy.apm.common.handler.PoemsContextHandler;
|
|
|
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.core.annotation.Order;
|
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
|
|
+import javax.servlet.Filter;
|
|
|
+
|
|
|
|
|
|
* web拦截器配置
|
|
|
*
|
|
@@ -22,10 +26,27 @@ public class PoemsWebConfigurer implements WebMvcConfigurer {
|
|
|
return new PoemsContextHandler();
|
|
|
}
|
|
|
|
|
|
+ @Bean
|
|
|
+ public Filter poemsContextFilter() {
|
|
|
+ return new PoemsContextFilter();
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void addInterceptors(InterceptorRegistry registry) {
|
|
|
|
|
|
registry.addInterceptor(poemsContextHandler()).order(10).addPathPatterns("/**");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|