feat(knowledge): Phase B+C 文档提取器 + multipart 文件上传
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- PDF 提取 (pdf-extract) + DOCX 提取 (zip+quick-xml) + Excel 解析 (calamine) - 统一格式路由 detect_format() → RAG 通道或结构化通道 - POST /api/v1/knowledge/upload multipart 文件上传 - PDF/DOCX/Markdown → RAG 管线,Excel → structured_rows JSONB - 结构化数据源 CRUD API (GET/DELETE /api/v1/structured/sources) - POST /api/v1/structured/query JSONB 关键词查询 - 修复 industry/service.rs SaasError::Database 类型不匹配
This commit is contained in:
@@ -196,14 +196,14 @@ pub async fn set_account_industries(
|
||||
.bind(&ids)
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.map_err(|e| SaasError::Database(e.to_string()))?;
|
||||
.map_err(SaasError::Database)?;
|
||||
|
||||
if valid_count.0 != ids.len() as i64 {
|
||||
return Err(SaasError::InvalidInput("部分行业不存在或已禁用".to_string()));
|
||||
}
|
||||
|
||||
// 事务性 DELETE + INSERT
|
||||
let mut tx = pool.begin().await.map_err(|e| SaasError::Database(e.to_string()))?;
|
||||
let mut tx = pool.begin().await.map_err(SaasError::Database)?;
|
||||
|
||||
sqlx::query("DELETE FROM account_industries WHERE account_id = $1")
|
||||
.bind(account_id)
|
||||
@@ -223,7 +223,7 @@ pub async fn set_account_industries(
|
||||
.await?;
|
||||
}
|
||||
|
||||
tx.commit().await.map_err(|e| SaasError::Database(e.to_string()))?;
|
||||
tx.commit().await.map_err(SaasError::Database)?;
|
||||
|
||||
list_account_industries(pool, account_id).await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user