220 lines
8.2 KiB
Markdown
220 lines
8.2 KiB
Markdown
|
|
# wecom_it_smart_desk 目录清理报告
|
|||
|
|
|
|||
|
|
**执行时间**:2026-06-06 23:50
|
|||
|
|
**执行人**:AI Assistant
|
|||
|
|
**确认方式**:用户确认「全部执行(推荐)」
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 一、清理前后对比
|
|||
|
|
|
|||
|
|
| 指标 | 清理前 | 清理后 | 释放 |
|
|||
|
|
|------|--------|--------|------|
|
|||
|
|
| 总大小 | ~524 MB | ~25 MB | **~499 MB (95%)** |
|
|||
|
|
| 根目录文件数 | 102 个 | ~25 个 | -77 个 |
|
|||
|
|
| 子目录数 | 6 个 | 6 个(结构不变) | — |
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 二、已删除文件清单
|
|||
|
|
|
|||
|
|
### ✅ 类别 A:可重生成缓存/构建产物(~519 MB)
|
|||
|
|
|
|||
|
|
| 路径 | 大小 | 说明 |
|
|||
|
|
|------|------|------|
|
|||
|
|
| `itdesk-images.tar` | 222.74 MB | Docker 镜像,可重新 build |
|
|||
|
|
| `itdesk.tar.gz` | 1.50 MB | 项目归档,已过期 |
|
|||
|
|
| `frontend-agent/node_modules/` | ~125 MB | `npm install` 重装 |
|
|||
|
|
| `frontend-h5/node_modules/` | ~77 MB | `npm install` 重装 |
|
|||
|
|
| `backend/venv/` | ~94 MB | `python -m venv` 重建 |
|
|||
|
|
| `frontend-agent/dist/` | ~1.6 MB | `npm run build` 重建 |
|
|||
|
|
| `frontend-h5/dist/` | ~0.3 MB | `npm run build` 重建 |
|
|||
|
|
| `backend/__pycache__/` | ~0.03 MB | Python 字节码缓存 |
|
|||
|
|
| `frontend-agent/src/__pycache__/` | 少量 | Python 字节码缓存 |
|
|||
|
|
| `backend/.pytest_cache/` | ~0.03 MB | pytest 缓存 |
|
|||
|
|
|
|||
|
|
### ✅ 类别 B:空文件(0 字节,~10 个)
|
|||
|
|
|
|||
|
|
| 文件 | 说明 |
|
|||
|
|
|------|------|
|
|||
|
|
| `api_test_agent_conv.json` | 空文件 |
|
|||
|
|
| `backend_stderr.txt` | 空文件 |
|
|||
|
|
| `backend_stdout.txt` | 空文件 |
|
|||
|
|
| `npm_result.txt` ~ `npm_result3.txt` | 空文件 x3 |
|
|||
|
|
| `py_test.txt` ~ `py_test3.txt` | 空文件 x3 |
|
|||
|
|
| `syntax_check.txt` | 空文件 |
|
|||
|
|
|
|||
|
|
### ✅ 类别 C:根目录重复诊断/测试脚本(~50 个 .py)
|
|||
|
|
|
|||
|
|
删除了根目录下所有临时诊断/测试脚本,仅保留以下 5 个有用脚本并归档至 `scripts/archive/`:
|
|||
|
|
|
|||
|
|
**保留并归档至 `scripts/archive/`:**
|
|||
|
|
- `simulate_wecom_enhanced.py` — 企业微信模拟(增强版)
|
|||
|
|
- `simulate_wecom.py` — 企业微信模拟
|
|||
|
|
- `import_knowledge_base.py` — 知识库导入
|
|||
|
|
- `start_8001.py` — 启动 8001 端口
|
|||
|
|
- `analyze_report.py` — 报告分析
|
|||
|
|
|
|||
|
|
**已删除(重复/临时诊断脚本):**
|
|||
|
|
- `diagnose.py`, `diagnose2.py`, `diag3.py`
|
|||
|
|
- `check_db.py`, `check_deps.py`, `check_syntax.py`, `check_tables.py`
|
|||
|
|
- `fix_messages_table.py`, `fix_sqlite_schema.py`
|
|||
|
|
- `run_tests.py`, `run_tests_v2.py`, `run_tests_direct.py`, `run_tests_temp.py`, `run_to_tests.py`, `run_final.py`, `run_inline.py`, `run_compact.py`, `run_pytest_inline.py`, `run_report.py`
|
|||
|
|
- `restart_and_test.py`, `restart_v4.py`, `restart_backend.ps1`, `start_and_test.py`, `start_backend.bat`
|
|||
|
|
- `test_api_debug.py`, `test_db_debug.py`, `test_direct.py`, `test_fe_build2.py`, `test_fe_build3.py`, `test_frontend_build.py`, `test_imports.py`, `test_install_ws.py`, `test_route.py`, `test_ws_check.py`, `test_ws_full.py`, `test_ws_functional.py`, `test_ws_prereq.py`, `test_ws_prereq2.py`, `test_ws_v3.py`, `test_ws_verification.py`
|
|||
|
|
- `extract_docx.py`, `kill_port.py`, `quick_test.py`, `import_test.py`
|
|||
|
|
|
|||
|
|
### ✅ 类别 D:后端根目录诊断脚本(~20 个 `_*.py`)
|
|||
|
|
|
|||
|
|
| 文件模式 | 说明 |
|
|||
|
|
|----------|------|
|
|||
|
|
| `_check_models.py`, `_crud_test.py`, `_debug_uuid.py` ... | 后端诊断脚本全部删除 |
|
|||
|
|
|
|||
|
|
### ✅ 类别 E:过期日志/输出文件(~20 个 .txt)
|
|||
|
|
|
|||
|
|
| 文件 | 说明 |
|
|||
|
|
|------|------|
|
|||
|
|
| `backend_log_8001.txt`, `backend_log.txt` | 后端日志(已过期) |
|
|||
|
|
| `fe_build_final.txt`, `fe_build_out.txt`, `fe_build_out2.txt` | 前端构建输出 |
|
|||
|
|
| `node_check.txt`, `node_test.txt`, `node_test2.txt` | Node 检查输出 |
|
|||
|
|
| `test_api_debug_results.txt`, `test_db_debug_results.txt` | 测试结果输出 |
|
|||
|
|
| `test_prereq_results.txt`, `test_ws_final_results.txt`, `test_ws_results.txt`, `test_ws_v3_results.txt` | 测试结果输出 |
|
|||
|
|
| `uvicorn_check.txt`, `uvicorn_exe_check.txt`, `uvicorn_ver.txt`, `uvicorn_ver2.txt` | Uvicorn 检查输出 |
|
|||
|
|
|
|||
|
|
### ✅ 类别 F:遗留系统代码(~2.3 MB)
|
|||
|
|
|
|||
|
|
| 路径 | 说明 |
|
|||
|
|
|------|------|
|
|||
|
|
| `docs/existing_system_code/` | 旧 Django 系统代码(本项目要替换的目标系统,非当前项目组成部分) |
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 三、保留文件清单
|
|||
|
|
|
|||
|
|
### 根目录(配置文件 + 文档 + 有用脚本)
|
|||
|
|
|
|||
|
|
| 文件 | 大小 | 说明 |
|
|||
|
|
|------|------|------|
|
|||
|
|
| `.env` | 2.8 KB | 根环境变量(docker-compose 用) |
|
|||
|
|
| `.env.example` | 2.7 KB | 环境变量模板 |
|
|||
|
|
| `.env.production` | 1.9 KB | 生产环境变量 |
|
|||
|
|
| `docker-compose.yml` | 6.7 KB | Docker Compose 配置 |
|
|||
|
|
| `README.md` | 7.4 KB | 项目说明 |
|
|||
|
|
| `ARCHITECTURE.md` | 79.9 KB | 架构文档 |
|
|||
|
|
| `PRD.md` | 36.0 KB | 产品需求文档 |
|
|||
|
|
| `QA_TEST_REPORT.md` | 11.3 KB | QA 测试报告(最新) |
|
|||
|
|
| `TESTING_CALL_AGENT.md` | 3.6 KB | 呼叫坐席测试文档 |
|
|||
|
|
|
|||
|
|
### `backend/` 目录(核心后端代码)
|
|||
|
|
|
|||
|
|
| 子目录 | 说明 |
|
|||
|
|
|----------|------|
|
|||
|
|
| `app/api/` | 15 个 API 路由模块 |
|
|||
|
|
| `app/models/` | 12 个 SQLAlchemy 模型 |
|
|||
|
|
| `app/schemas/` | 10 个 Pydantic schema |
|
|||
|
|
| `app/services/` | 11 个业务逻辑服务 |
|
|||
|
|
| `alembic/versions/` | 3 个数据库迁移 |
|
|||
|
|
| `tests/` | 15 个 pytest 测试文件 |
|
|||
|
|
| `it_smart_desk.db` | SQLite 数据库(304 KB) |
|
|||
|
|
| `.env`, `.env.example`, `requirements.txt` | 后端配置 |
|
|||
|
|
|
|||
|
|
### `frontend-agent/` 目录(坐席前端 Vue3)
|
|||
|
|
|
|||
|
|
| 子目录 | 说明 |
|
|||
|
|
|----------|------|
|
|||
|
|
| `src/views/` | Login.vue, Workspace.vue |
|
|||
|
|
| `src/components/chat/` | 12 个聊天相关组件 |
|
|||
|
|
| `src/components/assistant/` | 6 个 AI 辅助面板组件 |
|
|||
|
|
| `src/stores/` | 5 个 Pinia store |
|
|||
|
|
| `src/api/` | 8 个 API 模块 |
|
|||
|
|
| `src/data/` | 快速回复数据(qrData.ts) |
|
|||
|
|
|
|||
|
|
### `frontend-h5/` 目录(员工 H5 前端 Vue3 + Vant)
|
|||
|
|
|
|||
|
|
| 子目录 | 说明 |
|
|||
|
|
|----------|------|
|
|||
|
|
| `src/views/` | Login.vue, ChatView.vue |
|
|||
|
|
| `src/components/chat/` | 5 个聊天组件 |
|
|||
|
|
| `src/stores/` | 2 个 Pinia store |
|
|||
|
|
|
|||
|
|
### `docs/` 目录(项目文档)
|
|||
|
|
|
|||
|
|
| 文件 | 说明 |
|
|||
|
|
|------|------|
|
|||
|
|
| `01-项目总览与部署手册.md` | 部署手册 |
|
|||
|
|
| `团队沟通文档-架构消息知识库.md` | 架构设计 |
|
|||
|
|
| `摇人-多坐席协作-技术方案.md` | 协作方案 |
|
|||
|
|
| `正式环境独立部署架构方案.md` | 生产部署 |
|
|||
|
|
| `ARCHITECTURE-v53-incremental.md` | 增量架构 |
|
|||
|
|
| `PRD-v53-incremental.md` | 增量 PRD |
|
|||
|
|
| `*.mermaid` | 5 个架构图表 |
|
|||
|
|
| `现有系统交接文档内容.txt` | 遗留系统交接说明 |
|
|||
|
|
|
|||
|
|
### `scripts/` 目录(构建/部署脚本)
|
|||
|
|
|
|||
|
|
| 文件 | 说明 |
|
|||
|
|
|------|------|
|
|||
|
|
| `build.sh` | 构建脚本 |
|
|||
|
|
| `deploy.sh` | 部署脚本 |
|
|||
|
|
| `read_docx.py` | docx 读取工具 |
|
|||
|
|
| `archive/` | 5 个归档脚本 |
|
|||
|
|
|
|||
|
|
### `nginx/` 目录
|
|||
|
|
|
|||
|
|
| 文件 | 说明 |
|
|||
|
|
|------|------|
|
|||
|
|
| `nginx.conf` | 反向代理配置 |
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 四、迁移注意事项
|
|||
|
|
|
|||
|
|
### ✅ 迁移前需要重新生成的内容
|
|||
|
|
|
|||
|
|
| 内容 | 生成方式 |
|
|||
|
|
|------|----------|
|
|||
|
|
| `frontend-agent/node_modules/` | `cd frontend-agent && npm install` |
|
|||
|
|
| `frontend-h5/node_modules/` | `cd frontend-h5 && npm install` |
|
|||
|
|
| `backend/venv/` | `cd backend && python -m venv venv && .\venv\Scripts\activate && pip install -r requirements.txt` |
|
|||
|
|
| `frontend-agent/dist/` | `cd frontend-agent && npm run build` |
|
|||
|
|
| `frontend-h5/dist/` | `cd frontend-h5 && npm run build` |
|
|||
|
|
|
|||
|
|
### ⚠️ 迁移后需要检查/重新配置的项
|
|||
|
|
|
|||
|
|
1. **`.env` 文件**:数据库连接、Dify API Key、企业微信配置等敏感信息需要重新填写
|
|||
|
|
2. **`backend/.env`**:后端环境变量需要重新配置
|
|||
|
|
3. **`docker-compose.yml`**:服务器 IP、端口映射等可能需要调整
|
|||
|
|
4. **`nginx/nginx.conf`**:服务器域名/IP 可能需要调整
|
|||
|
|
|
|||
|
|
### 📦 建议迁移方式
|
|||
|
|
|
|||
|
|
**方式一:直接复制清理后的目录(推荐)**
|
|||
|
|
```bash
|
|||
|
|
# 清理后只剩 ~25 MB,直接打包迁移
|
|||
|
|
cd C:\Users\simon
|
|||
|
|
Compress-Archive -Path wecom_it_smart_desk -DestinationPath wecom_it_smart_desk_clean.zip
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**方式二:Git 克隆(如果已推送到远程仓库)**
|
|||
|
|
```bash
|
|||
|
|
git clone <repo_url> wecom_it_smart_desk_new
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## 五、清理验证
|
|||
|
|
|
|||
|
|
执行以下命令验证清理结果:
|
|||
|
|
|
|||
|
|
```powershell
|
|||
|
|
# 查看总大小
|
|||
|
|
Get-ChildItem "C:\Users\simon\wecom_it_smart_desk" -Recurse -File -ErrorAction SilentlyContinue | Measure-Object -Property Length -Sum | Select-Object @{n="TotalMB";e={[math]::Round($_.Sum/1MB,2)}}
|
|||
|
|
|
|||
|
|
# 查看根目录文件(应该只剩配置文件+文档)
|
|||
|
|
Get-ChildItem "C:\Users\simon\wecom_it_smart_desk" -File | Format-Table Name, @{n="SizeKB";e={[math]::Round($_.Length/1KB,1)}}, LastWriteTime
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
*清理报告结束*
|