验证提示优化

1.x
tanghc 5 years ago
parent 7817d8a39e
commit f7bcb7db9d
  1. 8
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/validate/ApiValidator.java

@ -93,6 +93,14 @@ public class ApiValidator implements Validator {
* @param param 接口参数 * @param param 接口参数
*/ */
protected void checkEnable(ApiParam param) { protected void checkEnable(ApiParam param) {
String name = param.fetchName();
if (name == null) {
throw ErrorEnum.ISV_MISSING_METHOD.getErrorMeta().getException();
}
String version = param.fetchVersion();
if (version == null) {
throw ErrorEnum.ISV_MISSING_VERSION.getErrorMeta().getException();
}
String routeId = param.fetchNameVersion(); String routeId = param.fetchNameVersion();
// 检查路由是否存在 // 检查路由是否存在
RouteRepositoryContext.checkExist(routeId, ErrorEnum.ISV_INVALID_METHOD); RouteRepositoryContext.checkExist(routeId, ErrorEnum.ISV_INVALID_METHOD);

Loading…
Cancel
Save