Mikiacg

评论

三种内容类型(视频、游戏、图片)各有独立的评论接口,结构相同,仅路由名和关联 ID 字段不同。

内容类型路由前缀关联字段
视频commentvideoId
游戏gameCommentgameId
图片imagePostCommentimagePostId

以下以视频评论 comment.* 为例,游戏和图片接口结构一致。


获取评论列表

POST/api/trpc/comment.list公开
参数类型必填说明
videoIdstring视频 ID(游戏用 gameId,图片用 imagePostId
sortstring排序:newest / oldest / popular
cursorstring分页游标
limitnumber每页数量

获取回复

POST/api/trpc/comment.getReplies公开
参数类型必填说明
commentIdstring父评论 ID
cursorstring分页游标
limitnumber每页数量

获取评论数

POST/api/trpc/comment.getCount公开
参数类型必填说明
videoIdstring内容 ID

发表评论

POST/api/trpc/comment.create公开comment:write

部分站点配置需要登录才能评论,未登录时可能返回 UNAUTHORIZED

参数类型必填说明
videoIdstring内容 ID
contentstring评论内容
parentIdstring父评论 ID(用于回复)
replyToUserIdstring回复的用户 ID

编辑评论

POST/api/trpc/comment.update需登录comment:write
参数类型必填说明
idstring评论 ID
contentstring新内容

删除评论

POST/api/trpc/comment.delete需登录comment:write
参数类型必填说明
idstring评论 ID

评论互动

POST/api/trpc/comment.react需登录comment:write
参数类型必填说明
commentIdstring评论 ID
isLikeboolean | nulltrue 点赞 / false 点踩 / null 取消

置顶评论

POST/api/trpc/comment.pin需登录comment:write

仅内容上传者或管理员可操作。

参数类型必填说明
commentIdstring评论 ID
isPinnedboolean是否置顶

最近评论

POST/api/trpc/comment.listRecent公开

全站最近评论,按时间倒序。

参数类型必填说明
pagenumber页码
limitnumber每页数量

命令面板

快速导航和操作