2024-07-19 08:03:35 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
// Post model
|
|
|
|
type Post struct {
|
2024-08-09 19:37:54 +00:00
|
|
|
BaseModel[PostID]
|
2024-07-19 08:03:35 +00:00
|
|
|
Rating Rating `json:"rating" gorm:"type:enum('safe','questionable','explicit')"`
|
2024-08-13 08:54:21 +00:00
|
|
|
Tags []Tag `json:"tags,omitempty" gorm:"many2many:post_tags;"`
|
2024-08-09 20:43:58 +00:00
|
|
|
Favorites []UserFavorite `json:"-" gorm:"foreignKey:PostID"`
|
2024-07-19 08:03:35 +00:00
|
|
|
References []PostReference `json:"references" gorm:"foreignKey:PostID"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (Post) TableName() string {
|
|
|
|
return "Post"
|
|
|
|
}
|