package com.yeejoin.amos.boot.module.jg.biz.config;

import com.yeejoin.amos.boot.module.jg.biz.interceptor.ClearThreadLocalInterceptor;
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;

/**
 * @author Administrator
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Bean
    public ClearThreadLocalInterceptor clearThreadLocalInterceptor() {
        return new ClearThreadLocalInterceptor();
    }

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

}