feat: 添加媒体资产变体和来源ID字段,支持预览产品与主资产的关联

This commit is contained in:
2025-12-22 17:56:08 +08:00
parent 335a546aab
commit ad82de3939
10 changed files with 222 additions and 1 deletions

View File

@@ -7,6 +7,14 @@ type AdminMediaAssetUploadInitForm struct {
// Type is the media asset type (video/audio/image).
// Used to decide processing pipeline and validation rules; required.
Type string `json:"type,omitempty"`
// Variant indicates whether this asset is a main or preview product.
// Allowed: main/preview; default is main.
Variant string `json:"variant,omitempty"`
// SourceAssetID links a preview product to its main asset; only meaningful when variant=preview.
SourceAssetID *int64 `json:"source_asset_id,omitempty"`
// ContentType is the MIME type reported by the client (e.g. video/mp4); optional.
// Server should not fully trust it, but can use it as a hint for validation/logging.
ContentType string `json:"content_type,omitempty"`