java110
2022-02-17 08afab63ed23196429126529744e4cbc80c0e747
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.java110.core.aop;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
 
@Configuration
public class Java110TraceConfigurer extends WebMvcConfigurerAdapter {
    @Autowired
    private Java110TraceHandlerInterceptor java110TraceHandlerInterceptor;
 
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
    }
 
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(java110TraceHandlerInterceptor).addPathPatterns("/**");
        super.addInterceptors(registry);
    }
}