Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Ce dépôt a été archivé le 2022-05-07. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
nyaa-pantsu/models/notification.go

27 lignes
676 o
Go
Brut Vue normale Historique

package models
2017-05-20 20:53:05 +02:00
import (
"github.com/NyaaPantsu/nyaa/config"
)
// Notification model
2017-05-20 20:53:05 +02:00
type Notification struct {
2017-05-24 09:11:13 +02:00
ID uint
Content string
Read bool
2017-05-20 20:53:05 +02:00
Identifier string
URL string
2017-05-24 09:11:13 +02:00
UserID uint
// User *User `gorm:"AssociationForeignKey:UserID;ForeignKey:user_id"` // Don't think that we need it here
2017-05-20 20:53:05 +02:00
}
// NewNotification : Create a new notification
2017-05-21 00:02:57 +02:00
func NewNotification(identifier string, c string, url string) Notification {
return Notification{Identifier: identifier, Content: c, URL: url}
2017-05-20 20:53:05 +02:00
}
// TableName : Return the name of notification table
2017-05-20 20:53:05 +02:00
func (n *Notification) TableName() string {
return config.Conf.Models.NotificationsTableName
2017-05-20 20:53:05 +02:00
}