2024-02-01 07:08:40 +00:00
|
|
|
package models
|
|
|
|
|
2024-02-07 15:40:43 +00:00
|
|
|
import (
|
2024-06-02 12:15:04 +00:00
|
|
|
"gorm.io/datatypes"
|
2024-02-07 15:40:43 +00:00
|
|
|
)
|
2024-02-01 07:08:40 +00:00
|
|
|
|
|
|
|
type Notification struct {
|
|
|
|
BaseModel
|
|
|
|
|
2024-07-15 16:05:09 +00:00
|
|
|
Topic string `json:"topic"`
|
|
|
|
Title string `json:"title"`
|
|
|
|
Subtitle *string `json:"subtitle"`
|
|
|
|
Body string `json:"body"`
|
|
|
|
Metadata datatypes.JSONMap `json:"metadata"`
|
2024-07-19 15:27:58 +00:00
|
|
|
Avatar *string `json:"avatar"`
|
|
|
|
Picture *string `json:"picture"`
|
2024-07-15 16:05:09 +00:00
|
|
|
AccountID uint `json:"account_id"`
|
|
|
|
SenderID *uint `json:"sender_id"`
|
2024-07-15 16:02:28 +00:00
|
|
|
|
|
|
|
IsRealtime bool `json:"is_realtime" gorm:"-"`
|
|
|
|
IsForcePush bool `json:"is_force_push" gorm:"-"`
|
2024-02-07 15:40:43 +00:00
|
|
|
}
|
|
|
|
|
2024-02-07 15:15:16 +00:00
|
|
|
const (
|
2024-06-06 14:48:43 +00:00
|
|
|
NotifySubscriberFirebase = "firebase"
|
2024-06-06 16:15:43 +00:00
|
|
|
NotifySubscriberAPNs = "apple"
|
2024-02-07 15:15:16 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type NotificationSubscriber struct {
|
|
|
|
BaseModel
|
|
|
|
|
2024-05-07 13:00:20 +00:00
|
|
|
UserAgent string `json:"user_agent"`
|
|
|
|
Provider string `json:"provider"`
|
|
|
|
DeviceID string `json:"device_id" gorm:"uniqueIndex"`
|
|
|
|
DeviceToken string `json:"device_token"`
|
|
|
|
AccountID uint `json:"account_id"`
|
2024-02-07 15:15:16 +00:00
|
|
|
}
|