对算法输入参数非法情况进行过滤

This commit is contained in:
zhengxuan.zhang
2026-04-20 11:13:40 +08:00
parent 1c6c2ac675
commit e0a7af6226
5 changed files with 208 additions and 24 deletions
@@ -46,6 +46,19 @@ namespace XplorePlane.Services
cancellationToken.ThrowIfCancellationRequested();
var node = enabledNodes[step];
var invalidParameters = node.Parameters
.Where(p => !p.IsValueValid)
.Select(p => p.DisplayName)
.ToList();
if (invalidParameters.Count > 0)
{
throw new PipelineExecutionException(
$"算子 '{node.DisplayName}' 存在无效参数:{string.Join("", invalidParameters)}",
node.Order,
node.OperatorKey);
}
var parameters = node.Parameters
.Where(p => p.IsValueValid)
.ToDictionary(p => p.Name, p => p.Value);
@@ -98,4 +111,4 @@ namespace XplorePlane.Services
return scaled;
}
}
}
}