cc0f439bd2
CI/CD Pipeline / Check if frontend-only change (push) Has been cancelled
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 / Build Staging Worker 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
1. cover API: body不再发送template_id,只保留query params 2. useSegmentScheduler tick: 片段切换后setIsPlaying(true)+重启RAF循环
32 lines
778 B
TypeScript
32 lines
778 B
TypeScript
import apiClient from "../client"
|
|
|
|
export interface GenerateCoverRequest {
|
|
asset_ids: string[]
|
|
cover_type?: "ai_frame" | "manual" | "upload" | "ai_regenerate"
|
|
frame_time?: number
|
|
}
|
|
|
|
export interface GenerateCoverResponse {
|
|
plan_id: string
|
|
cover: {
|
|
scheme?: string
|
|
asset_id?: string
|
|
frame_time?: number
|
|
image_url?: string
|
|
thumbnail_url?: string
|
|
[key: string]: unknown
|
|
}
|
|
}
|
|
|
|
/** AI 生成封面 — 从预览视频中抽帧 */
|
|
export async function generateCover(
|
|
templateId: string,
|
|
data: GenerateCoverRequest,
|
|
): Promise<GenerateCoverResponse> {
|
|
const response = await apiClient.post<GenerateCoverResponse>("/generation/generate-cover", data, {
|
|
timeout: 300000,
|
|
params: { template_id: templateId },
|
|
})
|
|
return response.data
|
|
}
|