| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.web.config;
|
1 |
package com.spice.profitmandi.web.config;
|
| 2 |
|
2 |
|
| - |
|
3 |
import java.util.Arrays;
|
| 3 |
import java.util.List;
|
4 |
import java.util.List;
|
| 4 |
|
5 |
|
| 5 |
import org.apache.logging.log4j.LogManager;
|
6 |
import org.apache.logging.log4j.LogManager;
|
| 6 |
import org.apache.logging.log4j.Logger;
|
7 |
import org.apache.logging.log4j.Logger;
|
| 7 |
import org.springframework.beans.factory.annotation.Autowired;
|
8 |
import org.springframework.beans.factory.annotation.Autowired;
|
| Line 66... |
Line 67... |
| 66 |
@Override
|
67 |
@Override
|
| 67 |
public void addInterceptors(InterceptorRegistry registry) {
|
68 |
public void addInterceptors(InterceptorRegistry registry) {
|
| 68 |
registry.addInterceptor(simpleCORSInterceptor).addPathPatterns("/**").excludePathPatterns("/swagger-ui.html",
|
69 |
registry.addInterceptor(simpleCORSInterceptor).addPathPatterns("/**").excludePathPatterns("/swagger-ui.html",
|
| 69 |
ProfitMandiConstants.URL_PAYU_PAY_RESPONSE, ProfitMandiConstants.URL_PAYU_PAY_CANCELLED,
|
70 |
ProfitMandiConstants.URL_PAYU_PAY_RESPONSE, ProfitMandiConstants.URL_PAYU_PAY_CANCELLED,
|
| 70 |
ProfitMandiConstants.URL_CCAVENUE_PAY_RESPONSE, ProfitMandiConstants.URL_CCAVENUE_PAY_CANCELLED,
|
71 |
ProfitMandiConstants.URL_CCAVENUE_PAY_RESPONSE, ProfitMandiConstants.URL_CCAVENUE_PAY_CANCELLED,
|
| - |
|
72 |
ProfitMandiConstants.URL_LOAN_CCAVENUE_PAY_CANCELLED,
|
| 71 |
ProfitMandiConstants.URL_LOAN_CCAVENUE_PAY_CANCELLED, ProfitMandiConstants.URL_LOAN_CCAVENUE_PAY_RESPONSE,
|
73 |
ProfitMandiConstants.URL_LOAN_CCAVENUE_PAY_RESPONSE, ProfitMandiConstants.URL_POST_OFFICE,
|
| 72 |
ProfitMandiConstants.URL_POST_OFFICE, ProfitMandiConstants.URL_NEW_LEAD);
|
74 |
ProfitMandiConstants.URL_NEW_LEAD);
|
| 73 |
|
75 |
|
| 74 |
registry.addInterceptor(authenticationInterceptor).addPathPatterns("/**")
|
76 |
registry.addInterceptor(authenticationInterceptor).addPathPatterns("/**")
|
| 75 |
.excludePathPatterns(ProfitMandiConstants.URL_ADMIN_TOKEN).excludePathPatterns("/**/swagger*/**")
|
77 |
.excludePathPatterns(ProfitMandiConstants.URL_ADMIN_TOKEN).excludePathPatterns("/**/swagger*/**")
|
| 76 |
.excludePathPatterns("/v2/**").excludePathPatterns("/document")
|
78 |
.excludePathPatterns("/v2/**").excludePathPatterns("/document")
|
| 77 |
.excludePathPatterns(ProfitMandiConstants.URL_USER_GOOGLE_LOGIN,
|
79 |
.excludePathPatterns(ProfitMandiConstants.URL_USER_GOOGLE_LOGIN,
|
| 78 |
ProfitMandiConstants.URL_USER_GOOGLE_LOGIN + "/", ProfitMandiConstants.URL_VERIFY_OTP)
|
80 |
ProfitMandiConstants.URL_USER_GOOGLE_LOGIN + "/", ProfitMandiConstants.URL_VERIFY_OTP)
|
| 79 |
.excludePathPatterns("/store/token").excludePathPatterns("/gc/**")
|
81 |
.excludePathPatterns("/store/token").excludePathPatterns("/gc/**")
|
| 80 |
.excludePathPatterns("/stores/**");
|
82 |
.excludePathPatterns("/store/generateInvoice").excludePathPatterns("/stores/**");
|
| 81 |
|
83 |
|
| 82 |
// registry to check api access on basis of UserInfo
|
84 |
// registry to check api access on basis of UserInfo
|
| 83 |
}
|
85 |
}
|
| 84 |
|
86 |
|
| 85 |
@Override
|
87 |
@Override
|
| Line 94... |
Line 96... |
| 94 |
return apiInfo;
|
96 |
return apiInfo;
|
| 95 |
}
|
97 |
}
|
| 96 |
|
98 |
|
| 97 |
@Override
|
99 |
@Override
|
| 98 |
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
100 |
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
| - |
|
101 |
log.info("converters" + converters);
|
| 99 |
|
102 |
|
| - |
|
103 |
List<MediaType> mediaTypes = Arrays.asList(MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN,
|
| - |
|
104 |
MediaType.TEXT_HTML, MediaType.TEXT_XML, MediaType.APPLICATION_OCTET_STREAM);
|
| - |
|
105 |
|
| 100 |
converters.add(new MappingJackson2HttpMessageConverter(objectMapper()));
|
106 |
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(objectMapper());
|
| - |
|
107 |
converter.setSupportedMediaTypes(mediaTypes);
|
| 101 |
super.configureMessageConverters(converters);
|
108 |
super.configureMessageConverters(converters);
|
| 102 |
}
|
109 |
}
|
| 103 |
|
110 |
|
| 104 |
@Bean
|
111 |
@Bean
|
| 105 |
public ObjectMapper objectMapper() {
|
112 |
public ObjectMapper objectMapper() {
|