Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:进行插件替换时,目标插件的值支持配置默认值参数 #10037 #10039

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ class PipelineAtomReplaceCronService @Autowired constructor(
toAtomCode = toAtomCode,
toAtomVersion = toAtomVersion,
fromField = fromParamName,
fromFieldValue = fromAtomInputParamMap?.get(fromParamName),
fromFieldValue = fromAtomInputParamMap?.get(fromParamName) ?: paramReplaceInfo.toParamDefaultValue,
toField = toParamName,
toFieldDefaultValue = paramReplaceInfo.toParamValue
)
Expand Down Expand Up @@ -882,8 +882,10 @@ class PipelineAtomReplaceCronService @Autowired constructor(
} else {
fromAtomInputParamMap?.get(fromParamName)
}
if (inputParamValue != null) {
toAtomInputParamMap[toAtomInputParamName] = inputParamValue
// 被替换插件参数没有值则用配置的默认值作为替换插件参数值
val toAtomInputParamValue = inputParamValue ?: paramReplaceInfo.toParamDefaultValue
if (toAtomInputParamValue != null) {
toAtomInputParamMap[toAtomInputParamName] = toAtomInputParamValue
}
return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ data class AtomParamReplaceInfo(
val toParamName: String,
@get:Schema(title = "替换插件参数值,不传默认用被替换插件参数值替换", required = false)
val toParamValue: Any? = null,
@get:Schema(title = "替换插件默认参数值,如果没有指定替换插件参数值且被替换插件参数没有值则用该默认值作为替换插件参数值", required = false)
val toParamDefaultValue: Any? = null,
@get:Schema(title = "参数自定义转换接口url地址,接口参数结构需统一", required = false)
val paramConvertUrl: String? = null
)
Loading