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.
|
|
|
package entities
|
|
|
|
|
|
|
|
import (
|
|
|
|
"gorm.io/gorm"
|
|
|
|
"sorbet/pkg/db"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Resource 资源表
|
|
|
|
type Resource struct {
|
|
|
|
ID uint `json:"id" xml:"id" gorm:"primaryKey;not null;comment:资源编号"`
|
|
|
|
CategoryID uint `json:"category_id" xml:"category_id" gorm:"not null;comment:所属分类编号"`
|
|
|
|
Title string `json:"title" xml:"title" gorm:"size:25;not null;comment:资源名称"`
|
|
|
|
Path string `json:"path" xml:"path" gorm:"comment:资源访问路径"`
|
|
|
|
Width int32 `json:"width" xml:"width" gorm:"comment:资源宽度"`
|
|
|
|
Height int32 `json:"height" xml:"height" gorm:"comment:资源高度"`
|
|
|
|
Duration int32 `json:"duration" xml:"duration" gorm:"comment:播放时长(视频、gif动画)"`
|
|
|
|
MimeType string `json:"mime_type" xml:"mime_type" gorm:"comment:资源媒体类型"`
|
|
|
|
Extension string `json:"extension" xml:"extension" gorm:"comment:资源文件扩展名"`
|
|
|
|
Size int64 `json:"size" xml:"size" 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:删除时间"`
|
|
|
|
}
|