Subversion Repositories SmartDukaan

Rev

Rev 21749 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21749 Rev 21812
Line 9... Line 9...
9
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
9
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
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.common.web.interceptor.AuthenticationInterceptor;
-
 
15
import com.spice.profitmandi.common.web.interceptor.SimpleCORSInterceptor;
14
import com.spice.profitmandi.common.web.interceptor.SimpleCORSInterceptor;
-
 
15
import com.spice.profitmandi.web.interceptor.AuthenticationInterceptor;
16
 
16
 
17
import springfox.documentation.builders.PathSelectors;
17
import springfox.documentation.builders.PathSelectors;
18
import springfox.documentation.builders.RequestHandlerSelectors;
18
import springfox.documentation.builders.RequestHandlerSelectors;
19
import springfox.documentation.service.ApiInfo;
19
import springfox.documentation.service.ApiInfo;
20
import springfox.documentation.spi.DocumentationType;
20
import springfox.documentation.spi.DocumentationType;
Line 52... Line 52...
52
	    registry.addResourceHandler(RESOURCES_PATTERN).addResourceLocations(RESOURCES_LOCATION);
52
	    registry.addResourceHandler(RESOURCES_PATTERN).addResourceLocations(RESOURCES_LOCATION);
53
	}
53
	}
54
	
54
	
55
	@Override
55
	@Override
56
	public void addInterceptors(InterceptorRegistry registry) {
56
	public void addInterceptors(InterceptorRegistry registry) {
57
		registry.addInterceptor(simpleCORSInterceptor).addPathPatterns("/**").excludePathPatterns("/swagger-ui.html", ProfitMandiConstants.URL_PAYU_PAY_RESPONSE, ProfitMandiConstants.URL_PAYU_PAY_CANCELLED);
57
		registry.addInterceptor(simpleCORSInterceptor).addPathPatterns("/**");
58
		registry.addInterceptor(authenticationInterceptor).addPathPatterns("/**").excludePathPatterns(ProfitMandiConstants.URL_ADMIN_TOKEN)
58
		registry.addInterceptor(authenticationInterceptor).addPathPatterns("/**").excludePathPatterns("/login")
59
		.excludePathPatterns("/**/swagger*/**").excludePathPatterns("/v2/**")
59
		.excludePathPatterns("/**/swagger*/**").excludePathPatterns("/v2/**");
60
		.excludePathPatterns(ProfitMandiConstants.URL_USER_GOOGLE_LOGIN, ProfitMandiConstants.URL_USER_GOOGLE_LOGIN + "/", ProfitMandiConstants.URL_VERIFY_OTP);
-
 
61
	}
60
	}
62
	
61
	
63
	@Override
62
	@Override
64
	public void addCorsMappings(CorsRegistry registry) {
63
	public void addCorsMappings(CorsRegistry registry) {
65
		registry.addMapping("/**").allowedOrigins("*").allowedMethods("*").
64
		registry.addMapping("/**").allowedOrigins("*").allowedMethods("*").