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;
|
2020-02-14 17:40:34 +01:00
|
|
|
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;
|
2023-10-03 16:29:45 +02:00
|
|
|
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
|
2020-02-14 17:40:34 +01:00
|
|
|
@EnableScheduling
|
2023-10-03 16:29:45 +02:00
|
|
|
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;
|
2023-10-18 17:52:03 +02:00
|
|
|
@Autowired
|
|
|
|
public WebMVCConfiguration(UserInterceptor userInterceptor) {
|
2023-10-11 16:53:12 +02:00
|
|
|
this.userInterceptor = userInterceptor;
|
2019-07-12 15:58:17 +02:00
|
|
|
}
|
2018-02-16 11:34:02 +01:00
|
|
|
|
2019-07-12 15:58:17 +02:00
|
|
|
@Autowired
|
|
|
|
@Override
|
|
|
|
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
|
|
|
|
}
|
2018-03-05 17:18:45 +01:00
|
|
|
|
2019-07-12 15:58:17 +02:00
|
|
|
@Override
|
|
|
|
public void addInterceptors(InterceptorRegistry registry) {
|
2023-10-11 16:53:12 +02:00
|
|
|
registry.addWebRequestInterceptor(userInterceptor).order(1);
|
2019-07-12 15:58:17 +02:00
|
|
|
}
|
2017-12-15 17:57:41 +01:00
|
|
|
}
|