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

@@ -116,6 +116,9 @@ ORDER BY ordinal_position;

View File

@@ -129,6 +129,9 @@ runMigration()

View File

@@ -63,6 +63,9 @@ COMMENT ON COLUMN "dc_schema"."dc_tool_c_sessions"."column_mapping" IS '列名

View File

@@ -90,6 +90,9 @@ COMMENT ON COLUMN dc_schema.dc_tool_c_sessions.expires_at IS '过期时间(创

View File

@@ -62,3 +62,6 @@ USING gin (metadata jsonb_path_ops);
-- SELECT indexname, indexdef FROM pg_indexes WHERE schemaname = 'ekb_schema';

View File

@@ -29,3 +29,6 @@ ON "ekb_schema"."ekb_document"
USING gin (tags);

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")