Subversion Repositories SmartDukaan

Rev

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

Rev 22812 Rev 22931
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.common.web.interceptor.SimpleCORSInterceptor;
14
import com.spice.profitmandi.common.web.interceptor.SimpleCORSInterceptor;
15
import com.spice.profitmandi.web.interceptor.AuthenticationInterceptor;
15
import com.spice.profitmandi.web.interceptor.AuthenticationInterceptor;
16
import com.spice.profitmandi.web.interceptor.GoogleLoginRequestInterceptor;
-
 
17
 
16
 
18
import springfox.documentation.builders.PathSelectors;
17
import springfox.documentation.builders.PathSelectors;
19
import springfox.documentation.builders.RequestHandlerSelectors;
18
import springfox.documentation.builders.RequestHandlerSelectors;
20
import springfox.documentation.service.ApiInfo;
19
import springfox.documentation.service.ApiInfo;
21
import springfox.documentation.spi.DocumentationType;
20
import springfox.documentation.spi.DocumentationType;
Line 30... Line 29...
30
	
29
	
31
	private static final String RESOURCES_PATTERN="/resources/**";
30
	private static final String RESOURCES_PATTERN="/resources/**";
32
	private static final String RESOURCES_LOCATION="/resources/";
31
	private static final String RESOURCES_LOCATION="/resources/";
33
	
32
	
34
	@Autowired
33
	@Autowired
35
	GoogleLoginRequestInterceptor googleLoginRequestInterceptor;
-
 
36
	
-
 
37
	@Autowired
-
 
38
	SimpleCORSInterceptor simpleCORSInterceptor;
34
	SimpleCORSInterceptor simpleCORSInterceptor;
39
 
35
 
40
	@Autowired
36
	@Autowired
41
	AuthenticationInterceptor authenticationInterceptor;
37
	AuthenticationInterceptor authenticationInterceptor;
42
	
38
	
Line 62... Line 58...
62
		registry.addInterceptor(simpleCORSInterceptor).addPathPatterns("/**").excludePathPatterns("/swagger-ui.html", ProfitMandiConstants.URL_PAYU_PAY_RESPONSE, ProfitMandiConstants.URL_PAYU_PAY_CANCELLED);
58
		registry.addInterceptor(simpleCORSInterceptor).addPathPatterns("/**").excludePathPatterns("/swagger-ui.html", ProfitMandiConstants.URL_PAYU_PAY_RESPONSE, ProfitMandiConstants.URL_PAYU_PAY_CANCELLED);
63
		registry.addInterceptor(authenticationInterceptor).addPathPatterns("/**").excludePathPatterns(ProfitMandiConstants.URL_ADMIN_TOKEN)
59
		registry.addInterceptor(authenticationInterceptor).addPathPatterns("/**").excludePathPatterns(ProfitMandiConstants.URL_ADMIN_TOKEN)
64
		.excludePathPatterns("/**/swagger*/**").excludePathPatterns("/v2/**").excludePathPatterns("/document")
60
		.excludePathPatterns("/**/swagger*/**").excludePathPatterns("/v2/**").excludePathPatterns("/document")
65
		.excludePathPatterns(ProfitMandiConstants.URL_USER_GOOGLE_LOGIN, ProfitMandiConstants.URL_USER_GOOGLE_LOGIN + "/", ProfitMandiConstants.URL_VERIFY_OTP);
61
		.excludePathPatterns(ProfitMandiConstants.URL_USER_GOOGLE_LOGIN, ProfitMandiConstants.URL_USER_GOOGLE_LOGIN + "/", ProfitMandiConstants.URL_VERIFY_OTP);
66
		//registry to check api access on basis of UserInfo
62
		//registry to check api access on basis of UserInfo
67
		registry.addInterceptor(googleLoginRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_USER_GOOGLE_LOGIN, ProfitMandiConstants.URL_USER_GOOGLE_LOGIN + "/");
-
 
68
		//registry.addInterceptor(createUserRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_USER, ProfitMandiConstants.URL_USER + "/");
-
 
69
		
-
 
70
										
-
 
71
		//registry.addInterceptor(createRetailerRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_RETAILER, ProfitMandiConstants.URL_RETAILER + "/");
-
 
72
		//registry.addInterceptor(createShopRequestInterceptor).addPathPatterns(ProfitMandiConstants.URL_SHOP, ProfitMandiConstants.URL_SHOP + "/");
-
 
73
	}
63
	}
74
	
64
	
75
	@Override
65
	@Override
76
	public void addCorsMappings(CorsRegistry registry) {
66
	public void addCorsMappings(CorsRegistry registry) {
77
		registry.addMapping("/**").allowedOrigins("*").allowedMethods("*").
67
		registry.addMapping("/**").allowedOrigins("*").allowedMethods("*").