这是一个获取滴答清单API接口项目,提供包括任务管理、专注记录、习惯打卡、数据导出等功能。
-
🔐 认证相关 (/auth)
-
GET /auth/wechat/qrcode- 获取微信登录二维码 -
GET /auth/wechat/poll- 轮询登录状态(自动检测) -
GET /auth/wechat/validate- 验证微信登录 -
GET /auth/wechat/callback- 微信登录回调处理 -
POST /auth/password/login- 密码登录 -
POST /tasks/set-auth- 手动设置认证(通常不需要)
-
-
📝 任务管理 (/tasks)
-
GET /tasks/all- 获取所有任务 -
GET /tasks/completed- 获取已完成/已放弃任务(支持分页) -
GET /tasks/trash- 获取垃圾桶任务 -
GET /tasks/summary- 获取任务统计
-
-
📂 清单管理 (/projects)
-
GET /projects/all- 获取清单列表
-
-
📊 统计分析 (/statistics)
-
GET /statistics/ranking- 获取用户排名统计 -
GET /statistics/general- 获取通用统计信息 -
GET /statistics/tasks- 获取任务统计信息
-
-
🍅 专注记录 (/pomodoros)
-
GET /pomodoros/general- 获取番茄专注概览 -
GET /pomodoros/focus/current- 查看滴答服务器上当前番茄状态 -
GET /pomodoros/focus/start- 自动生成 start 操作所需参数 -
GET /pomodoros/focus/pause- 自动生成 pause 操作所需参数 -
GET /pomodoros/focus/continue- 自动生成 continue 操作所需参数 -
GET /pomodoros/focus/finish- 结束番茄钟(正常完成) -
GET /pomodoros/focus/stop- 自动组合 drop/exit 操作,快速结束番茄 -
POST /pomodoros/focus/point/{point}- 手动设置番茄操作指针 -
POST /pomodoros/focus/reset- 重置本地番茄状态缓存 -
GET /pomodoros/focus/state- 查看本地缓存的番茄会话状态
-
-
⏱️ 正计时专注 (/pomodoros)
-
GET /pomodoros/distribution- 获取专注详情分布 -
GET /pomodoros/timeline- 获取专注记录时间线 -
GET /pomodoros/heatmap- 获取专注趋势热力图 -
GET /pomodoros/time-distribution- 获取专注时间分布 -
GET /pomodoros/hour-distribution- 获取专注时间按小时分布
-
-
🎯 习惯管理 (/habits)
-
GET /habits/all- 获取所有习惯 -
GET /habits/statistics/week/current- 获取本周习惯打卡统计 -
GET /habits/export- 导出习惯数据
-
-
👤 用户信息 (/user)
-
GET /user/info- 获取用户信息
-
-
📤 数据导出 (/custom/export)
-
GET /custom/export/tasks/excel- 导出任务到Excel -
GET /custom/export/focus/excel- 导出专注记录到Excel
-
DidaAPI/
├── main.py # 🎯 应用启动文件
├── config.toml # 📝 配置文件
├── core/ # 🔧 核心模块
│ ├── __init__.py
│ ├── config.py # 配置管理
│ ├── database.py # 数据库管理
│ └── urls.py # URL和外部链接统一管理
├── models/ # 📊 数据模型
│ ├── __init__.py
│ └── base.py # 所有数据模型定义
├── services/ # 🔄 业务服务
│ ├── __init__.py
│ ├── wechat_service.py # 微信登录服务
│ ├── dida_service.py # 滴答清单API服务
│ ├── pomodoro_service.py # 专注记录服务
│ └── export_service.py # 数据导出服务
├── routers/ # 🛣️ API路由
│ ├── __init__.py
│ ├── auth.py # 认证相关路由
│ ├── tasks.py # 任务管理路由
│ ├── projects.py # 清单管理路由
│ ├── statistics.py # 统计分析路由
│ ├── pomodoros.py # 专注记录路由
│ ├── habits.py # 习惯管理路由
│ ├── user.py # 用户信息路由
│ └── export.py # 数据导出路由
├── utils/ # 🛠️ 工具模块
│ ├── __init__.py
│ └── logger.py # 日志配置
├── frontend/ # 🌐 前端项目(接口文档)
│ ├── docs/ # 📚 API文档
│ │ ├── index.md # 文档首页
│ │ ├── api/ # API接口文档
│ │ │ ├── auth/ # 认证相关接口
│ │ │ ├── tasks/ # 任务管理接口
│ │ │ ├── projects/ # 清单管理接口
│ │ │ ├── statistics/ # 统计分析接口
│ │ │ ├── pomodoros/ # 专注记录接口
│ │ │ ├── habits/ # 习惯管理接口
│ │ │ ├── user/ # 用户信息接口
│ │ │ └── custom/ # 自定义接口
│ │ └── guide/ # 使用指南
│ ├── .vitepress/ # VitePress配置
│ └── package.json # 前端依赖配置
└── output/ # 📤 输出文件夹
├── databases/ # 数据库文件
└── logs/ # 日志文件(按年/月/日组织)
- Python 3.8+
- Node.js 16+ (用于前端文档)
- 推荐使用 uv 作为Python包管理器
- 启动后端服务
uv sync uv run main.py
- 启动前端文档
cd frontend npm install npm run docs:dev - 查看API文档
- 后端API文档: http://localhost:8000/docs
- 前端接口文档: http://localhost:5173
- 在
services/中添加业务逻辑 - 在
routers/中添加路由定义 - 在
frontend/docs/api/中添加接口文档 - 更新 README.md 中的接口清单
欢迎提交 Issue 和 Pull Request!
- Fork 本项目
- 创建功能分支 (
git checkout -b feature/AmazingFeature) - 提交更改 (
git commit -m 'Add some AmazingFeature') - 推送到分支 (
git push origin feature/AmazingFeature) - 开启 Pull Request
注意: 本项目仅用于学习和研究目的,请遵守滴答清单的服务条款和使用协议。
