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.
29 lines
2.0 KiB
29 lines
2.0 KiB
package entities
|
|
|
|
import (
|
|
"gorm.io/gorm"
|
|
"gorm.io/plugin/optimisticlock"
|
|
"time"
|
|
)
|
|
|
|
// FeatureContentDetail 内容详情表
|
|
type FeatureContentDetail struct {
|
|
ID uint `json:"id" xml:"id" gorm:"primaryKey;not null;comment:内容详情编号"`
|
|
FeatureID uint `json:"feature_id" xml:"feature_id" gorm:"comment:所属栏目编号"`
|
|
ChapterID *uint `json:"chapter_id" xml:"chapter_id" gorm:"comment:所属章回编号"`
|
|
ContentID uint `json:"content_id" xml:"content_id" gorm:"comment:所属内容编号"`
|
|
Type string `json:"type" xml:"type" gorm:"not null;comment:内容类型"`
|
|
Title string `json:"title" xml:"title" gorm:"size:25;not null;comment:标题"`
|
|
Intro string `json:"intro" xml:"intro" gorm:"size:250;comment:简介"`
|
|
PosterUrl string `json:"poster_url" xml:"poster_url" gorm:"size:250;comment:封面链接"`
|
|
VideoUrl string `json:"video_url" xml:"video_url" gorm:"size:250;comment:视频描述"`
|
|
Text string `json:"text" xml:"text" gorm:"type:longtext;comment:具体内容"`
|
|
Attributes map[string]any `json:"attributes" xml:"attributes" gorm:"serializer:json;type:text;comment:相关属性值"`
|
|
Version optimisticlock.Version `json:"-" xml:"-" gorm:"comment:乐观锁"`
|
|
CreatedAt time.Time `json:"create_time" xml:"create_time" gorm:"<-:false;comment:创建时间"`
|
|
UpdatedAt time.Time `json:"update_time" xml:"update_time" gorm:"<-:false;comment:更新时间"`
|
|
DeletedAt gorm.DeletedAt `json:"-" xml:"-" gorm:"comment:删除时间"`
|
|
|
|
Chapter *FeatureContentChapter `json:"chapter" xml:"chapter" gorm:"foreignKey:ChapterID"`
|
|
Content *FeatureContent `json:"content" xml:"content" gorm:"foreignKey:ContentID"`
|
|
}
|
|
|