Support firebase FCM as a notify subscriber

This commit is contained in:
2024-02-07 23:40:43 +08:00
parent 775a3b8868
commit 3264c85b39
8 changed files with 262 additions and 19 deletions

View File

@ -1,16 +1,26 @@
package models
import "time"
import (
"gorm.io/datatypes"
"time"
)
type Notification struct {
BaseModel
Subject string `json:"subject"`
Content string `json:"content"`
IsImportant bool `json:"is_important"`
ReadAt *time.Time `json:"read_at"`
SenderID *uint `json:"sender_id"`
RecipientID uint `json:"recipient_id"`
Subject string `json:"subject"`
Content string `json:"content"`
Links datatypes.JSONSlice[NotificationLink] `json:"links"`
IsImportant bool `json:"is_important"`
ReadAt *time.Time `json:"read_at"`
SenderID *uint `json:"sender_id"`
RecipientID uint `json:"recipient_id"`
}
// NotificationLink Used to embed into notify and render actions
type NotificationLink struct {
Label string `json:"label"`
Url string `json:"url"`
}
const (