21 lines
749 B
Markdown
21 lines
749 B
Markdown
|
|
# DV-0003:文档编辑与文件操作 – 设计(Design)
|
|||
|
|
|
|||
|
|
## 上下文
|
|||
|
|
`files.py`(API)、`storage.py`(读写)、前端 `DocumentPage/DocumentEditor`(pages/Document)、Markdown 组件 bytemd。
|
|||
|
|
|
|||
|
|
## 接口设计
|
|||
|
|
- GET /api/v1/files/{project_id}/tree
|
|||
|
|
- GET|POST /api/v1/files/{project_id}/file
|
|||
|
|
- POST /api/v1/files/{project_id}/file/operate
|
|||
|
|
- POST /api/v1/files/{project_id}/upload{,-document}
|
|||
|
|
- POST /api/v1/files/{project_id}/import-documents
|
|||
|
|
- GET /api/v1/files/{project_id}/export-directory
|
|||
|
|
- GET /api/v1/files/{project_id}/export-pdf
|
|||
|
|
|
|||
|
|
## 前端
|
|||
|
|
- 左侧目录树,右侧 Markdown 编辑/预览;PDF 用 react-pdf;长列表虚拟滚动。
|
|||
|
|
|
|||
|
|
## 状态与降级
|
|||
|
|
- 写文件自动创建父目录;重命名目标冲突→400。
|
|||
|
|
|