# 经验总结模块需求说明 _位置:`backend/diary/models.py`, `frontend/index.html`_ --- ## 📋 后端模型 ### Experience 模型 ```python class Experience(models.Model): title = CharField(max_length=200) # 标题 category = CharField(choices=CATEGORY_CHOICES) # 类别 problem = TextField() # 问题描述 solution = TextField() # 解决方案 lesson_learned = TextField() # 经验教训 date = DateField() # 日期 created_at = DateTimeField() # 创建时间 ``` ### 类别选项 - `deployment` - 📦 部署 - `development` - 💻 开发 - `database` - 🗄️ 数据库 - `permission` - 🔐 权限 - `network` - 🌐 网络 - `other` - 其他 --- ## 📋 API 接口 | 接口 | 方法 | 描述 | |------|------|------| | `/api/experiences/` | GET | 获取所有经验 | | `/api/experiences/{id}/` | GET | 获取单条经验 | | `/api/experiences/` | POST | 创建经验 | | `/api/experiences/{id}/` | PUT | 更新经验 | | `/api/experiences/recent/` | GET | 最近 10 条 | | `/api/experiences/by_category/` | GET | 按类别分组 | --- ## 🎨 前端展示 ### UI 结构 ```html