feat(clips): EditorClipResponse 增加 asset_url 签名URL字段 #1403

Closed
xiaoxia wants to merge 1 commits from feat/clips-asset-url into develop
Owner

改动说明

扩展模板编辑器 clips API,返回素材视频签名URL,为前端 CSS 预览播放器提供播放能力。

修改文件

文件 改动
apps/api/app/api/routes/templates_editor/schemas.py EditorClipResponse 新增 asset_url: str | None 字段
apps/api/app/api/routes/templates_editor/clips.py GET /clipsGET /clips/{clip_id} 批量查询素材 storage_key 生成签名URL

新增字段

{
  "id": "clip-xxx",
  "plan_id": "plan-xxx",
  "clip_type": "main",
  "order": 0,
  "duration": 5.0,
  "asset_url": "https://oss.xxx.com/...?Expires=...",
  ...
}
  • asset_url: 素材视频签名URL,有效期1小时
  • 如果 asset_id 不存在或生成失败,返回 null
  • 不影响现有字段

技术实现

  • 使用现有 StorageService.get_download_url() 生成 OSS 签名URL
  • 使用 AssetRepository.find_by_id() 查询素材 storage_key
  • 列表接口批量查询,避免 N+1 问题
  • 异常安全:任何失败只记录日志,返回 null

验证

  • CI 全绿后合并
  • 等待前端 PR 合并后联调验证
## 改动说明 扩展模板编辑器 clips API,返回素材视频签名URL,为前端 CSS 预览播放器提供播放能力。 ## 修改文件 | 文件 | 改动 | |------|------| | `apps/api/app/api/routes/templates_editor/schemas.py` | `EditorClipResponse` 新增 `asset_url: str \| None` 字段 | | `apps/api/app/api/routes/templates_editor/clips.py` | `GET /clips` 和 `GET /clips/{clip_id}` 批量查询素材 storage_key 生成签名URL | ## 新增字段 ```json { "id": "clip-xxx", "plan_id": "plan-xxx", "clip_type": "main", "order": 0, "duration": 5.0, "asset_url": "https://oss.xxx.com/...?Expires=...", ... } ``` - `asset_url`: 素材视频签名URL,有效期1小时 - 如果 asset_id 不存在或生成失败,返回 `null` - 不影响现有字段 ## 技术实现 - 使用现有 `StorageService.get_download_url()` 生成 OSS 签名URL - 使用 `AssetRepository.find_by_id()` 查询素材 storage_key - 列表接口批量查询,避免 N+1 问题 - 异常安全:任何失败只记录日志,返回 null ## 验证 - CI 全绿后合并 - 等待前端 PR 合并后联调验证
xiaoxia added 1 commit 2026-08-17 14:20:01 +08:00
feat(clips): EditorClipResponse 增加 asset_url 签名URL字段
CI/CD Pipeline / Check if frontend-only change (pull_request) Failing after 0s
CI/CD Pipeline / Validate - Code Quality (pull_request) Failing after 0s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Failing after 0s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Failing after 0s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
AI Code Review / AI Code Review (pull_request) Failing after 0s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Failing after 0s
Preview Deploy / Deploy Preview Environment (pull_request) Failing after 0s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 0s
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 0s
CI/CD Pipeline / PR Build API Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Failing after 0s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Failing after 0s
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m18s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 42s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 57s
36630d3828
- EditorClipResponse 新增 asset_url: str | None 字段
- GET /clips 列表接口批量查询素材 storage_key 生成签名URL
- GET /clips/{clip_id} 详情接口同样返回 asset_url
- 签名URL有效期1小时,失败时返回null不影响其他字段
- 为前端CSS预览播放器提供素材视频播放能力
xiaoxia closed this pull request 2026-08-17 14:43:25 +08:00

🗑️ 预览环境已清理

PR #1403 已关闭或合并,对应的预览环境已被清理。

如有需要,可以重新打开 PR 来重新生成预览环境。

🗑️ **预览环境已清理** PR #1403 已关闭或合并,对应的预览环境已被清理。 > 如有需要,可以重新打开 PR 来重新生成预览环境。
Some required checks failed
CI/CD Pipeline / Check if frontend-only change (pull_request) Failing after 0s
CI/CD Pipeline / Validate - Code Quality (pull_request) Failing after 0s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Failing after 0s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Failing after 0s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
AI Code Review / AI Code Review (pull_request) Failing after 0s
Required
Details
PR Automation / Auto Merge on CI Green + Approved (pull_request) Failing after 0s
Preview Deploy / Deploy Preview Environment (pull_request) Failing after 0s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 0s
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 0s
CI/CD Pipeline / PR Build API Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Failing after 0s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Failing after 0s
Required
Details
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m18s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 42s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 57s

Pull request closed

Sign in to join this conversation.