Appearance
/api/v1/comment/video/getComment?vid=视频ID&page=页码&pageSize=内容数量
{ "code": 200, "data": { "total": 1, "comments": [ { "id": 1, "createdAt": "2022-06-20T13:42:40.625Z", "uid": 1, "content": "测试", "atUsernames": "", "atUserIds": "", "parentId": "", "replyCount": 2, "author": { "uid": 1, "name": "", "sign": "", "email": "", "phone": "", "avatar": "", "gender": 1, "spaceCover": "", "birthday": "", "createdAt": "", }, "reply": [ { "id": 1, "createdAt": "2022-06-20T13:42:40.625Z", "uid": 1, "content": "测试", "atUsernames": "", "atUserIds": "", "replyUserId": "", "replyUserName": "", "parentId": "", "author": { "uid": 1, "name": "", "sign": "", "email": "", "phone": "", "avatar": "", "gender": 1, "spaceCover": "", "birthday": "", "createdAt": "", }, } ] } ] }, "msg": "ok" }
,
atUsernames
该接口返回的total为评论和回复总数,而评论和回复是树结构的,因此返回的总数无法用于列表的分页
/api/v1/comment/video/getReply?commentId=评论ID&page=页码&pageSize=内容数量
{ "code": 200, "data": { "replies": [ { "id": 1, "createdAt": "2022-06-20T13:42:40.625Z", "uid": 1, "content": "测试", "atUsernames": "", "atUserIds": "", "replyUserId": "", "replyUserName": "", "parentId": "", "author": { "uid": 1, "name": "", "sign": "", "email": "", "phone": "", "avatar": "", "gender": 1, "spaceCover": "", "birthday": "", "createdAt": "", }, } ] }, "msg": "ok" }
无
/api/v1/comment/video/addComment
Authorization': token
"content-type": "application/json",
{ "code": 200, "data": { "comment": { "id": 1, "createdAt": "2022-06-20T13:42:40.625Z", "uid": 1, "content": "测试", "atUsernames": "", "atUserIds": "", "replyUserId": "", "replyUserName": "", "parentId": "", } }, "msg": "ok" }
/api/v1/comment/video/deleteComment/评论或回复ID
{ "code": 200, "data": null, "msg":"ok" }
/api/v1/comment/video/getCommentList?vid=视频ID&page=页码&pageSize=内容数量
{ "code": 200, "data": { "total": 1, "comments": [ { "id": 1, "cid": 1, "sid": 1, "uid": 1, "createdAt": "2022-06-20T13:42:40.625Z", "content": "测试", "targetReplyContent": "", "rootContent": "", "commentId": 1, "parentId": "", "author": { "uid": 1, "name": "", "sign": "", "email": "", "phone": "", "avatar": "", "gender": 1, "spaceCover": "", "birthday": "", "createdAt": "", }, "target": { "uid": 2, "name": "", "sign": "", "email": "", "phone": "", "avatar": "", "gender": 1, "spaceCover": "", "birthday": "", "createdAt": "", }, "video": { "vid": 1, "uid": 1, "title": "标题", "cover": "封面url", "desc": "视频简介", "createdAt": "", "copyright": true, "tags": "", "duration": 10, "clicks": 10, "partitionId": 1, "author": { "uid": 1, "name": "", "sign": "", "email": "", "phone": "", "avatar": "", "gender": 1, "spaceCover": "", "birthday": "", "createdAt": "", }, "resources": [ { "id": 1, "createdAt": "", "vid": 1, "title": "", "duration": 10, "status": 0 } ] } } ] }, "msg": "ok" }
评论回复相关接口
获取评论回复
请求URL
/api/v1/comment/video/getComment?vid=视频ID&page=页码&pageSize=内容数量
请求方式
返回示例
返回参数说明
评论comment
,
分隔,
分隔 ,与atUsernames
中的顺序一致回复reply
,
分隔,
分隔 ,与atUsernames
中的顺序一致作者信息author
备注
该接口返回的total为评论和回复总数,而评论和回复是树结构的,因此返回的总数无法用于列表的分页
获取回复详情
请求URL
/api/v1/comment/video/getReply?commentId=评论ID&page=页码&pageSize=内容数量
请求方式
返回示例
返回参数说明
回复reply
,
分隔,
分隔 ,与atUsernames
中的顺序一致作者信息author
备注
无
发布评论回复
请求URL
/api/v1/comment/video/addComment
请求方式
请求头
Authorization': token
"content-type": "application/json",
参数
返回示例
返回参数说明
,
分隔,
分隔 ,与atUsernames
中的顺序一致备注
无
删除评论
请求URL
/api/v1/comment/video/deleteComment/评论或回复ID
请求方式
请求头
Authorization': token
"content-type": "application/json",
返回示例
备注
无
获取评论列表
请求URL
/api/v1/comment/video/getCommentList?vid=视频ID&page=页码&pageSize=内容数量
请求方式
返回示例
返回参数说明
评论comment
作者信息author
视频信息video
视频资源resource
备注
无