优化结构
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"kra/internal/biz/system"
|
||||
integrationbiz "kra/internal/biz/integration"
|
||||
"strings"
|
||||
|
||||
"kra/internal/integration/mq"
|
||||
@@ -23,7 +23,7 @@ func NewConnectivityTester(store *runtimeconfig.Store) *ConnectivityTester {
|
||||
return &ConnectivityTester{store: store}
|
||||
}
|
||||
|
||||
func (t *ConnectivityTester) TestIntegration(ctx context.Context, config *system.IntegrationConfig) error {
|
||||
func (t *ConnectivityTester) TestIntegration(ctx context.Context, config *integrationbiz.IntegrationConfig) error {
|
||||
if config == nil {
|
||||
return errors.New("集成配置请求为空")
|
||||
}
|
||||
@@ -39,9 +39,9 @@ func (t *ConnectivityTester) TestIntegration(ctx context.Context, config *system
|
||||
return fmt.Errorf("编码集成配置失败: %w", err)
|
||||
}
|
||||
switch strings.ToLower(strings.TrimSpace(config.Kind)) {
|
||||
case system.IntegrationKindMQ:
|
||||
case integrationbiz.IntegrationKindMQ:
|
||||
return mq.TestConfig(ctx, config.Provider, raw)
|
||||
case system.IntegrationKindWebSocket:
|
||||
case integrationbiz.IntegrationKindWebSocket:
|
||||
if strings.ToLower(strings.TrimSpace(config.Provider)) != websocketintegration.ProviderMelody {
|
||||
return fmt.Errorf("不支持的 WebSocket provider %q", config.Provider)
|
||||
}
|
||||
@@ -52,7 +52,7 @@ func (t *ConnectivityTester) TestIntegration(ctx context.Context, config *system
|
||||
}
|
||||
|
||||
func (t *ConnectivityTester) restoreMaskedSecrets(kind, provider string, values map[string]any) error {
|
||||
definition, ok := system.IntegrationDefinition(kind, provider)
|
||||
definition, ok := integrationbiz.IntegrationDefinition(kind, provider)
|
||||
if !ok {
|
||||
return fmt.Errorf("不支持的集成 %s/%s", kind, provider)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user