package link.at17.mid.tushare.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import link.at17.mid.tushare.component.ConfigAutoRegistrar;
import link.at17.mid.tushare.component.StaticAttributeInterceptor;
import link.at17.mid.tushare.component.UpdateMethodInterceptor;

@Configuration
@Import(ConfigAutoRegistrar.class)
public class VerichConfig implements WebMvcConfigurer {

    @Autowired
    StaticAttributeInterceptor platformInterceptor;
    
    @Autowired
    UpdateMethodInterceptor updateMethodInterceptor;
    
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry
            .addInterceptor(platformInterceptor)
            .addPathPatterns("/**");

        registry
            .addInterceptor(updateMethodInterceptor)
            .addPathPatterns("/**");
        
    }
}
