中文
Appearance
按待办事项的线程评论。所有端点需要身份验证和团队成员身份。评论权限根据团队的权限配置进行检查。
GET /api/teams/:teamId/todos/:todoId/comments
列出待办事项的所有评论,按 createdAt 升序排列(最早的在最前)。
createdAt
需要身份验证: 是 — 团队成员且对该分组拥有 view_todos 权限
view_todos
路径参数:
teamId
todoId
响应:
{ "comments": [ { "id": "uuid", "userId": "user-uuid", "username": "alice", "displayName": "Alice Chen", "avatarUrl": "https://id.example.com/avatars/alice.png", "body": "看起来不错!", "createdAt": "2026-03-17T14:30:00.000Z" }, { "id": "uuid-2", "userId": "user-uuid-2", "username": "bob", "displayName": "Bob Smith", "avatarUrl": "", "body": "我来处理部署。", "createdAt": "2026-03-17T15:00:00.000Z" } ] }
comments[].id
comments[].userId
comments[].username
comments[].displayName
comments[].avatarUrl
comments[].body
comments[].createdAt
错误响应:
error
401
"Unauthorized"
403
"Forbidden"
404
"Todo not found"
POST /api/teams/:teamId/todos/:todoId/comments
向待办事项添加新评论。
需要身份验证: 是 — comment 权限
comment
请求体:
{ "body": "看起来不错!" }
body
响应(201):
{ "comment": { "id": "new-uuid", "userId": "user-uuid", "username": "alice", "displayName": "Alice Chen", "avatarUrl": "https://id.example.com/avatars/alice.png", "body": "看起来不错!", "createdAt": "2026-03-17T14:30:00.000Z" } }
400
"Body is required"
DELETE /api/teams/:teamId/todos/:todoId/comments/:commentId
删除评论。你始终可以删除自己的评论;删除他人的评论需要 delete_any_comment 权限。
delete_any_comment
需要身份验证: 是 — delete_own_comments(自己的评论)或 delete_any_comment(他人的评论)
delete_own_comments
commentId
{ "ok": true }
"Comment not found"
评论 API
按待办事项的线程评论。所有端点需要身份验证和团队成员身份。评论权限根据团队的权限配置进行检查。
GET /api/teams/:teamId/todos/:todoId/comments列出待办事项的所有评论,按
createdAt升序排列(最早的在最前)。需要身份验证: 是 — 团队成员且对该分组拥有
view_todos权限路径参数:
teamIdtodoId响应:
comments[].idcomments[].userIdcomments[].usernamecomments[].displayNamecomments[].avatarUrlcomments[].bodycomments[].createdAt错误响应:
error401"Unauthorized"403"Forbidden"view_todos权限已被撤销。404"Todo not found"POST /api/teams/:teamId/todos/:todoId/comments向待办事项添加新评论。
需要身份验证: 是 —
comment权限请求体:
body响应(201):
错误响应:
error400"Body is required"body缺失或为空。403"Forbidden"comment权限。404"Todo not found"DELETE /api/teams/:teamId/todos/:todoId/comments/:commentId删除评论。你始终可以删除自己的评论;删除他人的评论需要
delete_any_comment权限。需要身份验证: 是 —
delete_own_comments(自己的评论)或delete_any_comment(他人的评论)路径参数:
commentId响应:
错误响应:
error403"Forbidden"delete_any_comment权限。404"Comment not found"