fix(ai): 审计问题修复 — 错误映射/性能/SSE/依赖规范化
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

- C3: handler 中 .map_err(AppError::Internal) 改为 ? 操作符,
  利用 From<AiError> for AppError 实现正确的 HTTP 状态码映射
- H1: AiState 预构建在 AppState 初始化时,避免每次请求重建
  ClaudeProvider/AnalysisService/PromptService/UsageService
- H3: stream_analyze 的 user_id 参数传递到 created_by/updated_by
- H5: SSE 事件添加 .event("chunk"/"error"/"done") 类型字段
- L3: erp-ai Cargo.toml 依赖改用 workspace 引用
  (reqwest/handlebars/sha2/hex)
- 修复 erp-health 编译错误: points_handler 缺少 ColumnTrait 导入,
  points_service 版本字段部分移动问题
This commit is contained in:
iven
2026-04-25 16:53:01 +08:00
parent 4ab67ba559
commit 9901d5ce49
5 changed files with 49 additions and 51 deletions

View File

@@ -19,7 +19,7 @@ tracing.workspace = true
thiserror.workspace = true
utoipa.workspace = true
async-trait.workspace = true
reqwest = { version = "0.12", features = ["stream", "json"] }
handlebars = "6"
sha2 = "0.10"
hex = "0.4"
reqwest.workspace = true
handlebars.workspace = true
sha2.workspace = true
hex.workspace = true