Interactive/pkg/internal/models/articles.go

32 lines
1007 B
Go
Raw Normal View History

package models
import (
"time"
"gorm.io/datatypes"
)
type Article struct {
BaseModel
Alias string `json:"alias" gorm:"uniqueIndex"`
Title string `json:"title"`
Description string `json:"description"`
Content string `json:"content"`
2024-07-13 15:16:40 +00:00
Language string `json:"language"`
Tags []Tag `json:"tags" gorm:"many2many:article_tags"`
Categories []Category `json:"categories" gorm:"many2many:article_categories"`
Reactions []Reaction `json:"reactions"`
Attachments datatypes.JSONSlice[uint] `json:"attachments"`
RealmID *uint `json:"realm_id"`
Realm *Realm `json:"realm"`
IsDraft bool `json:"is_draft"`
PublishedAt *time.Time `json:"published_at"`
AuthorID uint `json:"author_id"`
Author Account `json:"author"`
2024-07-13 15:16:40 +00:00
Metric PostMetric `json:"metric" gorm:"-"`
}