refactor: Update NotificationChannelV2 model to simplify mail and IM settings

This commit is contained in:
Marvin Zhang
2024-07-18 17:41:54 +08:00
parent 821383a677
commit 029c5d1448
4 changed files with 11 additions and 21 deletions

View File

@@ -7,13 +7,9 @@ type NotificationChannelV2 struct {
Name string `json:"name" bson:"name"`
Description string `json:"description" bson:"description"`
Provider string `json:"provider" bson:"provider"`
MailSettings struct {
SMTPServer string `json:"smtp_server" bson:"smtp_server"`
SMTPPort string `json:"smtp_port" bson:"smtp_port"`
SMTPUser string `json:"smtp_from_email_address" bson:"smtp_from_email_address"`
SMTPPassword string `json:"smtp_from_email_password" bson:"smtp_from_email_password"`
} `json:"mail_settings,omitempty" bson:"mail_settings,omitempty"`
IMSettings struct {
Webhook string `json:"webhook" bson:"webhook"`
} `json:"im_settings,omitempty" bson:"im_settings,omitempty"`
SMTPServer string `json:"smtp_server" bson:"smtp_server"`
SMTPPort string `json:"smtp_port" bson:"smtp_port"`
SMTPUsername string `json:"smtp_username" bson:"smtp_username"`
SMTPPassword string `json:"smtp_password" bson:"smtp_password"`
WebhookUrl string `json:"webhook_url" bson:"webhook_url"`
}