测试动态创建整体评论-2
查询合并请求中的评论列表,不分页。其中,评论仅支持三级结构。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求语法
POST /api/v4/projects/merge_requests/comments/list_comments HTTP/1.1
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| organizationId |
string |
是 |
企业标识,也称企业 id,字符串形式,可在云效访问链接中获取,如 https://devops.aliyun.com/organization/【OrganizationId】 |
60de7a6852743a5162b5f957 |
| accessToken |
string |
否 |
个人访问令牌。 使用阿里云 AK+SK 或使用 STS 临时授权方式不需要传该字段 |
f0b1e61db5961df5975a93f9129d2513 |
| repositoryIdentity |
string |
是 |
代码库 ID 或者全路径 |
2835387 或 codeup/codeup-demo |
| localId |
integer |
是 |
合并请求局部 ID,表示代码库下的第几个合并请求 |
10 |
| body |
object |
否 |
请求 Body |
|
| patchSetBizIds |
array |
否 |
版本业务 ID 列表 说明
每个评论会关联一个版本,表示该评论发表在第几个版本,其中对于全局评论,关联的是最新的合并源版本。 |
|
|
string |
否 |
版本业务 ID |
5e733626d53f4b04a6aa0e23d4ff72b8 |
|
| commentType |
string |
否 |
评论类型
|
GLOBAL_COMMENT |
| filePath |
string |
否 |
文件路径 |
/src/main/test.java |
| state |
string |
否 |
评论状态
|
OPENED |
| resolved |
boolean |
否 |
是否已解决 |
false |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| requestId |
string |
请求 ID |
56C33A95-C04F-59F0-B3CD-E2A2EB9FADBB |
| success |
boolean |
调用是否成功 |
true |
| errorCode |
string |
错误码 |
Openapi.RequestError |
| errorMessage |
string |
错误信息 |
"" |
| result |
array<object> |
返回结果列表 |
|
|
array<object> |
返回结果 重要 评论对象,仅支持三层结构;若使用了超过三层结构的评论,将不会返回相应的数据。 |
||
| commentBizId |
string |
评论唯一业务 ID |
5c399e3685e542a28db16d93e9f82abb |
| commentType |
string |
评论类型
|
GLOBAL_COMMENT |
| state |
string |
评论状态
|
OPENED |
| resolved |
boolean |
是否已解决 |
false |
| deleted |
boolean |
是否已经删除 |
false |
| commentTime |
string |
评论时间,格式为 YYYY-MM-DD HH:mm:ss。 |
2022-03-18 14:24:54 |
| lastEditTime |
string |
上次编辑时间,格式为 YYYY-MM-DD HH:mm:ss。 |
2022-03-18 14:24:54 |
| content |
string |
评论内容,返回数据为富文本内容 |
{\"htmlValue\":\" |
| author |
object |
评论人信息 |
|
| aliyunPk |
string |
阿里云账号 ID |
284692704493684695 |
| name |
string |
用户名称 |
codeup |
| username |
string |
用户登录名 |
test-codeup |
| state |
string |
用户状态
|
active |
| avatarUrl |
string |
头像地址 |
https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100 |
|
string |
用户邮箱 |
username@example.com |
|
| id |
integer |
主键 ID,无业务实义 |
19230 |
| relatedPatchSet |
object |
关联的版本信息 |
|
| patchSetNo |
string |
版本号 |
1 |
| patchSetBizId |
string |
版本的唯一业务 ID |
513fcfd81a9142d2bb0db4f72c0aa15b |
| patchSetName |
string |
版本名称 |
版本1 |
| commitId |
string |
版本关联的提交 ID |
1a072f5367c21f9de3464b8c0ee8546e47764d2d |
| shortId |
string |
简短的提交 ID |
1a072f53 |
| relatedMergeItemType |
string |
关联的合并类型
|
MERGE_SOURCE |
| createdAt |
string |
创建时间,格式为 YYYY-MM-DD HH:mm:ss。 |
2022-03-18 14:24:54 |
| lineNumber |
string |
评论所在的文件行号,仅文件行内评论才有 |
3 |
| filePath |
string |
文件路径 |
src/main/test.java |
| parentCommentBizId |
string |
父评论业务 ID |
4c5dcec6a8dc41e69c369737dadc1841 |
| rootCommentBizId |
string |
根评论业务 ID |
dcf2b23cebfc418f98dbd35e423d9fd3 |
| childComments |
array<object> |
子评论列表 |
|
|
array<object> |
子评论信息 |
||
| commentBizId |
string |
评论唯一业务 ID |
63f0e293357f48f9846ddc4dbbebd0e3 |
| commentType |
string |
评论类型
|
GLOBAL_COMMENT |
| state |
string |
评论状态
|
OPENED |
| resolved |
boolean |
是否已解决 |
false |
| deleted |
boolean |
是否已经删除 |
false |
| commentTime |
string |
评论时间,格式为 YYYY-MM-DD HH:mm:ss。 |
2022-03-18 14:24:54 |
| lastEditTime |
string |
上次编辑时间,格式为 YYYY-MM-DD HH:mm:ss。 |
2022-03-18 14:24:54 |
| content |
string |
评论内容,返回数据为富文本内容 |
{\"htmlValue\":\" 测试动态创建整体评论-2 \",\"jsonMLValue\":[\"root\",{},[\"p\",{},[\"span\",{\"data-type\":\"text\"},[\"span\",{\"data-type\":\"leaf\"},\"测试动态创建整体评论-2\"]]]]} |
| author |
object |
评论人信息 |
|
| aliyunPk |
string |
阿里云账号 ID |
204485087002425236 |
| name |
string |
用户名称 |
codeup |
| username |
string |
用户登录名 |
test-codeup |
| state |
string |
用户状态
|
active |
| avatarUrl |
string |
头像地址 |
https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100 |
|
string |
用户邮箱 |
username@example.com |
|
| id |
integer |
主键 ID,无业务实义 |
132582 |
| relatedPatchSet |
object |
关联的版本信息 |
|
| patchSetNo |
string |
版本号 |
1 |
| patchSetBizId |
string |
版本的唯一业务 ID |
513fcfd81a9142d2bb0db4f72c0aa15b |
| patchSetName |
string |
版本名称 |
版本1 |
| commitId |
string |
版本关联的提交 ID |
1a072f5367c21f9de3464b8c0ee8546e47764d2d |
| shortId |
string |
简短的提交 ID |
1a072f53 |
| relatedMergeItemType |
string |
关联的合并类型
|
MERGE_SOURCE |
| createdAt |
string |
创建时间,格式为 YYYY-MM-DD HH:mm:ss。 |
2022-03-18 14:24:54 |
| lineNumber |
string |
评论所在的文件行号,仅文件行内评论才有 |
3 |
| filePath |
string |
文件路径 |
src/main/test.java |
| parentCommentBizId |
string |
父评论业务 ID |
5c399e3685e542a28db16d93e9f82abb |
| rootCommentBizId |
string |
父评论业务 ID |
dcf2b23cebfc418f98dbd35e423d9fd3 |
| finalChildComments |
array<object> |
最后层级子评论列表 |
|
|
array<object> |
评论信息 |
||
| commentBizId |
string |
评论唯一业务 ID |
5c399e3685e542a28db16d93e9f82abb |
| commentType |
string |
评论类型
|
GLOBAL_COMMENT |
| state |
string |
评论状态
|
OPENED |
| resolved |
boolean |
是否已解决 |
false |
| deleted |
boolean |
是否已经删除 |
false |
| commentTime |
string |
评论时间,格式为 YYYY-MM-DD HH:mm:ss。 |
2022-03-18 14:24:54 |
| lastEditTime |
string |
上次编辑时间,格式为 YYYY-MM-DD HH:mm:ss。 |
2022-03-18 14:24:54 |
| content |
string |
评论内容,返回数据为富文本内容 |
{\"htmlValue\":\" 测试动态创建整体评论-2 \",\"jsonMLValue\":[\"root\",{},[\"p\",{},[\"span\",{\"data-type\":\"text\"},[\"span\",{\"data-type\":\"leaf\"},\"测试动态创建整体评论-2\"]]]]} |
| author |
object |
评论人信息 |
|
| aliyunPk |
string |
阿里云账号 ID |
235671547828975455 |
| name |
string |
用户名称 |
codeup |
| username |
string |
用户登录名 |
test-codeup |
| state |
string |
用户状态
|
active |
| avatarUrl |
string |
头像地址 |
https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100 |
|
string |
用户邮箱 |
username@example.com |
|
| id |
integer |
主键 ID,无业务实义 |
567035 |
| relatedPatchSet |
object |
关联的版本信息 |
|
| patchSetNo |
string |
版本号 |
1 |
| patchSetBizId |
string |
版本的唯一业务 ID |
513fcfd81a9142d2bb0db4f72c0aa15b |
| patchSetName |
string |
版本名称 |
版本1 |
| commitId |
string |
版本关联的提交 ID |
1a072f5367c21f9de3464b8c0ee8546e47764d2d |
| shortId |
string |
简短的提交 ID |
1a072f53 |
| relatedMergeItemType |
string |
关联的合并类型
|
MERGE_SOURCE |
| createdAt |
string |
创建时间,格式为 YYYY-MM-DD HH:mm:ss。 |
2022-03-18 14:24:54 |
| lineNumber |
string |
评论所在的文件行号,仅文件行内评论才有 |
3 |
| filePath |
string |
文件路径 |
src/main/test.java |
| parentCommentBizId |
string |
父评论业务 ID |
4c5dcec6a8dc41e69c369737dadc1841 |
| rootCommentBizId |
string |
根评论业务 ID |
dcf2b23cebfc418f98dbd35e423d9fd3 |
示例
正常返回示例
JSON格式
{
"requestId": "56C33A95-C04F-59F0-B3CD-E2A2EB9FADBB",
"success": true,
"errorCode": "Openapi.RequestError",
"errorMessage": "\"\"",
"result": [
{
"commentBizId": "5c399e3685e542a28db16d93e9f82abb",
"commentType": "GLOBAL_COMMENT",
"state": "OPENED",
"resolved": false,
"deleted": false,
"commentTime": "2022-03-18 14:24:54\n",
"lastEditTime": "2022-03-18 14:24:54\n",
"content": "{\\\"htmlValue\\\":\\\"
测试动态创建整体评论-2\\\",\\\"jsonMLValue\\\":[\\\"root\\\",{},[\\\"p\\\",{},[\\\"span\\\",{\\\"data-type\\\":\\\"text\\\"},[\\\"span\\\",{\\\"data-type\\\":\\\"leaf\\\"},\\\"测试动态创建整体评论-2\\\"]]]]}",
"author": {
"aliyunPk": "284692704493684695",
"name": "codeup",
"username": "test-codeup",
"state": "active",
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"email": "username@example.com",
"id": 19230
},
"relatedPatchSet": {
"patchSetNo": "1",
"patchSetBizId": "513fcfd81a9142d2bb0db4f72c0aa15b",
"patchSetName": "版本1",
"commitId": "1a072f5367c21f9de3464b8c0ee8546e47764d2d",
"shortId": "1a072f53",
"relatedMergeItemType": "MERGE_SOURCE",
"createdAt": "2022-03-18 14:24:54\n"
},
"lineNumber": "3",
"filePath": "src/main/test.java",
"parentCommentBizId": "4c5dcec6a8dc41e69c369737dadc1841",
"rootCommentBizId": "dcf2b23cebfc418f98dbd35e423d9fd3",
"childComments": [
{
"commentBizId": "63f0e293357f48f9846ddc4dbbebd0e3",
"commentType": "GLOBAL_COMMENT",
"state": "OPENED",
"resolved": false,
"deleted": false,
"commentTime": "2022-03-18 14:24:54",
"lastEditTime": "2022-03-18 14:24:54",
"content": "{\\\"htmlValue\\\":\\\"\n测试动态创建整体评论-2\n\n\\\",\\\"jsonMLValue\\\":[\\\"root\\\",{},[\\\"p\\\",{},[\\\"span\\\",{\\\"data-type\\\":\\\"text\\\"},[\\\"span\\\",{\\\"data-type\\\":\\\"leaf\\\"},\\\"测试动态创建整体评论-2\\\"]]]]}",
"author": {
"aliyunPk": "204485087002425236",
"name": "codeup",
"username": "test-codeup",
"state": "active",
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"email": "username@example.com\n",
"id": 132582
},
"relatedPatchSet": {
"patchSetNo": "1",
"patchSetBizId": "513fcfd81a9142d2bb0db4f72c0aa15b",
"patchSetName": "版本1\n",
"commitId": "1a072f5367c21f9de3464b8c0ee8546e47764d2d",
"shortId": "1a072f53",
"relatedMergeItemType": "MERGE_SOURCE",
"createdAt": "2022-03-18 14:24:54\n"
},
"lineNumber": "3",
"filePath": "src/main/test.java\n",
"parentCommentBizId": "5c399e3685e542a28db16d93e9f82abb",
"rootCommentBizId": "dcf2b23cebfc418f98dbd35e423d9fd3",
"finalChildComments": [
{
"commentBizId": "5c399e3685e542a28db16d93e9f82abb",
"commentType": "GLOBAL_COMMENT",
"state": "OPENED",
"resolved": false,
"deleted": false,
"commentTime": "2022-03-18 14:24:54",
"lastEditTime": "2022-03-18 14:24:54",
"content": "{\\\"htmlValue\\\":\\\"\n测试动态创建整体评论-2\n\n\\\",\\\"jsonMLValue\\\":[\\\"root\\\",{},[\\\"p\\\",{},[\\\"span\\\",{\\\"data-type\\\":\\\"text\\\"},[\\\"span\\\",{\\\"data-type\\\":\\\"leaf\\\"},\\\"测试动态创建整体评论-2\\\"]]]]}",
"author": {
"aliyunPk": "235671547828975455",
"name": "codeup",
"username": "test-codeup",
"state": "active",
"avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100",
"email": "username@example.com\n",
"id": 567035
},
"relatedPatchSet": {
"patchSetNo": "1",
"patchSetBizId": "513fcfd81a9142d2bb0db4f72c0aa15b",
"patchSetName": "版本1",
"commitId": "1a072f5367c21f9de3464b8c0ee8546e47764d2d",
"shortId": "1a072f53",
"relatedMergeItemType": "MERGE_SOURCE",
"createdAt": "2022-03-18 14:24:54"
},
"lineNumber": "3",
"filePath": "src/main/test.java",
"parentCommentBizId": "4c5dcec6a8dc41e69c369737dadc1841",
"rootCommentBizId": "dcf2b23cebfc418f98dbd35e423d9fd3\n"
}
]
}
]
}
]
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。