优化结构

This commit is contained in:
Yvan
2026-08-22 12:13:16 +08:00
parent d987244d0e
commit b27a66e9d3
200 changed files with 1794 additions and 1715 deletions
+5 -5
View File
@@ -5,9 +5,9 @@ import (
"encoding/json"
"errors"
"fmt"
"kra/internal/biz/system"
"strings"
"kra/internal/biz"
"kra/internal/integration/mq"
"kra/internal/integration/runtimeconfig"
websocketintegration "kra/internal/integration/websocket"
@@ -23,7 +23,7 @@ func NewConnectivityTester(store *runtimeconfig.Store) *ConnectivityTester {
return &ConnectivityTester{store: store}
}
func (t *ConnectivityTester) TestIntegration(ctx context.Context, config *biz.IntegrationConfig) error {
func (t *ConnectivityTester) TestIntegration(ctx context.Context, config *system.IntegrationConfig) error {
if config == nil {
return errors.New("集成配置请求为空")
}
@@ -39,9 +39,9 @@ func (t *ConnectivityTester) TestIntegration(ctx context.Context, config *biz.In
return fmt.Errorf("编码集成配置失败: %w", err)
}
switch strings.ToLower(strings.TrimSpace(config.Kind)) {
case biz.IntegrationKindMQ:
case system.IntegrationKindMQ:
return mq.TestConfig(ctx, config.Provider, raw)
case biz.IntegrationKindWebSocket:
case system.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 *biz.In
}
func (t *ConnectivityTester) restoreMaskedSecrets(kind, provider string, values map[string]any) error {
definition, ok := biz.IntegrationDefinition(kind, provider)
definition, ok := system.IntegrationDefinition(kind, provider)
if !ok {
return fmt.Errorf("不支持的集成 %s/%s", kind, provider)
}