| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.web.config;
|
1 |
package com.spice.profitmandi.web.config;
|
| 2 |
|
2 |
|
| 3 |
import java.time.format.DateTimeFormatter;
|
3 |
import java.time.format.DateTimeFormatter;
|
| - |
|
4 |
import java.util.List;
|
| 4 |
|
5 |
|
| 5 |
import org.springframework.beans.factory.annotation.Autowired;
|
6 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 6 |
import org.springframework.context.annotation.Bean;
|
7 |
import org.springframework.context.annotation.Bean;
|
| 7 |
import org.springframework.context.annotation.ComponentScan;
|
8 |
import org.springframework.context.annotation.ComponentScan;
|
| 8 |
import org.springframework.context.annotation.Configuration;
|
9 |
import org.springframework.context.annotation.Configuration;
|
| - |
|
10 |
import org.springframework.http.converter.HttpMessageConverter;
|
| - |
|
11 |
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
| 9 |
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
12 |
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
| 10 |
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
13 |
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
| 11 |
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
14 |
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
| 12 |
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
15 |
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
| 13 |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
16 |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
| 14 |
|
17 |
|
| - |
|
18 |
import com.fasterxml.jackson.databind.ObjectMapper;
|
| - |
|
19 |
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
|
| - |
|
20 |
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
| - |
|
21 |
import com.fasterxml.jackson.module.paramnames.ParameterNamesModule;
|
| 15 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
22 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 16 |
import com.spice.profitmandi.common.web.interceptor.SimpleCORSInterceptor;
|
23 |
import com.spice.profitmandi.common.web.interceptor.SimpleCORSInterceptor;
|
| 17 |
import com.spice.profitmandi.web.interceptor.AuthenticationInterceptor;
|
24 |
import com.spice.profitmandi.web.interceptor.AuthenticationInterceptor;
|
| 18 |
|
25 |
|
| 19 |
import springfox.documentation.builders.PathSelectors;
|
26 |
import springfox.documentation.builders.PathSelectors;
|
| Line 81... |
Line 88... |
| 81 |
"New Spice Solutions Pvt. Ltd.",
|
88 |
"New Spice Solutions Pvt. Ltd.",
|
| 82 |
"License of API",
|
89 |
"License of API",
|
| 83 |
"API license URL");
|
90 |
"API license URL");
|
| 84 |
return apiInfo;
|
91 |
return apiInfo;
|
| 85 |
}
|
92 |
}
|
| - |
|
93 |
|
| - |
|
94 |
@Override
|
| - |
|
95 |
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
| - |
|
96 |
converters.add(new MappingJackson2HttpMessageConverter(objectMapper()));
|
| - |
|
97 |
}
|
| - |
|
98 |
|
| - |
|
99 |
private ObjectMapper objectMapper() {
|
| - |
|
100 |
ObjectMapper mapper = new ObjectMapper()
|
| - |
|
101 |
.registerModule(new ParameterNamesModule())
|
| - |
|
102 |
.registerModule(new Jdk8Module())
|
| - |
|
103 |
.registerModule(new JavaTimeModule()); // new module, NOT JSR310Module
|
| - |
|
104 |
return mapper;
|
| - |
|
105 |
}
|
| 86 |
}
|
106 |
}
|
| 87 |
|
107 |
|