| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- package daytask
- // DtMaterial 素材表
- type DtMaterial struct {
- Id int64 `json:"id" gorm:"column:id;type:bigint;primarykey;comment:素材ID"`
- Name string `json:"name" gorm:"column:name;type:varchar(128);not null;comment:文件名"`
- Path string `json:"path" gorm:"column:path;type:varchar(512);not null;comment:文件路径"`
- Url string `json:"url" gorm:"column:url;type:varchar(512);not null;comment:访问URL"`
- Type string `json:"type" gorm:"column:type;type:varchar(32);not null;index:idx_type;comment:类型: image/video/audio/document"`
- MimeType string `json:"mimeType" gorm:"column:mime_type;type:varchar(128);comment:MIME类型"`
- Size int64 `json:"size" gorm:"column:size;type:bigint;default:0;comment:文件大小(字节)"`
- Width int `json:"width" gorm:"column:width;type:int;default:0;comment:宽度(图片/视频)"`
- Height int `json:"height" gorm:"column:height;type:int;default:0;comment:高度(图片/视频)"`
- Duration int `json:"duration" gorm:"column:duration;type:int;default:0;comment:时长(视频/音频,秒)"`
- Storage string `json:"storage" gorm:"column:storage;type:varchar(32);default:local;comment:存储: local/oss/cos"`
- GroupId int64 `json:"groupId" gorm:"column:group_id;type:bigint;default:0;index:idx_group_id;comment:分组ID"`
- AdminId int64 `json:"adminId" gorm:"column:admin_id;type:bigint;default:0;comment:上传管理员ID"`
- CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;autoCreateTime;comment:创建时间"`
- }
- func (*DtMaterial) TableName() string {
- return "dt_material"
- }
- func NewDtMaterial() *DtMaterial {
- return &DtMaterial{}
- }
- // DtMaterialGroup 素材分组表
- type DtMaterialGroup struct {
- Id int64 `json:"id" gorm:"column:id;type:bigint;primarykey;comment:分组ID"`
- Name string `json:"name" gorm:"column:name;type:varchar(64);not null;comment:分组名称"`
- ParentId int64 `json:"parentId" gorm:"column:parent_id;type:bigint;default:0;index:idx_parent_id;comment:父级ID"`
- Sort int `json:"sort" gorm:"column:sort;type:int;default:0;comment:排序"`
- CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;autoCreateTime;comment:创建时间"`
- UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at;type:bigint;autoUpdateTime;comment:更新时间"`
- }
- func (*DtMaterialGroup) TableName() string {
- return "dt_material_group"
- }
- func NewDtMaterialGroup() *DtMaterialGroup {
- return &DtMaterialGroup{}
- }
|