-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathWebConfig.java
More file actions
23 lines (20 loc) · 884 Bytes
/
WebConfig.java
File metadata and controls
23 lines (20 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package clap.server.config.web;
import clap.server.common.utils.StringToPeriodTypeConverter;
import clap.server.common.utils.StringToStatisticsTypeConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ConversionServiceFactoryBean;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.util.Set;
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Bean
public ConversionServiceFactoryBean conversionService() {
ConversionServiceFactoryBean conversionService = new ConversionServiceFactoryBean();
conversionService.setConverters(Set.of(
new StringToStatisticsTypeConverter(),
new StringToPeriodTypeConverter()
));
return conversionService;
}
}