feat(storage): integrate Alibaba Cloud OSS for file persistence - Add OSSAdapter and LocalAdapter with StorageFactory pattern - Integrate PKB module with OSS upload - Rename difyDocumentId to storageKey - Create 4 OSS buckets and development specification

This commit is contained in:
2026-01-22 22:02:20 +08:00
parent 483c62fb6f
commit 9c96f75c52
309 changed files with 4583 additions and 172 deletions

View File

@@ -152,7 +152,7 @@ model Document {
fileType String @map("file_type")
fileSizeBytes BigInt @map("file_size_bytes")
fileUrl String @map("file_url")
difyDocumentId String @map("dify_document_id")
storageKey String @map("dify_document_id") // 原 difyDocumentId现存储 OSS 路径
status String @default("uploading")
progress Int @default(0)
errorMessage String? @map("error_message")
@@ -168,7 +168,7 @@ model Document {
batchResults BatchResult[] @relation("DocumentBatchResults")
knowledgeBase KnowledgeBase @relation("KnowledgeBaseDocuments", fields: [kbId], references: [id], onDelete: Cascade)
@@index([difyDocumentId], map: "idx_pkb_documents_dify_document_id")
@@index([storageKey], map: "idx_pkb_documents_dify_document_id") // 保留原索引名
@@index([extractionMethod], map: "idx_pkb_documents_extraction_method")
@@index([kbId], map: "idx_pkb_documents_kb_id")
@@index([status], map: "idx_pkb_documents_status")