You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
794 B

2 years ago
package tables
import (
"time"
)
const (
ContentStatusPublish = 1 + iota
ContentStatusDraft
)
const (
ContentPromoteLatest = 1 << iota
ContentPromoteIndexImage
)
type Content struct {
Model
Subject string `gorm:"" json:"subject"`
Content string `gorm:"" json:"content"`
Cover string `gorm:"" json:"cover"`
Referer string `gorm:"" json:"referer"`
PublishTime time.Time `gorm:"" json:"publish_time"`
Status int `gorm:"" json:"status"` // 1 草稿2 发布
UserID uint `gorm:"index" json:"user_id"`
CategoryID uint `gorm:"index" json:"categoryId"`
Sorter int `gorm:"index" json:"sorter"`
Promotes int `gorm:"" json:"promotes"`
User User `json:"user"`
Category Category `json:"category"`
}