feat(media): 作品保存恢复 - 按原任务重试交付并避免重复生成计费
This commit is contained in:
@@ -59,6 +59,7 @@ export type ApiCallLog = {
|
||||
channelName: string;
|
||||
taskId?: string;
|
||||
taskStatus?: TaskStatus;
|
||||
mediaStage?: GenerationTask["mediaStage"];
|
||||
billingOrderId?: string;
|
||||
billingStatus?: BillingOrder["status"];
|
||||
billingAmountMicrocredits: number;
|
||||
@@ -66,7 +67,7 @@ export type ApiCallLog = {
|
||||
source: string;
|
||||
capability: "text" | "image" | "video" | "audio" | "";
|
||||
operation?: string;
|
||||
requestKind: "create" | "poll" | "download" | "repair" | "";
|
||||
requestKind: "create" | "poll" | "download" | "upload" | "local_save" | "register" | "repair" | "";
|
||||
billable: boolean;
|
||||
apiFormat: string;
|
||||
method: string;
|
||||
|
||||
@@ -27,6 +27,8 @@ export type GenerationTask = {
|
||||
status: TaskStatus;
|
||||
progress?: number;
|
||||
stage?: string;
|
||||
mediaStage?: "download" | "upload" | "local_save" | "register" | "completed" | "checkpoint";
|
||||
canRecoverMedia?: boolean;
|
||||
prompt: string;
|
||||
operation?: string;
|
||||
provider?: string;
|
||||
@@ -282,6 +284,10 @@ export function retryGenerationTask(id: string) {
|
||||
return http.post<GenerationTask>(`/tasks/${encodeURIComponent(id)}/retry`);
|
||||
}
|
||||
|
||||
export function recoverGenerationTaskMedia(id: string) {
|
||||
return http.post<GenerationTask>(`/tasks/${encodeURIComponent(id)}/recover-media`);
|
||||
}
|
||||
|
||||
export function cancelGenerationTask(id: string) {
|
||||
return http.post<GenerationTask>(`/tasks/${encodeURIComponent(id)}/cancel`).then((task) => {
|
||||
window.dispatchEvent(new CustomEvent("canvas:task-cancelled", { detail: { task } }));
|
||||
|
||||
Reference in New Issue
Block a user