platform-assistant/apps/api
Sisyphus 4ab0040e55 feat(F002-P1): Lead 加 notes 字段 + crawler 提取 PDF 6 条要点 (老 GUI 同款)
- Lead 模型加 3 字段: notes (5000 字) / notesExtractedAt / notesSource
- 新增 NotesExtractorService (crawler 模块): PDF/HTML/URL → text → DeepSeek → 6 条要点
- 新增 LeadNotesController: POST /api/lead-notes/extract/:leadId (24h 缓存 + forceRefresh)
- lead.service.ts publishToDirev 优先用 notes 填 publishArgs.description + 同步传 notes
- Java publish() 已有逻辑: notes 优先 → description, 不需要改
- 端到端验证: Lead.notes=6 条要点 → publishToDirev → B2B tb_inquiry.note 正确落地

依赖: pdf-parse (新加, 1 个 npm 包, 25KB)

API 端点:
- POST /api/lead-notes/extract/:leadId?sourcePath=<URL|路径>&forceRefresh=false
- 返 { notes: string, source: 'pdf'|'html'|'url', cached: boolean }

环境变量: DEEPSEEK_API_KEY (从 .env 读, 缺时报错)

关联: F002-W31-交接文档.md §4 P1
本地备份: ~/projects/_meta/f002-fix/w31-platform-assistant-2026-06-23/
2026-06-24 11:52:59 +08:00
..
prisma feat(F002-P1): Lead 加 notes 字段 + crawler 提取 PDF 6 条要点 (老 GUI 同款) 2026-06-24 11:52:59 +08:00
public/uploads feat(F002): W26 + W29.x + W30 + W31 平台助手全部改动首次 commit 2026-06-24 11:07:11 +08:00
src feat(F002-P1): Lead 加 notes 字段 + crawler 提取 PDF 6 条要点 (老 GUI 同款) 2026-06-24 11:52:59 +08:00
.env.production feat(F002): W26 + W29.x + W30 + W31 平台助手全部改动首次 commit 2026-06-24 11:07:11 +08:00
.eslintrc.js feat(F002): W26 + W29.x + W30 + W31 平台助手全部改动首次 commit 2026-06-24 11:07:11 +08:00
AGENTS.md feat(F002): W26 + W29.x + W30 + W31 平台助手全部改动首次 commit 2026-06-24 11:07:11 +08:00
package.json feat(F002-P1): Lead 加 notes 字段 + crawler 提取 PDF 6 条要点 (老 GUI 同款) 2026-06-24 11:52:59 +08:00
tsconfig.json feat(F002): W26 + W29.x + W30 + W31 平台助手全部改动首次 commit 2026-06-24 11:07:11 +08:00