Files
vscode-workbench/.trae/specs/short-url-api/tasks.md
T

33 lines
1.6 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.
# Tasks
- [x] Task 1: 创建 shorturl Django 应用骨架
- [x] SubTask 1.1: 创建 `shorturl/` 目录及 `__init__.py`、`apps.py`、`models.py`、`urls.py`、`views.py`
- [x] SubTask 1.2: 创建 `ShortUrl` 数据模型(code、original_url、custom_code、creator、created_at、expire_at、click_count 字段)
- [x] SubTask 1.3: 生成并验证迁移文件
- [x] Task 2: 实现短链接生成和解析 API
- [x] SubTask 2.1: 实现 `ShortUrlShortenView`(POST /api/shorturl/shorten/)
- [x] SubTask 2.2: 实现 `ShortUrlInfoView`(GET /api/shorturl/info/<code>/)
- [x] SubTask 2.3: 实现 `ShortUrlRedirectView`(GET /s/<code>/)
- [x] SubTask 2.4: 实现 `ShortUrlListView`(GET /api/shorturl/list/)
- [x] Task 3: 注册路由和 Swagger 文档
- [x] SubTask 3.1: 在 `shorturl/urls.py` 中配置应用路由
- [x] SubTask 3.2: 在 `api/urls.py` 中注册 shorturl 路由
- [x] SubTask 3.3: 为所有视图添加 swagger_auto_schema 装饰器
- [x] Task 4: 创建前端详情页
- [x] SubTask 4.1: 创建 `ShortUrlDetail.tsx` 主组件(含API文档和在线测试标签页)
- [x] SubTask 4.2: 创建 `ShortUrlDetail.css` 样式文件
- [x] SubTask 4.3: 在 `App.tsx` 中添加路由
- [x] Task 5: 前端 API 集成和国际化
- [x] SubTask 5.1: 在 `request.ts` 中添加 shorturl API 方法
- [x] SubTask 5.2: 添加国际化文案(zh.json 和 en.json)
# Task Dependencies
- Task 2 依赖于 Task 1(需先有数据模型)
- Task 3 依赖于 Task 2(需先有视图才能注册路由)
- Task 4 独立,可与 Task 2/3 并行开发
- Task 5 依赖于 Task 4(需先有前端页面才能集成API)