argos/dmp-backend/web/src/main/java/eu/eudat/configurations/WebMVCConfiguration.java

35 lines
1.1 KiB
Java
Raw Normal View History

2017-12-15 17:57:41 +01:00
package eu.eudat.configurations;
2023-10-11 16:53:12 +02:00
import eu.eudat.interceptors.UserInterceptor;
2017-12-19 10:02:25 +01:00
import org.springframework.beans.factory.annotation.Autowired;
2017-12-15 17:57:41 +01:00
import org.springframework.context.annotation.Configuration;
2018-02-07 10:56:30 +01:00
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
2017-12-15 17:57:41 +01:00
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
2018-03-05 17:18:45 +01:00
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
2017-12-15 17:57:41 +01:00
import java.util.List;
2018-02-07 10:56:30 +01:00
@EnableAsync
2017-12-15 17:57:41 +01:00
@Configuration
@EnableScheduling
public class WebMVCConfiguration implements WebMvcConfigurer {
2017-12-15 17:57:41 +01:00
2023-10-11 16:53:12 +02:00
private final UserInterceptor userInterceptor;
@Autowired
public WebMVCConfiguration(UserInterceptor userInterceptor) {
2023-10-11 16:53:12 +02:00
this.userInterceptor = userInterceptor;
}
2018-02-16 11:34:02 +01:00
@Autowired
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
}
2018-03-05 17:18:45 +01:00
@Override
public void addInterceptors(InterceptorRegistry registry) {
2023-10-11 16:53:12 +02:00
registry.addWebRequestInterceptor(userInterceptor).order(1);
}
2017-12-15 17:57:41 +01:00
}