|
|
пре 6 година | |
|---|---|---|
| .vscode | пре 6 година | |
| api | пре 6 година | |
| serializer | пре 6 година | |
| .gitignore | пре 7 година | |
| README.md | пре 6 година |
集中前后端 api
[模块英文命名]-[解释].md
example: User-用户.md
# 命名
> url 前缀:**user**
>
> 示例:**https://xxxxxxxxx/api/user/xxxx**
## 请求名称
⬇️ 为路径参数格式 :userId 表示变量
```http
post /:userId
```
### Parameters
⬇️ 为 post body 中的参数格式
```json
{
"nickname": "nickname",
"avatar": "xxxxxxxxxx",
"bio": "小白白白白白白白白白白白"
}
```
⬇️ 为问号传参格式 example: user?userId=1
| Name | Type | Description |
| ------ | ------ | ------------------ |
| userId | number | 查看用户的所有 tag |
### Response
```json
{
"res": UserSerializer
}
```
see [UserSerializer](./user/serializer/UserSerializer.md)
## 请求名称
etc...
example
# UserSerializer
用户的基本信息
## Attributes
- id : **Number** - 用户 id
- role : **String** - 身份类型 [ STUDENT - 学生用户, TEACHER - 教师用户]
- username : **String** - 用户名
- nickname : **String** - 昵称
- bio : **String **- 用户自我描述
- avatar : **String** - 头像 URL
- createdAt : **String** - 创建时间
- updatedAt : **String** - 更新时间