Files
platform/web/models/article.go
2026-06-01 15:46:43 +08:00

24 lines
809 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 // 正常
)