| Line 10... |
Line 10... |
| 10 |
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
10 |
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
| 11 |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
11 |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
| 12 |
|
12 |
|
| 13 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
13 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 14 |
import com.spice.profitmandi.web.interceptor.ApiRequestInterceptor;
|
14 |
import com.spice.profitmandi.web.interceptor.ApiRequestInterceptor;
|
| - |
|
15 |
import com.spice.profitmandi.web.interceptor.CreateRetailerRequestInterceptor;
|
| 15 |
import com.spice.profitmandi.web.interceptor.CreateUserRequestInterceptor;
|
16 |
import com.spice.profitmandi.web.interceptor.CreateUserRequestInterceptor;
|
| 16 |
import com.spice.profitmandi.web.interceptor.GoogleLoginRequestInterceptor;
|
17 |
import com.spice.profitmandi.web.interceptor.GoogleLoginRequestInterceptor;
|
| 17 |
import com.spice.profitmandi.web.interceptor.RoleRequestInterceptor;
|
18 |
import com.spice.profitmandi.web.interceptor.RoleRequestInterceptor;
|
| 18 |
import com.spice.profitmandi.web.interceptor.SimpleCORSInterceptor;
|
19 |
import com.spice.profitmandi.web.interceptor.SimpleCORSInterceptor;
|
| 19 |
|
20 |
|
| Line 46... |
Line 47... |
| 46 |
CreateUserRequestInterceptor createUserRequestInterceptor;
|
47 |
CreateUserRequestInterceptor createUserRequestInterceptor;
|
| 47 |
|
48 |
|
| 48 |
@Autowired
|
49 |
@Autowired
|
| 49 |
SimpleCORSInterceptor simpleCORSInterceptor;
|
50 |
SimpleCORSInterceptor simpleCORSInterceptor;
|
| 50 |
|
51 |
|
| - |
|
52 |
@Autowired
|
| - |
|
53 |
CreateRetailerRequestInterceptor createRetailerRequestInterceptor;
|
| - |
|
54 |
|
| - |
|
55 |
|
| 51 |
@Bean
|
56 |
@Bean
|
| 52 |
public Docket api() {
|
57 |
public Docket api() {
|
| 53 |
return new Docket(DocumentationType.SWAGGER_2).select()
|
58 |
return new Docket(DocumentationType.SWAGGER_2).select()
|
| 54 |
.apis(RequestHandlerSelectors.any())
|
59 |
.apis(RequestHandlerSelectors.any())
|
| 55 |
.paths(PathSelectors.any()).build()
|
60 |
.paths(PathSelectors.any()).build()
|
| Line 70... |
Line 75... |
| 70 |
registry.addInterceptor(apiRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_API, ProfitMandiConstants.URL_API + "/");
|
75 |
registry.addInterceptor(apiRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_API, ProfitMandiConstants.URL_API + "/");
|
| 71 |
registry.addInterceptor(roleRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_ROLE, ProfitMandiConstants.URL_ROLE + "/");
|
76 |
registry.addInterceptor(roleRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_ROLE, ProfitMandiConstants.URL_ROLE + "/");
|
| 72 |
registry.addInterceptor(googleLoginRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_USER_GOOGLE_LOGIN, ProfitMandiConstants.URL_USER_GOOGLE_LOGIN + "/");
|
77 |
registry.addInterceptor(googleLoginRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_USER_GOOGLE_LOGIN, ProfitMandiConstants.URL_USER_GOOGLE_LOGIN + "/");
|
| 73 |
registry.addInterceptor(createUserRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_USER, ProfitMandiConstants.URL_USER + "/");
|
78 |
registry.addInterceptor(createUserRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_USER, ProfitMandiConstants.URL_USER + "/");
|
| 74 |
registry.addInterceptor(simpleCORSInterceptor).addPathPatterns("/**").excludePathPatterns("/swagger-ui.html");
|
79 |
registry.addInterceptor(simpleCORSInterceptor).addPathPatterns("/**").excludePathPatterns("/swagger-ui.html");
|
| - |
|
80 |
registry.addInterceptor(createRetailerRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_RETAILER, ProfitMandiConstants.URL_RETAILER + "/");
|
| 75 |
}
|
81 |
}
|
| 76 |
|
82 |
|
| 77 |
@Override
|
83 |
@Override
|
| 78 |
public void addCorsMappings(CorsRegistry registry) {
|
84 |
public void addCorsMappings(CorsRegistry registry) {
|
| 79 |
registry.addMapping("/**").allowedOrigins("*").allowedMethods("*").
|
85 |
registry.addMapping("/**").allowedOrigins("*").allowedMethods("*").
|