refactor: clean code

This commit is contained in:
Fu Diwei
2025-04-24 21:04:55 +08:00
parent 7478dd7f47
commit 794695c313
25 changed files with 616 additions and 613 deletions

View File

@@ -31,7 +31,7 @@ func NewWithWorkflowNode(config NotifierWithWorkflowNodeConfig) (Notifier, error
nodeConfig := config.Node.GetConfigForNotify()
options := &notifierProviderOptions{
Provider: domain.NotifyProviderType(nodeConfig.Provider),
Provider: domain.NotificationProviderType(nodeConfig.Provider),
ProviderAccessConfig: make(map[string]any),
ProviderNotifyConfig: nodeConfig.ProviderConfig,
}

View File

@@ -10,7 +10,7 @@ import (
)
type notifierProviderOptions struct {
Provider domain.NotifyProviderType
Provider domain.NotificationProviderType
ProviderAccessConfig map[string]any
ProviderNotifyConfig map[string]any
}
@@ -21,7 +21,7 @@ func createNotifierProvider(options *notifierProviderOptions) (notifier.Notifier
NOTICE: If you add new constant, please keep ASCII order.
*/
switch options.Provider {
case domain.NotifyProviderTypeWebhook:
case domain.NotificationProviderTypeWebhook:
return pWebhook.NewNotifier(&pWebhook.NotifierConfig{
Url: maputil.GetString(options.ProviderAccessConfig, "url"),
AllowInsecureConnections: maputil.GetBool(options.ProviderAccessConfig, "allowInsecureConnections"),