win 6a2f0bfb58 docs(phase-4): complete execution — 2/2 plans, architecture corrected
- Plan 01: facade uses private _boss/job51/zhilian_api/client files
  Private files now depend on crawler_core directly (not spiderJobs)
  Added asyncio.to_thread async_* methods for ARCH-06
- Plan 02: 11 private files marked DEPRECATED, jobs_spider/ deleted
- Architecture: facade→private→crawler_core; spiderJobs→crawler_core (independent)
- Full regression: 106 passed
2026-03-21 19:40:03 +08:00

45 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Plan 04-01 Summary: facade 层迁移至 spiderJobs.platforms.* + asyncio.to_thread 桥接
**Status:** Complete
**Tasks:** 3/3
**Commit:** 见 04 总提交
## 架构修正(用户反馈)
**初始方案**facade 直接 import `spiderJobs.platforms.*`**错误**spiderJobs 是独立运行脚本
**修正后正确架构:**
```
crawler_core ← 共享底层库
↑ ↑
spiderJobs app/services/crawler/_boss/job51/zhilian_api/client/sign
(独立脚本) (后端私有实现层)
boss.py / qcwy.py / zhilian.pyfacade
```
## What was built
`app/services/crawler/` 三个 facade 文件从调用内部私有复制文件改为直接调用 `spiderJobs.platforms.*`
| 文件 | 旧导入 | 新导入 |
|------|--------|--------|
| `boss.py` | `_boss_api/_boss_client/_boss_sign` | `spiderJobs.platforms.boss.{api,client,sign}` |
| `qcwy.py` | `_job51_api/_job51_client` | `spiderJobs.platforms.job51.{api,client}` |
| `zhilian.py` | `_zhilian_api/_zhilian_client/_zhilian_sign` | `spiderJobs.platforms.zhilian.{api,client,sign}` |
每个 Service 类新增 4 个 async 方法(`asyncio.to_thread` 桥接,满足 ARCH-06
- `BossService`: `async_get_job_detail / async_get_company_detail / async_get_company_jobs / async_search_jobs`
- `QcwyService`: `async_get_job_detail / async_get_company_info / async_get_company_jobs / async_search_jobs`
- `ZhilianService`: `async_get_job_detail / async_get_company_detail / async_get_company_jobs / async_search_jobs`
## Verification
```
python -c "from app.services.crawler.boss import BossService ..." → ✅
grep "asyncio.to_thread" ... → ✅ 存在
pytest tests/ -v → 106 passed ✅
```
## Self-Check: PASSED