febb1bcfce
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
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
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 1m2s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been skipped
CI/CD Pipeline / Validate - Code Quality (push) Has been cancelled
CI/CD Pipeline / Validate - Type Check (mypy) (push) Has been cancelled
CI/CD Pipeline / Validate - Migration (alembic) (push) Has been cancelled
CI/CD Pipeline / Unit Tests (push) Has been cancelled
CI/CD Pipeline / Integration Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Lint (push) Has been cancelled
CI/CD Pipeline / Frontend Unit Tests (push) Has been cancelled
CI/CD Pipeline / PR Build API Image (push) Has been cancelled
CI/CD Pipeline / PR Build Web Image (push) Has been cancelled
CI/CD Pipeline / PR Build Worker Image (push) Has been cancelled
CI/CD Pipeline / Build Staging API Image (push) Has been cancelled
CI/CD Pipeline / Build Staging Web Image (push) Has been cancelled
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Has been cancelled
CI/CD Pipeline / Staging E2E Tests (push) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (push) Has been cancelled
CI/CD Pipeline / Build Production API Image (push) Has been cancelled
CI/CD Pipeline / Build Production Web Image (push) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (push) Has been cancelled
CI/CD Pipeline / Deploy Production (push) Has been cancelled
CI/CD Pipeline / Production Browser E2E (push) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (push) Has been cancelled
CI/CD Pipeline / Canary Release to Production (push) Has been cancelled
CI/CD Pipeline / CI Gate (push) Has been cancelled
CI/CD Pipeline / Check if frontend-only change (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Code Quality (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / PR Build API Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Web Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been cancelled
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
AI Code Review / AI Code Review (pull_request) Has been cancelled
PR Automation / Auto Approve on CI Green (pull_request) Has been cancelled
Preview Deploy / Deploy Preview Environment (pull_request) Has been cancelled
前端: - 删除 GenerationProgressModal/GenerationHistoryModal 组件及目录 - 删除 generateEditPlan/getGenerationStatus/getEditPlanGenerations 三个死API函数 - 删除对应类型 GenerateResponse/EditPlanGeneration/GenerationStatusResponse - 清理测试文件中的 mock 和引用 - 用户可见文案 '剪辑编辑器' 统一改为 '剪辑模板' - 不改变量名/组件名/路由路径/API路径 后端: - 删除 templates_editor/generation.py 死接口文件 - 清理 _fallback.py、dependencies.py、schemas.py 中的死代码 - 删除对应无用测试文件
54 lines
1.5 KiB
TypeScript
54 lines
1.5 KiB
TypeScript
/**
|
|
* 模板草稿 CRUD API
|
|
*/
|
|
import apiClient from "../client"
|
|
import type { EditPlan, UpdateEditPlanRequest, GeneratedVideo } from "./types"
|
|
|
|
/** 获取单个模板草稿 */
|
|
export async function getEditPlan(templateId: string): Promise<EditPlan> {
|
|
const response = await apiClient.get(`/templates/${templateId}/editor`)
|
|
return response.data
|
|
}
|
|
|
|
/** 更新模板草稿(支持传入 AbortSignal 用于自动保存竞态取消) */
|
|
export async function updateEditPlan(
|
|
templateId: string,
|
|
data: UpdateEditPlanRequest,
|
|
signal?: AbortSignal,
|
|
): Promise<EditPlan> {
|
|
const response = await apiClient.put(`/templates/${templateId}/editor`, data, { signal })
|
|
return response.data
|
|
}
|
|
|
|
/** 获取生成任务的视频结果列表 */
|
|
export async function getGenerationTaskResults(taskId: string): Promise<GeneratedVideo[]> {
|
|
const response = await apiClient.get(`/generation/tasks/${taskId}/results`)
|
|
return response.data.items || response.data || []
|
|
}
|
|
|
|
/** ── 草稿 clips 批量更新 ── */
|
|
|
|
export interface EditPlanClipInput {
|
|
asset_id: string
|
|
start_time: number
|
|
duration: number
|
|
order: number
|
|
}
|
|
|
|
/**
|
|
* 批量替换草稿的 clips(先全删再批量插入)
|
|
* 后端路由:PUT /templates/{template_id}/editor/clips
|
|
*/
|
|
export async function updateEditPlanClips(
|
|
templateId: string,
|
|
clips: EditPlanClipInput[],
|
|
signal?: AbortSignal,
|
|
): Promise<{ count: number }> {
|
|
const response = await apiClient.put(
|
|
`/templates/${templateId}/editor/clips`,
|
|
{ clips },
|
|
{ signal },
|
|
)
|
|
return response.data
|
|
}
|