|
|
@ -37,7 +37,10 @@ public class ValidateService { |
|
|
|
RequestContext currentContext = RequestContext.getCurrentContext(); |
|
|
|
RequestContext currentContext = RequestContext.getCurrentContext(); |
|
|
|
currentContext.setRequest(RequestUtil.wrapRequest(request)); |
|
|
|
currentContext.setRequest(RequestUtil.wrapRequest(request)); |
|
|
|
currentContext.setResponse(response); |
|
|
|
currentContext.setResponse(response); |
|
|
|
doValidate(currentContext, callback); |
|
|
|
// 解析参数
|
|
|
|
|
|
|
|
ApiParam param = paramBuilder.build(currentContext); |
|
|
|
|
|
|
|
ZuulContext.setApiParam(param); |
|
|
|
|
|
|
|
doValidate(currentContext, param, callback); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -45,10 +48,7 @@ public class ValidateService { |
|
|
|
* |
|
|
|
* |
|
|
|
* @param currentContext currentContext |
|
|
|
* @param currentContext currentContext |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void doValidate(RequestContext currentContext, ValidateCallback callback) { |
|
|
|
private void doValidate(RequestContext currentContext, ApiParam param, ValidateCallback callback) { |
|
|
|
// 解析参数
|
|
|
|
|
|
|
|
ApiParam param = paramBuilder.build(currentContext); |
|
|
|
|
|
|
|
ZuulContext.setApiParam(param); |
|
|
|
|
|
|
|
Exception error = null; |
|
|
|
Exception error = null; |
|
|
|
// 验证操作,这里有负责验证签名参数
|
|
|
|
// 验证操作,这里有负责验证签名参数
|
|
|
|
try { |
|
|
|
try { |
|
|
|