package shop.alien.config.filter;

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

/**
 * 防重复提交配置类
 * 
 * @author lingma
 * @version 1.0
 */
@Setter
@Configuration
public class NoRepeatSubmitConfig implements WebMvcConfigurer {
    
    private NoRepeatSubmitInterceptor noRepeatSubmitInterceptor;

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