动态/空间模块
控制层 TypechoSpaceController @author buxia97 @date 2023/02/05
类路径:SpaceController
前缀:/typechoSpace
1. addSpace
接口路径:GET/POST /typechoSpace/addSpace
权限:需要登录(普通用户及以上)
接口说明:添加动态
请求参数:
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| text | String | 否 | - | |
| type | Integer | 否 | 0 | |
| toid | Integer | 否 | 0 | |
| pic | String | 否 | - | |
| onlyMe | Integer | 否 | 0 | |
| token | String | 否 | - | |
| verifyCode | String | 否 | - |
响应说明:
{
"code": 1,
"msg": "",
"data": ...
}
前端调用参考:
- 前端调用:this.$API.addSpace() (https://api.ruletree.club/typechoSpace/addSpace)
2. editSpace
接口路径:GET/POST /typechoSpace/editSpace
权限:需要登录(普通用户及以上)
接口说明:修改动态
请求参数:
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| id | Integer | 否 | - | |
| text | String | 否 | - | |
| type | Integer | 否 | 0 | |
| toid | Integer | 否 | 0 | |
| pic | String | 否 | - | |
| onlyMe | Integer | 否 | 0 | |
| token | String | 否 | - |
响应说明:
{
"code": 1,
"msg": "",
"data": ...
}
前端调用参考:
- 前端调用:this.$API.editSpace() (https://api.ruletree.club/typechoSpace/editSpace)
3. spaceReview
接口路径:GET/POST /typechoSpace/spaceReview
权限:需要管理员或编辑权限
接口说明:动态审核
请求参数:
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| id | Integer | 否 | - | |
| type | Integer | 否 | 1 | |
| token | String | 否 | - |
响应说明:
{
"code": 1,
"msg": "",
"data": ...
}
前端调用参考:
- 前端调用:this.$API.spaceReview() (https://api.ruletree.club/typechoSpace/spaceReview)
4. postLock
接口路径:GET/POST /typechoSpace/spaceLock
权限:需要管理员或编辑权限
接口说明:动态锁定&解锁
请求参数:
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| id | Integer | 否 | - | |
| type | Integer | 否 | 1 | |
| token | String | 否 | - |
响应说明:
{
"code": 1,
"msg": "",
"data": ...
}
前端调用参考:
- 前端调用:this.$API.spaceLock() (https://api.ruletree.club/typechoSpace/spaceLock)
5. spaceInfo
接口路径:GET/POST /typechoSpace/spaceInfo
权限:公开接口;但当系统配置 isLogin=1 时会强制要求登录
接口说明:获取动态详情
请求参数:
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| id | Integer | 否 | - | |
| token | String | 否 | - |
响应说明:
{
"code": 1,
"msg": "",
"data": ...
}
前端调用参考:
- 前端调用:this.$API.spaceInfo() (https://api.ruletree.club/typechoSpace/spaceInfo)
6. spaceList
接口路径:GET/POST /typechoSpace/spaceList
权限:公开接口;但当系统配置 isLogin=1 时会强制要求登录
接口说明:动态列表
请求参数:
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| searchParams | String(JSON 字符串,需后端解析) | 否 | - | JSON 字符串,需后端解析 |
| page | Integer | 否 | 1 | |
| limit | Integer | 否 | 15 | |
| searchKey | String | 否 | - | |
| order | String | 否 | created | |
| isManage | Integer | 否 | 0 | |
| token | String | 否 | - |
响应说明:
{
"code": 1,
"msg": "",
"data": ...
}
前端调用参考:
- 前端调用:this.$API.spaceList() (https://api.ruletree.club/typechoSpace/spaceList)
7. spaceDelete
接口路径:GET/POST /typechoSpace/spaceDelete
权限:需要管理员或编辑权限
接口说明:动态删除
请求参数:
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| id | String | 否 | - | |
| token | String | 否 | - |
响应说明:
{
"code": 1,
"msg": "",
"data": ...
}
前端调用参考:
- 前端调用:this.$API.spaceDelete() (https://api.ruletree.club/typechoSpace/spaceDelete)
8. spaceLikes
接口路径:GET/POST /typechoSpace/spaceLikes
权限:需要登录(普通用户及以上)
接口说明:动态点赞
请求参数:
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| id | Integer | 否 | - | |
| token | String | 否 | - |
响应说明:
{
"code": 1,
"msg": "",
"data": ...
}
前端调用参考:
- 前端调用:this.$API.spaceLikes() (https://api.ruletree.club/typechoSpace/spaceLikes)
9. followSpace
接口路径:GET/POST /typechoSpace/followSpace
权限:需要登录(普通用户及以上)
接口说明:我关注的人的动态
请求参数:
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| token | String | 否 | - | |
| page | Integer | 否 | 1 | |
| limit | Integer | 否 | 15 |
响应说明:
{
"code": 1,
"msg": "",
"data": ...
}
前端调用参考:
- 前端调用:this.$API.follow() (https://api.ruletree.club/typechoUsers/follow)
- 前端调用:this.$API.followSpace() (https://api.ruletree.club/typechoSpace/followSpace)