From 265e49587f4c73a713e6bf5c3635b8bf918c3f2d Mon Sep 17 00:00:00 2001 From: Audit Bot Date: Mon, 29 Jun 2026 17:39:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20tasks.ts=20=E7=B1=BB=E5=9E=8B=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=AF=B9=E9=BD=90=E5=90=8E=E7=AB=AF=20schema=EF=BC=88?= =?UTF-8?q?P2=20=E4=BF=AE=E5=A4=8D=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CreateGenerationTaskResponse: task_id→id, message→error_message, 补全所有字段 - TaskItem: 补充 project_id, template_id 字段 对齐后端 GenerationTaskResponse 和 UserTaskResponse schema --- apps/web/src/api/tasks.ts | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/apps/web/src/api/tasks.ts b/apps/web/src/api/tasks.ts index 8b3141919..de9ed2e89 100644 --- a/apps/web/src/api/tasks.ts +++ b/apps/web/src/api/tasks.ts @@ -9,10 +9,12 @@ import apiClient from './client'; /* ──────────── 类型定义 ──────────── */ -/** 任务条目 */ +/** 任务条目(对应用户级 UserTaskResponse) */ export interface TaskItem { id: string; task_type: 'ingest' | 'generation' | string; + project_id: string; + template_id: string; status: string; progress: number; current_step: string; @@ -32,11 +34,21 @@ export interface CreateGenerationTaskRequest { voice_ids: string[]; } -/** 创建生成任务响应 */ +/** 创建生成任务响应(对齐后端 GenerationTaskResponse) */ export interface CreateGenerationTaskResponse { - task_id: string; + id: string; + project_id: string; + asset_library_id: string; + strategy_id: string; + voice_library_id: string; + template_id: string; + asset_ids: string[]; + title_ids: string[]; + voice_ids: string[]; status: string; - message: string; + progress: number; + result_count: number; + error_message: string; } /* ──────────── API 函数 ──────────── */ -- 2.54.0