2026-06-01 15:31:25 +08:00
|
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
|
|
import "platform/web/core"
|
|
|
|
|
|
|
|
|
|
|
|
// Article 文章表
|
|
|
|
|
|
type Article struct {
|
|
|
|
|
|
core.Model
|
|
|
|
|
|
GroupID int32 `json:"group_id" gorm:"column:group_id"` // 分组ID
|
2026-07-21 15:30:33 +08:00
|
|
|
|
Code *string `json:"code,omitempty" gorm:"column:code"` // 文章编码,用于固定引用链接
|
2026-06-01 15:31:25 +08:00
|
|
|
|
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 // 正常
|
|
|
|
|
|
)
|