feat(publish): 正式表加发布状态与公开只读视图
This commit is contained in:
17
internal/model/content_status.go
Normal file
17
internal/model/content_status.go
Normal file
@ -0,0 +1,17 @@
|
||||
package model
|
||||
|
||||
// 内容发布状态(单表发布模型)。
|
||||
//
|
||||
// 历史上「爬虫草稿」与「正式记录」是两张表,审核 = 从草稿晋升到正式表。
|
||||
// 现在合并为一张表,审核态由本字段承载:
|
||||
// - pending:刚入库,等待审核;公开视图不可见
|
||||
// - published:已通过,对外可见
|
||||
// - rejected:已驳回,留在库中备查;公开视图不可见
|
||||
//
|
||||
// 新增记录默认 pending(见各自模型的 gorm default),漏赋值的结果是「不可见」,
|
||||
// 即 fail-closed,而不是意外对外发布。
|
||||
const (
|
||||
StatusPending = "pending"
|
||||
StatusPublished = "published"
|
||||
StatusRejected = "rejected"
|
||||
)
|
||||
Reference in New Issue
Block a user