package shop.alien.config.filter;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 可以集中在这里配置拦截器、过滤器、静态资源缓存等
 */
@Configuration
public class HttpRequestConfig implements WebMvcConfigurer {

    @Bean
    public RequestInterceptor getSignatureInterceptor() {
        return new RequestInterceptor();
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(getSignatureInterceptor()).addPathPatterns("/**");
    }
}
