refactor(api): 去除代码版本命名

This commit is contained in:
admin committed 2026-09-14 15:35:53 +08:00
1 parent bbc4bdd140
commit dcf4cb0719
31 files changed
+174 -154

No files matched your search

+11 -11
View File
@@ -2,28 +2,28 @@
基于微信读书 API 的个人读书数据展示网站。
- **v2「阅间」看板(当前默认前端)**:沿用设计稿的视觉与交互,数据来自 `/api/v2/*` 实时聚合接口,见 `docs/V2_API.md`。
- **v1 仪表盘(已归档)**:原 ECharts 单页仪表盘,完整备份在 `legacy/v1/`。
- **「阅间」看板(当前默认前端)**:沿用设计稿的视觉与交互,数据来自 `/api/reading/*` 实时聚合接口,见 `docs/API.md`。
- **旧版仪表盘(已归档)**:原 ECharts 单页仪表盘,完整备份在 `legacy/classic/`。
## 项目结构
```
.
├── fetch_data.py # 数据采集脚本(从微信读书 API 拉取数据到 SQLite)
├── app.py # Flask 后端服务(v1 接口 + 注册 v2 Blueprint)
├── api_v2.py # v2 数据接口层(/api/v2/*,供「阅间」前端使用)
├── app.py # Flask 后端服务(旧接口 + 注册当前看板接口)
├── reading_api.py # 当前数据接口层(/api/reading/*,供「阅间」前端使用)
├── start_dashboard.sh # 启动脚本(端口可用 PORT 覆盖)
├── legacy/v1/ # v1 前端备份(index.html / style.css / app.js)
├── legacy/classic/ # 旧版前端备份(index.html / style.css / app.js)
├── weread.db # SQLite 数据库(运行 fetch_data.py 后生成)
├── requirements.txt # Python 依赖
├── templates/
│ └── index.html # 「阅间」前端页面(v2 设计稿)
│ └── index.html # 「阅间」前端页面
└── static/
├── css/styles.css # v2 样式(设计稿原样)
├── css/style.css # v1 样式(保留)
├── css/styles.css # 当前样式(设计稿原样)
├── css/style.css # 旧版样式(保留)
└── js/
├── weapi.js # v2 数据层(封装 /api/v2/*)
└── app.js # v2 交互逻辑
├── weapi.js # 当前数据层(封装 /api/reading/*)
└── app.js # 当前交互逻辑
```
## 快速开始
@@ -58,7 +58,7 @@ PORT=8080 ./start_dashboard.sh # 或指定端口
也可以直接 `python app.py`(默认 8080,可用环境变量 `PORT` 覆盖),
然后访问 http://127.0.0.1:8770 查看「阅间」看板。
> v2 的书架、统计、推荐、搜索等数据实时来自微信读书接口;
> 当前看板的书架、统计、推荐、搜索等数据实时来自微信读书接口;
> 未运行 `fetch_data.py` 时也能使用,只有进度/笔记等局部数据会缺少缓存加速。
## 自动部署