2026-05-25 17:54:18 +08:00
|
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
|
|
|
|
// Asset 素材数据模型,对应数据库表。
|
|
|
|
|
|
type Asset struct {
|
|
|
|
|
|
ID uint `gorm:"primaryKey"`
|
|
|
|
|
|
TaskID uint `gorm:"index;not null"`
|
|
|
|
|
|
Key string `gorm:"size:255;not null"` // 七牛云对象键
|
|
|
|
|
|
URL string `gorm:"size:255;not null"` // CDN访问URL
|
|
|
|
|
|
Format string `gorm:"size:20;not null"` // 文件格式
|
|
|
|
|
|
Metadata string `gorm:"type:text"` // 元数据(JSON格式)
|
|
|
|
|
|
CreatedAt time.Time
|
|
|
|
|
|
UpdatedAt time.Time
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// AssetResponse 素材响应。
|
|
|
|
|
|
type AssetResponse struct {
|
2026-05-25 19:31:36 +08:00
|
|
|
|
Key string `json:"key"`
|
|
|
|
|
|
URL string `json:"url"`
|
|
|
|
|
|
Format string `json:"format"`
|
|
|
|
|
|
Metadata string `json:"metadata"` // 素材元数据(JSON: {"index":0,"type":"frame"|"preview"|"spritesheet"})
|
2026-05-25 17:54:18 +08:00
|
|
|
|
}
|