Commit be465b5c by inrgihc

测试问题修复

parent 63f98658
......@@ -21,7 +21,7 @@ public class ItemParam extends BaseParam {
@ApiModelProperty("Object类型的子元素")
private List<BaseParam> children;
public boolean valid() {
public void checkValid() {
if (StringUtils.isBlank(getName())) {
throw new CommonException(ResponseErrorCode.ERROR_INTERNAL_ERROR, "parameter name must is not blank");
}
......@@ -32,12 +32,12 @@ public class ItemParam extends BaseParam {
throw new CommonException(ResponseErrorCode.ERROR_INTERNAL_ERROR, "parameter name must is not blank");
}
}
return true;
} else {
throw new CommonException(ResponseErrorCode.ERROR_INVALID_ARGUMENT,
"Object Input param '" + getName() + "' must have child parameter.");
}
} else {
children = Collections.emptyList();
}
return false;
}
}
......@@ -333,10 +333,7 @@ public class ApiAssignmentService {
}
for (ItemParam itemParam : request.getParams()) {
if (!itemParam.valid()) {
throw new CommonException(ResponseErrorCode.ERROR_INVALID_ARGUMENT,
"Object Input param must have child parameter.");
}
itemParam.checkValid();
}
}
if (null == request.getDatasourceId() || null == dataSourceDao.getById(request.getDatasourceId())) {
......@@ -409,10 +406,7 @@ public class ApiAssignmentService {
}
}
for (ItemParam itemParam : request.getParams()) {
if (!itemParam.valid()) {
throw new CommonException(ResponseErrorCode.ERROR_INVALID_ARGUMENT,
"Object Input param must have child parameter.");
}
itemParam.checkValid();
}
}
if (null == request.getDatasourceId() || null == dataSourceDao.getById(request.getDatasourceId())) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment