| Line 7... |
Line 7... |
| 7 |
import org.springframework.beans.factory.annotation.Autowired;
|
7 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 8 |
import org.springframework.context.annotation.Bean;
|
8 |
import org.springframework.context.annotation.Bean;
|
| 9 |
import org.springframework.context.annotation.ComponentScan;
|
9 |
import org.springframework.context.annotation.ComponentScan;
|
| 10 |
import org.springframework.context.annotation.Configuration;
|
10 |
import org.springframework.context.annotation.Configuration;
|
| 11 |
import org.springframework.http.MediaType;
|
11 |
import org.springframework.http.MediaType;
|
| 12 |
import org.springframework.http.converter.ByteArrayHttpMessageConverter;
|
- |
|
| 13 |
import org.springframework.http.converter.HttpMessageConverter;
|
12 |
import org.springframework.http.converter.HttpMessageConverter;
|
| 14 |
import org.springframework.http.converter.ResourceHttpMessageConverter;
|
- |
|
| 15 |
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
13 |
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
| 16 |
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
|
14 |
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
|
| 17 |
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
15 |
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
| 18 |
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
16 |
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
| 19 |
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
17 |
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
| 20 |
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
18 |
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
| 21 |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
19 |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
| 22 |
|
20 |
|
| 23 |
import com.fasterxml.jackson.databind.DeserializationFeature;
|
21 |
import com.fasterxml.jackson.databind.DeserializationFeature;
|
| 24 |
import com.fasterxml.jackson.databind.ObjectMapper;
|
22 |
import com.fasterxml.jackson.databind.ObjectMapper;
|
| 25 |
import com.fasterxml.jackson.databind.SerializationFeature;
|
23 |
import com.fasterxml.jackson.databind.SerializationFeature;
|
| 26 |
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
24 |
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
| Line 37... |
Line 35... |
| 37 |
|
35 |
|
| 38 |
@Configuration
|
36 |
@Configuration
|
| 39 |
@EnableWebMvc
|
37 |
@EnableWebMvc
|
| 40 |
@EnableSwagger2
|
38 |
@EnableSwagger2
|
| 41 |
@ComponentScan("com.spice.profitmandi.*")
|
39 |
@ComponentScan("com.spice.profitmandi.*")
|
| 42 |
public class WebMVCConfig extends WebMvcConfigurerAdapter {
|
40 |
public class WebMVCConfig extends WebMvcConfigurationSupport {
|
| 43 |
|
41 |
|
| 44 |
private static final String RESOURCES_PATTERN = "/resources/**";
|
42 |
private static final String RESOURCES_PATTERN = "/resources/**";
|
| 45 |
private static final String RESOURCES_LOCATION = "/resources/";
|
43 |
private static final String RESOURCES_LOCATION = "/resources/";
|
| 46 |
|
44 |
|
| 47 |
private static final Logger log = LogManager.getLogger(WebMVCConfig.class);
|
45 |
private static final Logger log = LogManager.getLogger(WebMVCConfig.class);
|
| Line 98... |
Line 96... |
| 98 |
|
96 |
|
| 99 |
@Override
|
97 |
@Override
|
| 100 |
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
98 |
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
| 101 |
|
99 |
|
| 102 |
converters.add(new MappingJackson2HttpMessageConverter(objectMapper()));
|
100 |
converters.add(new MappingJackson2HttpMessageConverter(objectMapper()));
|
| 103 |
converters.add(new ResourceHttpMessageConverter());
|
- |
|
| 104 |
converters.add(new ByteArrayHttpMessageConverter());
|
- |
|
| 105 |
//converters.add(new Converter)
|
- |
|
| 106 |
super.configureMessageConverters(converters);
|
101 |
super.addDefaultHttpMessageConverters(converters);
|
| 107 |
}
|
102 |
}
|
| 108 |
|
103 |
|
| 109 |
@Bean
|
104 |
@Bean
|
| 110 |
public ObjectMapper objectMapper() {
|
105 |
public ObjectMapper objectMapper() {
|
| 111 |
ObjectMapper objectMapper = new ObjectMapper();
|
106 |
ObjectMapper objectMapper = new ObjectMapper();
|