24 lines
809 B
Go
24 lines
809 B
Go
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 // 正常
|
||
)
|