117 lines
4.4 KiB
JSON
117 lines
4.4 KiB
JSON
{
|
||
"generated_at": "2026-03-20T00:00:00+08:00",
|
||
"project": "JobData - 招聘数据采集与统计分析平台",
|
||
"scan_coverage": {
|
||
"estimated_total_files": 220,
|
||
"scanned_files": 35,
|
||
"coverage_percent": 16,
|
||
"note": "node_modules 已排除;覆盖全部核心业务文件,node_modules 约占总文件数 90% 以上"
|
||
},
|
||
"ignored_directories": [
|
||
{ "path": "web/node_modules", "reason": ".gitignore 规则" },
|
||
{ "path": "__pycache__", "reason": ".gitignore 规则" },
|
||
{ "path": ".venv / venv", "reason": ".gitignore 规则" },
|
||
{ "path": "migrations", "reason": ".gitignore 规则" },
|
||
{ "path": "clickhouse_data / data", "reason": ".gitignore 规则" }
|
||
],
|
||
"modules": [
|
||
{
|
||
"path": "app",
|
||
"language": "Python 3.13",
|
||
"framework": "FastAPI 0.111 + Tortoise-ORM 0.23",
|
||
"entry": "app/__init__.py",
|
||
"startup_script": "run.py",
|
||
"config": "app/settings/config.py",
|
||
"api_prefix": "/api/v1",
|
||
"routes": [
|
||
"/base", "/user", "/role", "/menu", "/api", "/dept", "/auditlog",
|
||
"/job", "/universal", "/token", "/proxy", "/stats", "/pipeline",
|
||
"/keyword", "/cleaning", "/analytics", "/company"
|
||
],
|
||
"databases": {
|
||
"mysql": "Tortoise-ORM, 表: user/role/api/menu/dept/auditlog/boss_token/cleaning_*/metrics_*",
|
||
"clickhouse": "直接连接, 表: boss_job/boss_company/qcwy_job/qcwy_company/zhilian_job/zhilian_company/pending_company, 视图: job_analytics"
|
||
},
|
||
"scheduler_tasks": [
|
||
"stats_job (每6h)", "ecs_full_pipeline (每6h)",
|
||
"ip_alert_job (每10min)", "company_cleaning_job (每5min)",
|
||
"daily_cleanup_job (每天00:05)"
|
||
],
|
||
"test_exists": false,
|
||
"gaps": ["缺少单元测试", "缺少集成测试", "config.py 中有硬编码凭据"]
|
||
},
|
||
{
|
||
"path": "web",
|
||
"language": "JavaScript (Vue 3)",
|
||
"framework": "Vue 3.3 + Vite 4 + Naive UI + Pinia",
|
||
"entry": "web/src/main.js",
|
||
"build_cmd": "pnpm build",
|
||
"dev_cmd": "pnpm dev",
|
||
"key_views": [
|
||
"views/analytics/index.vue",
|
||
"views/cleaning/index.vue",
|
||
"views/recruitment/boss|qcwy|zhilian/index.vue",
|
||
"views/system/*"
|
||
],
|
||
"api_layer": "web/src/api/",
|
||
"state_management": "Pinia (user, permission, app, tags)",
|
||
"test_exists": false,
|
||
"gaps": ["缺少 Vitest 单元测试", "缺少 Playwright E2E 测试"]
|
||
},
|
||
{
|
||
"path": "jobs_spider",
|
||
"language": "Python",
|
||
"sub_modules": ["boss", "qcwy", "zhilian"],
|
||
"entry": {
|
||
"boss": "jobs_spider/boss/boos_api.py (死循环主入口)",
|
||
"qcwy": "jobs_spider/qcwy/run_company_search.py",
|
||
"zhilian": "jobs_spider/zhilian/company_spider.py"
|
||
},
|
||
"push_api": "POST /api/v1/universal/data/batch-store-async",
|
||
"anti_crawl": ["SmartIPManager (代理池轮换)", "随机延迟>=10s", "Session 重建", "Cookie 更新"],
|
||
"test_exists": false,
|
||
"gaps": ["缺少 IPAnomalyDetector 单元测试", "缺少数据解析函数测试"]
|
||
},
|
||
{
|
||
"path": "ecs_full_pipeline.py",
|
||
"language": "Python",
|
||
"description": "阿里云 ECS 实例批量创建/销毁/命令下发全流程脚本",
|
||
"entry": "ecs_full_pipeline.py",
|
||
"cloud": "Alibaba Cloud ECS (cn-qingdao-b, ecs.n1.tiny, 抢占实例)",
|
||
"gaps": ["AK/SK 在代码中硬编码(安全风险)"]
|
||
}
|
||
],
|
||
"security_issues": [
|
||
{
|
||
"severity": "HIGH",
|
||
"file": "app/settings/config.py",
|
||
"issue": "MySQL 连接串(含密码)、ClickHouse 密码、SMTP 密码硬编码"
|
||
},
|
||
{
|
||
"severity": "HIGH",
|
||
"file": "ecs_full_pipeline.py",
|
||
"issue": "阿里云 AK/SK 硬编码在 main() 函数中"
|
||
},
|
||
{
|
||
"severity": "MEDIUM",
|
||
"file": "app/settings/config.py",
|
||
"issue": "SECRET_KEY = 'CHANGE_ME_DEV_ONLY',生产环境需替换"
|
||
}
|
||
],
|
||
"coverage_gaps": [
|
||
"所有模块均无自动化测试(单元/集成/E2E)",
|
||
"jobs_spider/qcwy 和 jobs_spider/zhilian 未深度扫描",
|
||
"app/services/company_cleaner.py 未扫描",
|
||
"web/src/views/system/* 子目录未逐一扫描"
|
||
],
|
||
"next_scan_recommendations": [
|
||
"补扫: app/services/company_cleaner.py",
|
||
"补扫: jobs_spider/qcwy/qcwy.py",
|
||
"补扫: jobs_spider/zhilian/zhilian_single.py",
|
||
"补扫: web/src/views/system/ 各子目录",
|
||
"补扫: app/core/algorithms/ 反爬虫算法",
|
||
"补扫: app/api/v1/cleaning/ 清洗接口实现"
|
||
],
|
||
"truncated": false
|
||
}
|