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.
24 lines
1.4 KiB
24 lines
1.4 KiB
package entities
|
|
|
|
import (
|
|
"gorm.io/gorm"
|
|
"sorbet/pkg/db"
|
|
"time"
|
|
)
|
|
|
|
// FeatureCategory 栏目分类表
|
|
type FeatureCategory struct {
|
|
ID uint `json:"id" xml:"id" gorm:"primaryKey;not null;comment:栏目分类编号"`
|
|
PID *uint `json:"pid" xml:"pid" gorm:"column:pid;comment:上级分类编号"`
|
|
FeatureID uint `json:"feature_id" xml:"feature_id" gorm:"index:,unique,composite:idx_title_with_feature;comment:所属栏目编号"`
|
|
Title string `json:"title" xml:"title" gorm:"size:25;not null;index:,unique,composite:idx_title_with_feature;comment:栏目分类标题"`
|
|
Description string `json:"description" xml:"description" gorm:"size:250;comment:栏目分类描述"`
|
|
Sort int32 `json:"sort" xml:"sort" gorm:"default:0;comment:排序"`
|
|
Status bool `json:"status" xml:"status" gorm:"comment:栏目分类功能"`
|
|
Version db.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:删除时间"`
|
|
|
|
Children []*FeatureCategory `json:"children" xml:"children" gorm:"foreignKey:PID"`
|
|
}
|
|
|