apply interceptor

master
yixian 6 years ago
parent d8c907e75b
commit 0816c2a0b9

@ -4,6 +4,8 @@ import au.com.royalpay.payment.manage.permission.manager.ManagerUserInterceptor;
import au.com.royalpay.payment.tools.permission.RequestInfoInterceptor;
import au.com.royalpay.payment.tools.permission.alipay.AlipayUserInterceptor;
import au.com.royalpay.payment.tools.permission.wechat.WechatUserInterceptor;
import au.com.royalpay.payment.tools.secure.impls.ApplyFirewallCheckInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@ -25,16 +27,20 @@ public class WebConfiguration extends WebMvcConfigurerAdapter {
private AlipayUserInterceptor alipayUserInterceptor;
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(requestInfoInterceptor);
registry.addInterceptor(managerUserInterceptor);
registry.addInterceptor(wechatUserInterceptor);
registry.addInterceptor(alipayUserInterceptor);
registry.addInterceptor(applyFirewallCheckInterceptor());
super.addInterceptors(registry);
}
@Bean
public ApplyFirewallCheckInterceptor applyFirewallCheckInterceptor() {
return new ApplyFirewallCheckInterceptor();
}
}

@ -4,6 +4,7 @@ import au.com.royalpay.payment.manage.citypartner.beans.CityPartnerBean;
import au.com.royalpay.payment.manage.citypartner.core.CityPartnerRegisterService;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.http.HttpUtils;
import au.com.royalpay.payment.tools.secure.ApplyRequest;
import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@ -23,6 +24,7 @@ public class CityPartnerRegisterController {
private CityPartnerRegisterService cityPartnerRegisterService;
@RequestMapping(method = RequestMethod.POST)
@ApplyRequest
public void register(@RequestBody @Valid CityPartnerBean partner, Errors errors) {
HttpUtils.handleValidErrors(errors);
if (true) {

Loading…
Cancel
Save