content: package com.ncst.seckill.config;
  
  import java.util.List;
  
  import com.ncst.seckill.access.AccessInterceptor;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.web.method.support.HandlerMethodArgumentResolver;
  import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
  import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
  
  /**
   * @Date 2020/10/14 12:30
   * @Author by LSY
   * @Description
   */
  @Configuration
  public class WebConfig extends WebMvcConfigurerAdapter {
  
      @Autowired
      UserArgumentResolver userArgumentResolver;
  
      @Autowired
      AccessInterceptor accessInterceptor;
  
      @Override
      public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
          argumentResolvers.add(userArgumentResolver);
      }
  
      @Override
      public void addInterceptors(InterceptorRegistry registry) {
          registry.addInterceptor(accessInterceptor);
      }
  }
  