Files
score-backend/README.md

47 lines
982 B
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.
# 个人媒体记录应用 - 后端
这是一个使用 Flask 和 SQLite 构建的后端服务,用于管理个人媒体记录(游戏、书籍、电影、番剧等)。
## 环境要求
- Python 3.8+
- pipPython 包管理器)
## 安装步骤
1. 创建虚拟环境(推荐):
```bash
python -m venv venv
source venv/bin/activate # 在 Windows 上使用 venv\Scripts\activate
```
2. 安装依赖:
```bash
pip install -r requirements.txt
```
## 运行服务
```bash
python app.py
```
服务将在 http://localhost:5000 上运行。
## API 端点
- GET /api/media - 获取所有媒体记录
- POST /api/media - 创建新的媒体记录
- PUT /api/media/<id> - 更新指定 ID 的媒体记录
- DELETE /api/media/<id> - 删除指定 ID 的媒体记录
## 数据模型
Media 模型包含以下字段:
- id: 主键
- title: 标题
- type: 类型game/book/movie/anime
- rating: 评分
- notes: 笔记
- created_at: 创建时间
- updated_at: 更新时间