Subversion Repositories SmartDukaan

Rev

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

Rev 21302 Rev 21309
Line 11... Line 11...
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.CreateRetailerRequestInterceptor;
-
 
16
import com.spice.profitmandi.web.interceptor.CreateShopRequestInterceptor;
16
import com.spice.profitmandi.web.interceptor.CreateUserRequestInterceptor;
17
import com.spice.profitmandi.web.interceptor.CreateUserRequestInterceptor;
17
import com.spice.profitmandi.web.interceptor.GoogleLoginRequestInterceptor;
18
import com.spice.profitmandi.web.interceptor.GoogleLoginRequestInterceptor;
18
import com.spice.profitmandi.web.interceptor.RoleRequestInterceptor;
19
import com.spice.profitmandi.web.interceptor.RoleRequestInterceptor;
19
import com.spice.profitmandi.web.interceptor.SimpleCORSInterceptor;
20
import com.spice.profitmandi.web.interceptor.SimpleCORSInterceptor;
20
 
21
 
Line 50... Line 51...
50
	SimpleCORSInterceptor simpleCORSInterceptor;
51
	SimpleCORSInterceptor simpleCORSInterceptor;
51
	
52
	
52
	@Autowired
53
	@Autowired
53
	CreateRetailerRequestInterceptor createRetailerRequestInterceptor;
54
	CreateRetailerRequestInterceptor createRetailerRequestInterceptor;
54
	
55
	
-
 
56
	@Autowired
-
 
57
	CreateShopRequestInterceptor createShopRequestInterceptor;
55
	
58
	
56
	@Bean
59
	@Bean
57
	public Docket api() {
60
	public Docket api() {
58
		return new Docket(DocumentationType.SWAGGER_2).select()
61
		return new Docket(DocumentationType.SWAGGER_2).select()
59
				.apis(RequestHandlerSelectors.any())
62
				.apis(RequestHandlerSelectors.any())
Line 76... Line 79...
76
		registry.addInterceptor(roleRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_ROLE, ProfitMandiConstants.URL_ROLE + "/");
79
		registry.addInterceptor(roleRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_ROLE, ProfitMandiConstants.URL_ROLE + "/");
77
		registry.addInterceptor(googleLoginRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_USER_GOOGLE_LOGIN, ProfitMandiConstants.URL_USER_GOOGLE_LOGIN + "/");
80
		registry.addInterceptor(googleLoginRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_USER_GOOGLE_LOGIN, ProfitMandiConstants.URL_USER_GOOGLE_LOGIN + "/");
78
		registry.addInterceptor(createUserRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_USER, ProfitMandiConstants.URL_USER + "/");
81
		registry.addInterceptor(createUserRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_USER, ProfitMandiConstants.URL_USER + "/");
79
		registry.addInterceptor(simpleCORSInterceptor).addPathPatterns("/**").excludePathPatterns("/swagger-ui.html");
82
		registry.addInterceptor(simpleCORSInterceptor).addPathPatterns("/**").excludePathPatterns("/swagger-ui.html");
80
		registry.addInterceptor(createRetailerRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_RETAILER, ProfitMandiConstants.URL_RETAILER + "/");
83
		registry.addInterceptor(createRetailerRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_RETAILER, ProfitMandiConstants.URL_RETAILER + "/");
-
 
84
		registry.addInterceptor(createShopRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_SHOP, ProfitMandiConstants.URL_SHOP + "/");
81
	}
85
	}
82
	
86
	
83
	@Override
87
	@Override
84
	public void addCorsMappings(CorsRegistry registry) {
88
	public void addCorsMappings(CorsRegistry registry) {
85
		registry.addMapping("/**").allowedOrigins("*").allowedMethods("*").
89
		registry.addMapping("/**").allowedOrigins("*").allowedMethods("*").