06ec0ee202
后端: - 新增 BGM 数据库模型、Schema、CRUD、API 路由 - BgmMusic 增加 url 字段存储七牛云地址 - Alembic 迁移: 创建 BGM 表 + 添加 url 字段 - import_bgm.py 导入时自动上传七牛云 (meijiaka-zy/bgm/...) 前端: - VideoCompose BGM 选择改为卡片弹窗 (系统BGM + 本地上传) - 去掉 BGM 硬编码本地路径, 直接使用云端 URL - CoverDesign 视觉重构: 绿色边框卡片、角标、hover 遮罩 - CoverDesign 去掉预选背景, 默认空白需手动选择 - 所有步骤按钮规范统一: 左=重新生成(主色), 右=导出/预览(次色) - 预览按钮状态统一: 文字变为'视频预览中...', 保持 btn-secondary - 去掉所有步骤按钮的 svg/emoji 图标 Rust: - mix_bgm_to_video 支持临时文件保护 (输入输出同路径时自动中转) - FFmpeg BGM 混合使用 aloop 循环 + amix 滤镜
30 lines
878 B
Python
30 lines
878 B
Python
"""
|
|
背景音乐 Schema
|
|
==============
|
|
"""
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class BgmMusicItem(BaseModel):
|
|
"""背景音乐项"""
|
|
|
|
id: int = Field(description="音乐ID")
|
|
title: str = Field(description="音乐名称")
|
|
artist: str | None = Field(default=None, description="艺术家")
|
|
category: str = Field(description="场景分类")
|
|
file_path: str = Field(description="相对文件路径")
|
|
url: str | None = Field(default=None, description="七牛云 URL")
|
|
duration: float | None = Field(default=None, description="时长(秒)")
|
|
sort_order: int = Field(default=0, description="排序权重")
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class BgmMusicListResponse(BaseModel):
|
|
"""背景音乐列表响应"""
|
|
|
|
items: list[BgmMusicItem] = Field(description="音乐列表")
|
|
total: int = Field(description="总数")
|