package org.springblade.config;

import org.springblade.common.interceptor.WhiteListHandlerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.AntPathMatcher;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;



@Configuration
public class WhiteListWebMvcConfig implements WebMvcConfigurer {

    @Bean
    public WhiteListHandlerInterceptor whiteListHandlerInterceptor() {
        return new WhiteListHandlerInterceptor(new AntPathMatcher());
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(whiteListHandlerInterceptor());
    }
}
