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"` Content string `json:"content" gorm:"column:content;type:text;comment:文字内容(type=text时使用)"` Type string `json:"type" gorm:"column:type;type:varchar(32);not null;index:idx_type;comment:类型: image/video/audio/document/text"` 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"` Sort int `json:"sort" gorm:"column:sort;type:int;default:0;comment:排序"` Status int `json:"status" gorm:"column:status;type:tinyint;default:1;comment:状态:1启用,0禁用"` 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:分组名称"` Code string `json:"code" gorm:"column:code;type:varchar(64);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:排序"` Status int `json:"status" gorm:"column:status;type:tinyint;default:1;comment:状态:1启用,0禁用"` Description string `json:"description" gorm:"column:description;type:varchar(255);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{} }