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

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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"`
}