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

26 lines
872 B
Java
Raw Normal View History

2017-12-15 17:57:41 +01:00
package eu.eudat.configurations;
import eu.eudat.handlers.PrincipalArgumentResolver;
2017-12-19 10:02:25 +01:00
import eu.eudat.services.AuthenticationService;
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;
2017-12-15 17:57:41 +01:00
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import java.util.List;
2018-02-07 10:56:30 +01:00
@EnableAsync
2017-12-15 17:57:41 +01:00
@Configuration
public class WebMVCConfiguration extends WebMvcConfigurerAdapter {
2017-12-19 10:02:25 +01:00
@Autowired
AuthenticationService authenticationService;
2018-02-16 11:34:02 +01:00
2017-12-15 17:57:41 +01:00
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
2017-12-19 10:02:25 +01:00
argumentResolvers.add(new PrincipalArgumentResolver(this.authenticationService));
2017-12-15 17:57:41 +01:00
}
2018-01-17 13:03:51 +01:00
2017-12-15 17:57:41 +01:00
}