71a6bc4aa4
- 分类管理:支持分类的增删改查 - 单词管理:支持单词的增删改查,包含音标、释义、例句等字段 - 更新 README 项目说明 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
51 lines
779 B
Markdown
51 lines
779 B
Markdown
# Language Backend
|
|
|
|
Go + PostgreSQL 实现的语言学习后台服务。
|
|
|
|
## 快速开始
|
|
|
|
```bash
|
|
cd backend
|
|
|
|
# 启动开发环境(热重载)
|
|
make dev
|
|
|
|
# 数据库迁移
|
|
make migrate
|
|
|
|
# 重新生成 sqlc 代码
|
|
make sqlc
|
|
|
|
# 运行测试
|
|
make test
|
|
```
|
|
|
|
## 开发端口
|
|
|
|
- API: http://localhost:8080
|
|
- PostgreSQL: localhost:5432
|
|
|
|
## API 文档
|
|
|
|
接口以 `/api/v1` 为前缀。
|
|
|
|
### Categories
|
|
|
|
- `GET /api/v1/categories`
|
|
- `POST /api/v1/categories`
|
|
- `GET /api/v1/categories/:id`
|
|
- `PUT /api/v1/categories/:id`
|
|
- `DELETE /api/v1/categories/:id`
|
|
|
|
### Words
|
|
|
|
- `GET /api/v1/words`
|
|
- `POST /api/v1/words`
|
|
- `GET /api/v1/words/:id`
|
|
- `PUT /api/v1/words/:id`
|
|
- `DELETE /api/v1/words/:id`
|
|
|
|
## 环境变量
|
|
|
|
复制 `.env.example` 为 `.env` 并按需修改。
|