refactor: Update models to include sender email, name, and mail recipients for notification requests

This commit is contained in:
Marvin Zhang
2024-07-27 16:06:26 +08:00
parent 8d5a0b0c0e
commit e8bdfd228d
3 changed files with 20 additions and 44 deletions

View File

@@ -9,11 +9,11 @@ type NotificationRequestV2 struct {
Error string `json:"error,omitempty" bson:"error,omitempty"`
Title string `json:"title" bson:"title"`
Content string `json:"content" bson:"content"`
SenderEmail string `json:"sender_email" bson:"sender_email"`
SenderName string `json:"sender_name" bson:"sender_name"`
MailTo string `json:"mail_to" bson:"mail_to"`
MailCc string `json:"mail_cc" bson:"mail_cc"`
MailBcc string `json:"mail_bcc" bson:"mail_bcc"`
SenderEmail string `json:"sender_email,omitempty" bson:"sender_email,omitempty"`
SenderName string `json:"sender_name,omitempty" bson:"sender_name,omitempty"`
MailTo []string `json:"mail_to,omitempty" bson:"mail_to,omitempty"`
MailCc []string `json:"mail_cc,omitempty" bson:"mail_cc,omitempty"`
MailBcc []string `json:"mail_bcc,omitempty" bson:"mail_bcc,omitempty"`
SettingId primitive.ObjectID `json:"setting_id" bson:"setting_id"`
ChannelId primitive.ObjectID `json:"channel_id" bson:"channel_id"`
Setting *NotificationSettingV2 `json:"setting,omitempty" bson:"-"`

View File

@@ -21,11 +21,11 @@ type NotificationSettingV2 struct {
TriggerTarget string `json:"trigger_target" bson:"trigger_target"`
Trigger string `json:"trigger" bson:"trigger"`
SenderEmail string `json:"sender_email,omitempty" bson:"sender_email,omitempty"`
SenderName string `json:"sender_name,omitempty" bson:"sender_name,omitempty"`
MailTo string `json:"mail_to" bson:"mail_to,omitempty"`
MailCc string `json:"mail_cc,omitempty" bson:"mail_cc,omitempty"`
MailBcc string `json:"mail_bcc,omitempty" bson:"mail_bcc,omitempty"`
SenderEmail string `json:"sender_email,omitempty" bson:"sender_email,omitempty"`
SenderName string `json:"sender_name,omitempty" bson:"sender_name,omitempty"`
MailTo []string `json:"mail_to,omitempty" bson:"mail_to,omitempty"`
MailCc []string `json:"mail_cc,omitempty" bson:"mail_cc,omitempty"`
MailBcc []string `json:"mail_bcc,omitempty" bson:"mail_bcc,omitempty"`
ChannelIds []primitive.ObjectID `json:"channel_ids,omitempty" bson:"channel_ids,omitempty"`
Channels []NotificationChannelV2 `json:"channels,omitempty" bson:"-"`