实现文章与分组管理
This commit is contained in:
23
web/models/article.go
Normal file
23
web/models/article.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package models
|
||||
|
||||
import "platform/web/core"
|
||||
|
||||
// Article 文章表
|
||||
type Article struct {
|
||||
core.Model
|
||||
GroupID int32 `json:"group_id" gorm:"column:group_id"` // 分组ID
|
||||
Title string `json:"title" gorm:"column:title"` // 文章标题
|
||||
Content *string `json:"content,omitempty" gorm:"column:content"` // 文章内容
|
||||
Sort int32 `json:"sort" gorm:"column:sort"` // 文章排序
|
||||
Status ArticleStatus `json:"status" gorm:"column:status"` // 文章状态:0-禁用,1-正常
|
||||
|
||||
Group *ArticleGroup `json:"group,omitempty" gorm:"foreignKey:GroupID"` // 分组
|
||||
}
|
||||
|
||||
// ArticleStatus 文章状态
|
||||
type ArticleStatus int
|
||||
|
||||
const (
|
||||
ArticleStatusDisabled ArticleStatus = 0 // 禁用
|
||||
ArticleStatusEnabled ArticleStatus = 1 // 正常
|
||||
)
|
||||
Reference in New Issue
Block a user