refactor: notifications

This commit is contained in:
yusing
2025-05-02 05:51:15 +08:00
parent 28d9a72908
commit 69ee8495d8
11 changed files with 202 additions and 104 deletions

View File

@@ -46,11 +46,5 @@ func (cfg *NotificationConfig) UnmarshalMap(m map[string]any) (err gperr.Error)
Withf("expect %s or %s", ProviderWebhook, ProviderGotify)
}
// unmarshal provider config
if err := utils.MapUnmarshalValidate(m, cfg.Provider); err != nil {
return err
}
// validate provider
return cfg.Provider.Validate()
return utils.MapUnmarshalValidate(m, cfg.Provider)
}