---
# System prepended metadata

title: API design
tags: [tech]

---

---
tags: tech
---
[返回](https://hackmd.io/hyNEFbouQbmF4ObBrJDrLg)
# API design

#### 登录
HTTP Request Methods: POST
Route：`/login`
```json=
{
"email": "email@mail.utoronto.ca",
"password": "password"
}

```

#### 注册
HTTP Request Methods: POST
Route：`/signup`
```json =
{
"email": "email@mail.utoronto.ca",
"password": "password"
}
```

#### 发帖子
HTTP Request Methods: POST
Route：`/api/register`
```json =
{
    "category":"所属板块",
    "publisher": "发帖人ID",
    "type": "找课友/找队友(找课友0,找队友1)",
    "courseid":"课号",
    "sectionid":"课程号",
    "content": "帖子内容",
    "privacy":"(true:有隐私,false:无隐私)",
    "status": "发布状态(草稿0,发布1,失效2)",
}
```

```
后面待续
```

#### 用户个人信息
HTTP Request Methods: POST



- 显示（个人信息，历史记录，设置, 信息）
- 更改
- Log out

找课友/找队友
- 搜索
- 显示
- 加入
- 置顶
- 分辨是否为自己的帖子
`GET`

帖子
- 创建
- update
- delete

