2021-06-26 15:00:01 +08:00
|
|
|
|
# 需求与待开发功能
|
2021-07-01 20:55:52 +08:00
|
|
|
|
|
2021-06-26 15:00:01 +08:00
|
|
|
|
## FE
|
2021-07-01 20:55:52 +08:00
|
|
|
|
|
2021-06-26 15:00:01 +08:00
|
|
|
|
- [ ] group为admin特殊显示,评论接口已返回group信息
|
|
|
|
|
|
- [ ] 评论楼中楼
|
|
|
|
|
|
- [ ] 评论通知(浏览器通知)
|
|
|
|
|
|
- [ ] 最新评论(id为-1)
|
|
|
|
|
|
- [ ] 联合搜索,当本地数据库搜索不到数据时,会返回extra字段
|
|
|
|
|
|
|
|
|
|
|
|
# BE
|
2021-07-01 20:55:52 +08:00
|
|
|
|
|
2021-06-26 15:00:01 +08:00
|
|
|
|
- [ ] 添加资源API
|
|
|
|
|
|
- [x] 联合搜索:字幕侠、new字幕组、追新番
|
|
|
|
|
|
- [ ] 评论通知,需要新接口
|
|
|
|
|
|
- [ ] grafana面板
|
|
|
|
|
|
- [ ] 豆瓣接口
|
|
|
|
|
|
- [ ] 用户体系(添加邮箱,邮件支持,找回密码)
|
|
|
|
|
|
|
2021-06-15 14:34:52 +08:00
|
|
|
|
# 资源
|
|
|
|
|
|
|
|
|
|
|
|
## 获取指定id的资源
|
|
|
|
|
|
|
|
|
|
|
|
* GET `/api/resource?id=10004`
|
|
|
|
|
|
数据结构参考 [sample.json](yyetsweb/js/sample.json)
|
|
|
|
|
|
|
|
|
|
|
|
## 搜索
|
|
|
|
|
|
|
|
|
|
|
|
* GET `/api/resource?keyword=逃避`
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"data": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"info": {
|
|
|
|
|
|
"id": 34812,
|
|
|
|
|
|
"cnname": "逃避可耻却有用",
|
|
|
|
|
|
"enname": "NIGERUHA HAJIDAGA YAKUNITATSU",
|
|
|
|
|
|
"aliasname": "逃避虽可耻但有用 / 雇佣妻子(港) / 月薪娇妻(台) / 逃跑是可耻但是有用 / 逃避虽可耻但很有用 / 逃避可耻但有用",
|
|
|
|
|
|
"channel": "tv",
|
|
|
|
|
|
"channel_cn": "日剧",
|
|
|
|
|
|
"area": "日本",
|
|
|
|
|
|
"show_type": "",
|
|
|
|
|
|
"expire": "1610399344",
|
|
|
|
|
|
"views": 1201,
|
|
|
|
|
|
"year": [
|
|
|
|
|
|
2016,
|
|
|
|
|
|
2017,
|
|
|
|
|
|
2021
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"info": {
|
|
|
|
|
|
"id": 29540,
|
|
|
|
|
|
"cnname": "无法逃避",
|
|
|
|
|
|
"enname": "Inescapable",
|
|
|
|
|
|
"aliasname": "无法避免",
|
|
|
|
|
|
"channel": "movie",
|
|
|
|
|
|
"channel_cn": "电影",
|
|
|
|
|
|
"area": "加拿大",
|
|
|
|
|
|
"show_type": "",
|
|
|
|
|
|
"expire": "1610396227",
|
|
|
|
|
|
"views": 1,
|
|
|
|
|
|
"year": [
|
|
|
|
|
|
2012
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"info": {
|
|
|
|
|
|
"id": 37089,
|
|
|
|
|
|
"cnname": "逃避者",
|
|
|
|
|
|
"enname": "Shirkers",
|
|
|
|
|
|
"aliasname": "",
|
|
|
|
|
|
"channel": "movie",
|
|
|
|
|
|
"channel_cn": "电影",
|
|
|
|
|
|
"area": "美国",
|
|
|
|
|
|
"show_type": "",
|
|
|
|
|
|
"expire": "1610400512",
|
|
|
|
|
|
"views": 0,
|
|
|
|
|
|
"year": [
|
|
|
|
|
|
2018
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2021-06-26 15:00:01 +08:00
|
|
|
|
当数据库搜索不到资源时,会尝试从字幕侠、new字幕组和追新番搜索,返回如下
|
2021-06-23 18:50:32 +08:00
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"data": [],
|
2021-07-02 20:41:52 +08:00
|
|
|
|
"extra": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"url": "https://www.zimuxia.cn/portfolio/%e4%b8%9c%e5%9f%8e%e6%a2%a6%e9%ad%87",
|
|
|
|
|
|
"name": "东城梦魇",
|
|
|
|
|
|
"class": "ZimuxiaOnline"
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"url": "https://www.zimuxia.cn/portfolio/%e9%bb%91%e8%89%b2%e6%ad%a2%e8%a1%80%e9%92%b3",
|
|
|
|
|
|
"name": "黑色止血钳",
|
|
|
|
|
|
"class": "ZimuxiaOnline"
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2021-06-23 18:50:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2021-06-15 14:34:52 +08:00
|
|
|
|
# Top
|
|
|
|
|
|
|
|
|
|
|
|
获取top信息,每类返回15条访问量最高的数据
|
|
|
|
|
|
|
|
|
|
|
|
* GET `/api/top`
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"ALL": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"info": {
|
|
|
|
|
|
"id": 39894,
|
|
|
|
|
|
"cnname": "速度与激情9",
|
|
|
|
|
|
"enname": "F9: The Fast Saga",
|
|
|
|
|
|
"aliasname": "F9狂野时速(港)/玩命关头9(台)/狂野时速9/速激9/FF9/Fast & Furious 9",
|
|
|
|
|
|
"channel": "movie",
|
|
|
|
|
|
"channel_cn": "电影",
|
|
|
|
|
|
"area": "美国",
|
|
|
|
|
|
"show_type": "",
|
|
|
|
|
|
"expire": "1610401946",
|
|
|
|
|
|
"views": 47466,
|
|
|
|
|
|
"year": [
|
|
|
|
|
|
2021
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"info": {
|
|
|
|
|
|
"id": 38413,
|
|
|
|
|
|
"cnname": "致命女人",
|
|
|
|
|
|
"enname": "Why Women Kill",
|
|
|
|
|
|
"aliasname": "女人为什么杀人/女人为何杀戮",
|
|
|
|
|
|
"channel": "tv",
|
|
|
|
|
|
"channel_cn": "美剧",
|
|
|
|
|
|
"area": "美国",
|
|
|
|
|
|
"show_type": "",
|
|
|
|
|
|
"expire": "1610401185",
|
|
|
|
|
|
"views": 39040,
|
|
|
|
|
|
"year": [
|
|
|
|
|
|
2019
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"US": [],
|
|
|
|
|
|
"JP": [],
|
|
|
|
|
|
"KR": [],
|
|
|
|
|
|
"UK": [],
|
|
|
|
|
|
"class": {
|
|
|
|
|
|
"ALL": "全部",
|
|
|
|
|
|
"US": "美国",
|
|
|
|
|
|
"JP": "日本",
|
|
|
|
|
|
"KR": "韩国",
|
|
|
|
|
|
"UK": "英国"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
# 个人中心
|
|
|
|
|
|
|
|
|
|
|
|
获取个人收藏
|
|
|
|
|
|
|
2021-06-17 10:39:47 +08:00
|
|
|
|
* GET `/api/like`
|
2021-06-15 14:34:52 +08:00
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"LIKE": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"data": {
|
|
|
|
|
|
"info": {
|
|
|
|
|
|
"id": 39523,
|
|
|
|
|
|
"cnname": "禁忌女孩",
|
|
|
|
|
|
"enname": "เด็กใหม่",
|
|
|
|
|
|
"aliasname": "来路不明的转校生/Girl from Nowhere",
|
|
|
|
|
|
"channel": "tv",
|
|
|
|
|
|
"channel_cn": "泰剧",
|
|
|
|
|
|
"area": "泰国",
|
|
|
|
|
|
"show_type": "",
|
|
|
|
|
|
"expire": "1610401752",
|
|
|
|
|
|
"views": 979,
|
|
|
|
|
|
"year": [
|
|
|
|
|
|
2020
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
# 用户
|
|
|
|
|
|
|
|
|
|
|
|
## 登录或注册
|
|
|
|
|
|
|
|
|
|
|
|
* POST `/api/user`,提交json,字段 `username`, `password`
|
|
|
|
|
|
|
|
|
|
|
|
## 获取当前登录用户信息
|
|
|
|
|
|
|
|
|
|
|
|
登录用户可用,未登录会返回401
|
|
|
|
|
|
|
|
|
|
|
|
* GET `/api/user`
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"username": "Benny",
|
|
|
|
|
|
"date": "2021-03-12 11:11:11",
|
2021-06-26 15:00:01 +08:00
|
|
|
|
"lastDate": "2021-03-15 13:11:18",
|
2021-06-15 14:34:52 +08:00
|
|
|
|
"ip": "1.1.1.1",
|
2021-06-26 15:00:01 +08:00
|
|
|
|
"lastIP": "2.2.2.2",
|
2021-06-15 14:34:52 +08:00
|
|
|
|
"browser": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.85 Safari/537.36",
|
|
|
|
|
|
"like": [
|
|
|
|
|
|
11133
|
|
|
|
|
|
],
|
|
|
|
|
|
"group": [
|
|
|
|
|
|
"admin",
|
|
|
|
|
|
"user"
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
# 获取全部剧集名称
|
|
|
|
|
|
|
|
|
|
|
|
* GET `/api/name`
|
|
|
|
|
|
* GET `/api/name?human=1` 人类可读
|
|
|
|
|
|
|
|
|
|
|
|
# 添加或删除收藏
|
|
|
|
|
|
|
|
|
|
|
|
* PATCH `/api/user`,提交json,字段 `resource_id`
|
|
|
|
|
|
|
|
|
|
|
|
# 评论
|
|
|
|
|
|
|
2021-06-17 12:37:37 +08:00
|
|
|
|
评论的基本数据格式: `children` 字段为 array/list,可套娃另外一条评论,目前暂时只支持两层(也不打算支持更多的啦)。
|
|
|
|
|
|
|
|
|
|
|
|
评论的 `resource_id` 必须相同
|
|
|
|
|
|
|
|
|
|
|
|
## 普通评论
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"username": "Benny",
|
|
|
|
|
|
"date": "2021-06-17 10:54:19",
|
|
|
|
|
|
"browser": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.13; rv:85.1) Gecko/20100101 Firefox/85.1",
|
|
|
|
|
|
"content": "test",
|
|
|
|
|
|
"resource_id": 233,
|
|
|
|
|
|
"id": "60cab95baa7f515ea291392b",
|
|
|
|
|
|
"children": [
|
|
|
|
|
|
],
|
2021-07-03 11:00:27 +08:00
|
|
|
|
"childrenCount": 0
|
2021-06-17 12:37:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## 嵌套评论
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"username": "Benny",
|
|
|
|
|
|
"date": "2021-06-17 10:54:19",
|
|
|
|
|
|
"browser": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.13; rv:85.1) Gecko/20100101 Firefox/85.1",
|
|
|
|
|
|
"content": "test",
|
|
|
|
|
|
"resource_id": 233,
|
|
|
|
|
|
"id": "60cab95baa7f515ea291392b",
|
|
|
|
|
|
"children": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"username": "Alex",
|
|
|
|
|
|
"date": "2021-05-31 16:58:21",
|
|
|
|
|
|
"browser": "PostmanRuntime/7.28.0",
|
|
|
|
|
|
"content": "评论17",
|
|
|
|
|
|
"id": "60c838a12a5620b7e4ba5dfc",
|
|
|
|
|
|
"resource_id": 233
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"username": "Paul",
|
|
|
|
|
|
"date": "2021-05-22 16:58:21",
|
|
|
|
|
|
"browser": "PostmanRuntime/7.28.0",
|
|
|
|
|
|
"content": "评论14",
|
|
|
|
|
|
"id": "60c838a12a5620b7e4ba1111",
|
|
|
|
|
|
"resource_id": 233
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
2021-07-03 11:00:27 +08:00
|
|
|
|
"childrenCount": 2
|
2021-06-17 12:37:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2021-06-15 14:34:52 +08:00
|
|
|
|
## 获取评论
|
|
|
|
|
|
|
|
|
|
|
|
* GET `/api/comment`
|
|
|
|
|
|
|
|
|
|
|
|
分页,支持URL参数:
|
|
|
|
|
|
|
|
|
|
|
|
* resource_id: 资源id,id为233是留言板,id为-1会返回最新评论
|
2021-06-17 12:37:37 +08:00
|
|
|
|
* size: 每页评论数量,默认5
|
|
|
|
|
|
* page: 当前页,默认1
|
|
|
|
|
|
* inner_size: 内嵌评论数量,默认5
|
|
|
|
|
|
* inner_page: 内嵌评论当前页,默认1
|
2021-07-03 10:40:13 +08:00
|
|
|
|
**注意:如上两个inner参数是对整个页面生效的,如要进行某个父评论的子评论分页,请参考下面的子评论分页接口 返回 楼中楼评论,group表示用户所属组,admin是管理员,user是普通用户
|
2021-06-17 12:37:37 +08:00
|
|
|
|
|
2021-06-15 14:34:52 +08:00
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"data": [
|
|
|
|
|
|
{
|
2021-06-17 12:37:37 +08:00
|
|
|
|
"username": "Benny",
|
2021-06-22 20:01:10 +08:00
|
|
|
|
"date": "2021-06-22 18:26:42",
|
|
|
|
|
|
"browser": "PostmanRuntime/7.28.0",
|
|
|
|
|
|
"content": "父评论benny",
|
2021-06-17 12:37:37 +08:00
|
|
|
|
"resource_id": 233,
|
2021-06-22 20:01:10 +08:00
|
|
|
|
"type": "parent",
|
2021-06-26 15:00:01 +08:00
|
|
|
|
"id": "60d1bae2d87ce6e9a2934a0f",
|
|
|
|
|
|
"group": [
|
|
|
|
|
|
"admin"
|
|
|
|
|
|
]
|
2021-06-15 14:34:52 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2021-06-17 12:37:37 +08:00
|
|
|
|
"username": "Benny",
|
2021-06-22 20:01:10 +08:00
|
|
|
|
"date": "2021-06-22 18:24:44",
|
|
|
|
|
|
"browser": "PostmanRuntime/7.28.0",
|
|
|
|
|
|
"content": "父评论benny",
|
2021-06-17 12:37:37 +08:00
|
|
|
|
"resource_id": 233,
|
2021-06-22 20:01:10 +08:00
|
|
|
|
"type": "parent",
|
2021-06-26 15:00:01 +08:00
|
|
|
|
"group": [
|
|
|
|
|
|
"admin"
|
|
|
|
|
|
],
|
2021-07-03 11:00:27 +08:00
|
|
|
|
"childrenCount": 22,
|
2021-06-17 12:37:37 +08:00
|
|
|
|
"children": [
|
|
|
|
|
|
{
|
2021-06-26 15:00:01 +08:00
|
|
|
|
"username": "test",
|
2021-06-22 20:01:10 +08:00
|
|
|
|
"date": "2021-06-22 18:25:12",
|
2021-06-17 12:37:37 +08:00
|
|
|
|
"browser": "PostmanRuntime/7.28.0",
|
2021-06-22 20:01:10 +08:00
|
|
|
|
"content": "admin子评2论2",
|
|
|
|
|
|
"resource_id": 233,
|
|
|
|
|
|
"type": "child",
|
2021-06-26 15:00:01 +08:00
|
|
|
|
"id": "60d1ba88d87ce6e9a2934a0c",
|
|
|
|
|
|
"group": [
|
|
|
|
|
|
"user"
|
|
|
|
|
|
]
|
2021-06-17 12:37:37 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2021-06-22 20:01:10 +08:00
|
|
|
|
"username": "admin",
|
|
|
|
|
|
"date": "2021-06-22 18:25:08",
|
2021-06-17 12:37:37 +08:00
|
|
|
|
"browser": "PostmanRuntime/7.28.0",
|
2021-06-22 20:01:10 +08:00
|
|
|
|
"content": "admin子评论2",
|
|
|
|
|
|
"resource_id": 233,
|
|
|
|
|
|
"type": "child",
|
2021-06-26 15:00:01 +08:00
|
|
|
|
"id": "60d1ba84d87ce6e9a2934a0a",
|
|
|
|
|
|
"group": [
|
|
|
|
|
|
"user"
|
|
|
|
|
|
]
|
2021-06-17 12:37:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
],
|
2021-06-22 20:01:10 +08:00
|
|
|
|
"id": "60d1ba6cd87ce6e9a2934a08"
|
2021-06-15 14:34:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"count": 2,
|
2021-06-17 12:37:37 +08:00
|
|
|
|
"resource_id": 233
|
2021-06-15 14:34:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2021-07-03 10:40:13 +08:00
|
|
|
|
## 子评论分页
|
|
|
|
|
|
|
|
|
|
|
|
* GET `/api/comment/child`
|
|
|
|
|
|
URL参数:
|
|
|
|
|
|
* parent_id:父评论id
|
|
|
|
|
|
* size: 每页评论数量,默认5
|
|
|
|
|
|
* page: 当前页,默认1
|
|
|
|
|
|
|
|
|
|
|
|
`/api/comment/child?parent_id=60dfc932802d2c69cf8774ce&size=2&page=2`
|
|
|
|
|
|
|
|
|
|
|
|
返回子评论
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"data": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"username": "Benny",
|
|
|
|
|
|
"date": "2021-07-03 10:22:13",
|
|
|
|
|
|
"browser": "PostmanRuntime/7.28.1",
|
|
|
|
|
|
"content": "子15",
|
|
|
|
|
|
"resource_id": 233,
|
|
|
|
|
|
"type": "child",
|
|
|
|
|
|
"id": "60dfc9d5802d2c69cf877514",
|
2021-07-03 11:00:27 +08:00
|
|
|
|
"childrenCount": 17,
|
2021-07-03 10:40:13 +08:00
|
|
|
|
"group": [
|
|
|
|
|
|
"admin"
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
"username": "Benny",
|
|
|
|
|
|
"date": "2021-07-03 10:22:11",
|
|
|
|
|
|
"browser": "PostmanRuntime/7.28.1",
|
|
|
|
|
|
"content": "子14",
|
|
|
|
|
|
"resource_id": 233,
|
|
|
|
|
|
"type": "child",
|
|
|
|
|
|
"id": "60dfc9d3802d2c69cf877512",
|
|
|
|
|
|
"group": [
|
|
|
|
|
|
"admin"
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"count": 17
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2021-06-15 14:34:52 +08:00
|
|
|
|
## 获取验证码
|
|
|
|
|
|
|
|
|
|
|
|
* GET `/api/captcha?id=1234abc`,id是随机生成的字符串 API 返回字符串,形如 `data:image/png;base64,iVBORw0KGgoAAA....`
|
|
|
|
|
|
|
|
|
|
|
|
## 提交评论
|
|
|
|
|
|
|
|
|
|
|
|
* POST `/api/comment`
|
|
|
|
|
|
只有登录用户才可以发表评论,检查cookie `username` 是否为空来判断是否为登录用户;未登录用户提示“请登录后发表评论”
|
|
|
|
|
|
|
|
|
|
|
|
`resource_id` 从URL中获取,id是上一步验证码的那个随机字符串id, `captcha` 是用户输入的验证码
|
|
|
|
|
|
|
2021-06-17 12:37:37 +08:00
|
|
|
|
### 提交新评论
|
|
|
|
|
|
|
|
|
|
|
|
只需要提供如下四项信息即可
|
|
|
|
|
|
|
2021-06-15 14:34:52 +08:00
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"resource_id": 39301,
|
|
|
|
|
|
"content": "评论内容",
|
|
|
|
|
|
"id": "1234abc",
|
|
|
|
|
|
"captcha": "38op"
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
返回 HTTP 201添加评论成功,403/401遵循HTTP语义
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"message": "评论成功/评论失败/etc"
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2021-06-17 12:37:37 +08:00
|
|
|
|
### 提交楼中楼评论
|
|
|
|
|
|
|
|
|
|
|
|
还需要额外提供一个 `comment_id`,也就是 UUID,如 `60c838a12a5620b7e4ba5dfc`
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"resource_id": 39301,
|
|
|
|
|
|
"content": "评论内容",
|
|
|
|
|
|
"id": "1234abc",
|
|
|
|
|
|
"captcha": "38op",
|
|
|
|
|
|
"comment_id": "60c838a12a5620b7e4ba5dfc"
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2021-06-17 10:39:47 +08:00
|
|
|
|
## 删除评论,软删除
|
|
|
|
|
|
|
|
|
|
|
|
* DELETE `/api/comment`,提交json数据
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
2021-06-22 20:01:10 +08:00
|
|
|
|
"comment_id": "60cab935e9f929e09c91392a"
|
2021-06-17 10:39:47 +08:00
|
|
|
|
}
|
|
|
|
|
|
```
|
2021-06-22 20:01:10 +08:00
|
|
|
|
|
2021-06-23 18:50:32 +08:00
|
|
|
|
不用关心comment_id是子评论还是父评论,会自动删除
|
2021-06-17 10:39:47 +08:00
|
|
|
|
|
|
|
|
|
|
返回被删除的数量,HTTP 200表示删除成功,404表示未找到这条留言
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"status_code": 404,
|
|
|
|
|
|
"message": "",
|
|
|
|
|
|
"count": 0
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2021-06-15 14:34:52 +08:00
|
|
|
|
# metrics
|
|
|
|
|
|
|
|
|
|
|
|
## 添加metrics
|
|
|
|
|
|
|
|
|
|
|
|
* POST `/api/metrics`, json,字段 `type`
|
|
|
|
|
|
|
|
|
|
|
|
## 获取metrics
|
|
|
|
|
|
|
|
|
|
|
|
* GET `/api/metrics`,默认返回最近7天数据,可选URL参数 `from`, `to`,如 `from=2021-03-12&to=2021-03=18
|
|
|
|
|
|
|
|
|
|
|
|
# Grafana
|
|
|
|
|
|
|
|
|
|
|
|
* GET `/api/grafana/`
|
|
|
|
|
|
* GET `/api/grafana/search`
|
|
|
|
|
|
* GET `/api/grafana/query`
|
|
|
|
|
|
|
|
|
|
|
|
# 黑名单
|
|
|
|
|
|
|
|
|
|
|
|
* GET `/api/blacklist`
|
|
|
|
|
|
|
|
|
|
|
|
# 获取备份数据库信息
|
|
|
|
|
|
|
|
|
|
|
|
* GET `/api/db_dump`
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"yyets_mongo.gz": {
|
|
|
|
|
|
"checksum": "b32e9d8e24c607a9f29889a926c15179d9179791",
|
|
|
|
|
|
"date": "2021-06-14 12:59:51",
|
|
|
|
|
|
"size": "6.0B"
|
|
|
|
|
|
},
|
|
|
|
|
|
"yyets_mysql.zip": {
|
|
|
|
|
|
"checksum": "6b24ae7cb7cef42951f7e2df183f0825512029e0",
|
|
|
|
|
|
"date": "2021-06-14 12:59:51",
|
|
|
|
|
|
"size": "11.0B"
|
|
|
|
|
|
},
|
|
|
|
|
|
"yyets_sqlite.zip": {
|
|
|
|
|
|
"checksum": "7e1659ab5cbc98b21155c3debce3015c39f1ec05",
|
|
|
|
|
|
"date": "2021-06-14 12:59:51",
|
|
|
|
|
|
"size": "15.0B"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-06-15 17:28:17 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
# 公告
|
|
|
|
|
|
|
|
|
|
|
|
## 添加公告
|
|
|
|
|
|
|
|
|
|
|
|
* POST `/api/announcement`, json 字段 content
|
|
|
|
|
|
|
|
|
|
|
|
## 获取公告
|
|
|
|
|
|
|
|
|
|
|
|
* GET `/api/announcmement`,接受URL参数 size、page
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"data": [
|
|
|
|
|
|
{
|
|
|
|
|
|
"username": "Benny",
|
|
|
|
|
|
"date": "2021-06-15 16:28:16",
|
|
|
|
|
|
"browser": "PostmanRuntime/7.28.0",
|
|
|
|
|
|
"content": "hello"
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
"count": 1
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|