优化结构
This commit is contained in:
@@ -244,9 +244,6 @@ func validateCommunicationIntegrationConfig(kind, provider string, values map[st
|
||||
}
|
||||
for _, field := range definition.Fields {
|
||||
value := integrationText(values, field.Key)
|
||||
if provider == bizpayment.PaymentDouyin && field.Key == "platform_serial_no" {
|
||||
value = integrationFirst(values, "platform_serial_no", "platform_cert_serial")
|
||||
}
|
||||
if field.Required && value == "" {
|
||||
return fmt.Errorf("%s 缺少配置字段 %s", provider, field.Key)
|
||||
}
|
||||
@@ -316,7 +313,11 @@ func validatePaymentIntegrationConfig(provider string, values map[string]any) er
|
||||
return errors.New("不支持的支付渠道")
|
||||
}
|
||||
for _, field := range definition.Fields {
|
||||
if field.Required && integrationText(values, field.Key) == "" {
|
||||
value := integrationText(values, field.Key)
|
||||
if provider == bizpayment.PaymentDouyin && field.Key == "platform_serial_no" {
|
||||
value = integrationFirst(values, "platform_serial_no", "platform_cert_serial")
|
||||
}
|
||||
if field.Required && value == "" {
|
||||
return fmt.Errorf("%s 缺少配置字段 %s", provider, field.Key)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user