Files
gen2d/backend/internal/model/asset.go
T
Gmarker689 ab2b72e746 fix: 工程类型与素材风格标签分离,支持双栏自定义标签
- 工程层面:新增 PROJECT_TYPES(2D平台跳跃/角色扮演等8种),替代原先与素材生成重复的风格标签栏
- 素材生成层面:StyleSelector 作为素材风格主配置项,新增 CustomTagsEditor 支持任务级自定义标签
- extractTags 合并工程类型、风格分类、工程自定义标签、任务自定义标签
- StyleSelector 支持 categories 参数复用
- 后端:spritesheet 拆分失败回退为单帧、GIF 上传为独立素材、AssetResponse 增加 metadata 字段
2026-05-25 19:31:36 +08:00

24 lines
812 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 {
Key string `json:"key"`
URL string `json:"url"`
Format string `json:"format"`
Metadata string `json:"metadata"` // 素材元数据(JSON: {"index":0,"type":"frame"|"preview"|"spritesheet"})
}