🗑️ Remove the old article
This commit is contained in:
@ -1,31 +0,0 @@
|
||||
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"`
|
||||
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"`
|
||||
|
||||
Metric PostMetric `json:"metric" gorm:"-"`
|
||||
}
|
@ -3,19 +3,17 @@ package models
|
||||
type Tag struct {
|
||||
BaseModel
|
||||
|
||||
Alias string `json:"alias" gorm:"uniqueIndex" validate:"lowercase"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Posts []Post `json:"posts" gorm:"many2many:post_tags"`
|
||||
Articles []Article `json:"articles" gorm:"many2many:article_tags"`
|
||||
Alias string `json:"alias" gorm:"uniqueIndex" validate:"lowercase"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Posts []Post `json:"posts" gorm:"many2many:post_tags"`
|
||||
}
|
||||
|
||||
type Category struct {
|
||||
BaseModel
|
||||
|
||||
Alias string `json:"alias" gorm:"uniqueIndex" validate:"lowercase,alphanum"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Posts []Post `json:"posts" gorm:"many2many:post_categories"`
|
||||
Articles []Article `json:"articles" gorm:"many2many:article_categories"`
|
||||
Alias string `json:"alias" gorm:"uniqueIndex" validate:"lowercase,alphanum"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Posts []Post `json:"posts" gorm:"many2many:post_categories"`
|
||||
}
|
||||
|
@ -21,6 +21,5 @@ type Reaction struct {
|
||||
Attitude ReactionAttitude `json:"attitude"`
|
||||
|
||||
PostID *uint `json:"post_id"`
|
||||
ArticleID *uint `json:"article_id"`
|
||||
AccountID uint `json:"account_id"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user