feat: 重构FAQ导入进度,改用Redis存储任务状态

This commit is contained in:
wizardchen
2025-12-18 19:41:36 +08:00
committed by lyingbug
parent 7576f08ad5
commit ad450e6bce
8 changed files with 272 additions and 110 deletions
+19
View File
@@ -211,4 +211,23 @@ export function searchFAQEntries(
export async function exportFAQEntries(kbId: string): Promise<Blob> {
const response = await getDown(`/api/v1/knowledge-bases/${kbId}/faq/entries/export`);
return response as unknown as Blob;
}
// FAQ Import Progress API
export interface FAQImportProgress {
task_id: string
kb_id: string
knowledge_id: string
status: 'pending' | 'processing' | 'completed' | 'failed'
progress: number
total: number
processed: number
message: string
error: string
created_at: number
updated_at: number
}
export function getFAQImportProgress(taskId: string) {
return get(`/api/v1/faq/import/progress/${taskId}`);
}