Subversion Repositories SmartDukaan

Rev

Rev 21426 | Rev 21455 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21426 Rev 21452
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.AuthenticationInterceptor;
15
import com.spice.profitmandi.web.interceptor.CreateRetailerRequestInterceptor;
16
import com.spice.profitmandi.web.interceptor.CreateRetailerRequestInterceptor;
16
import com.spice.profitmandi.web.interceptor.CreateShopRequestInterceptor;
17
import com.spice.profitmandi.web.interceptor.CreateShopRequestInterceptor;
17
import com.spice.profitmandi.web.interceptor.CreateUserRequestInterceptor;
18
import com.spice.profitmandi.web.interceptor.CreateUserRequestInterceptor;
18
import com.spice.profitmandi.web.interceptor.GoogleLoginRequestInterceptor;
19
import com.spice.profitmandi.web.interceptor.GoogleLoginRequestInterceptor;
19
import com.spice.profitmandi.web.interceptor.RoleRequestInterceptor;
20
import com.spice.profitmandi.web.interceptor.RoleRequestInterceptor;
Line 53... Line 54...
53
	@Autowired
54
	@Autowired
54
	CreateRetailerRequestInterceptor createRetailerRequestInterceptor;
55
	CreateRetailerRequestInterceptor createRetailerRequestInterceptor;
55
	
56
	
56
	@Autowired
57
	@Autowired
57
	CreateShopRequestInterceptor createShopRequestInterceptor;
58
	CreateShopRequestInterceptor createShopRequestInterceptor;
-
 
59
 
-
 
60
	@Autowired
-
 
61
	AuthenticationInterceptor authenticationInterceptor;
58
	
62
	
59
	@Bean
63
	@Bean
60
	public Docket api() {
64
	public Docket api() {
61
		return new Docket(DocumentationType.SWAGGER_2).select()
65
		return new Docket(DocumentationType.SWAGGER_2).select()
62
				.apis(RequestHandlerSelectors.any())
66
				.apis(RequestHandlerSelectors.any())
Line 77... Line 81...
77
	public void addInterceptors(InterceptorRegistry registry) {
81
	public void addInterceptors(InterceptorRegistry registry) {
78
		registry.addInterceptor(apiRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_API, ProfitMandiConstants.URL_API + "/");
82
		registry.addInterceptor(apiRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_API, ProfitMandiConstants.URL_API + "/");
79
		registry.addInterceptor(roleRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_ROLE, ProfitMandiConstants.URL_ROLE + "/");
83
		registry.addInterceptor(roleRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_ROLE, ProfitMandiConstants.URL_ROLE + "/");
80
		registry.addInterceptor(googleLoginRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_USER_GOOGLE_LOGIN, ProfitMandiConstants.URL_USER_GOOGLE_LOGIN + "/");
84
		registry.addInterceptor(googleLoginRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_USER_GOOGLE_LOGIN, ProfitMandiConstants.URL_USER_GOOGLE_LOGIN + "/");
81
		registry.addInterceptor(createUserRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_USER, ProfitMandiConstants.URL_USER + "/");
85
		registry.addInterceptor(createUserRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_USER, ProfitMandiConstants.URL_USER + "/");
-
 
86
		registry.addInterceptor(authenticationInterceptor).addPathPatterns("/**").excludePathPatterns(ProfitMandiConstants.URL_ADMIN_TOKEN).excludePathPatterns("/**/swagger*/**").excludePathPatterns("/v2/**");
82
		registry.addInterceptor(simpleCORSInterceptor).addPathPatterns("/**").excludePathPatterns("/swagger-ui.html");
87
		registry.addInterceptor(simpleCORSInterceptor).addPathPatterns("/**").excludePathPatterns("/swagger-ui.html");
83
		//registry.addInterceptor(createRetailerRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_RETAILER, ProfitMandiConstants.URL_RETAILER + "/");
88
		//registry.addInterceptor(createRetailerRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_RETAILER, ProfitMandiConstants.URL_RETAILER + "/");
84
		registry.addInterceptor(createShopRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_SHOP, ProfitMandiConstants.URL_SHOP + "/");
89
		//registry.addInterceptor(createShopRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_SHOP, ProfitMandiConstants.URL_SHOP + "/");
85
	}
90
	}
86
	
91
	
87
	@Override
92
	@Override
88
	public void addCorsMappings(CorsRegistry registry) {
93
	public void addCorsMappings(CorsRegistry registry) {
89
		registry.addMapping("/**").allowedOrigins("*").allowedMethods("*").
94
		registry.addMapping("/**").allowedOrigins("*").allowedMethods("*").