獲取討論回覆列表
獲取指定討論下的回覆列表,支持分頁。
每條回覆包含作者信息、正文(純文本)、互動數據及 reply_to_id 字段:"0" 表示頂層回覆,其他值表示對指定回覆的嵌套回覆。
CLI安裝 CLI
bash
longbridge topic-replies 6993508780031016960
longbridge topic-replies 6993508780031016960 --page 2 --size 20SDK Links
Request
| HTTP Method | GET |
| HTTP URL | /v1/content/topics/:topic_id/comments |
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| topic_id | string | YES | 討論 ID,如 6993508780031016960 |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| page | int32 | NO | 頁碼,默認 1 |
| size | int32 | NO | 每頁數量,範圍 1~50,默認 20 |
Request Example
Response
Response Headers
- Content-Type: application/json
Response Example
json
{
"code": 0,
"message": "success",
"data": {
"items": [
{
"id": "7001234567890123456",
"topic_id": "6993508780031016960",
"body": "分析得很到位!",
"reply_to_id": "0",
"author": {
"member_id": "10087",
"name": "李四",
"avatar": "https://example.com/avatar2.jpg"
},
"images": [],
"likes_count": 5,
"comments_count": 2,
"created_at": "1742001500"
}
]
}
}Response Status
| Status | Description | Schema |
|---|---|---|
| 200 | 返回成功 | topic_replies_response |
| 500 | 內部錯誤 | None |
Schemas
topic_replies_response
| Name | Type | Required | Description |
|---|---|---|---|
| items | object[] | true | 回覆列表 |
| ∟ id | string | true | 回覆 ID |
| ∟ topic_id | string | true | 所屬討論 ID |
| ∟ body | string | false | 回覆正文(純文本) |
| ∟ reply_to_id | string | false | 父回覆 ID,"0" 表示頂層回覆 |
| ∟ author | object | false | 作者信息 |
| ∟∟ member_id | string | false | 作者 member ID |
| ∟∟ name | string | false | 作者暱稱 |
| ∟∟ avatar | string | false | 作者頭像 URL |
| ∟ images | object[] | false | 附圖列表 |
| ∟∟ url | string | false | 原始圖片 URL |
| ∟∟ sm | string | false | 小縮略圖 URL |
| ∟∟ lg | string | false | 大縮略圖 URL |
| ∟ likes_count | int32 | false | 點讚數 |
| ∟ comments_count | int32 | false | 嵌套回覆數 |
| ∟ created_at | string | true | 創建時間,Unix 時間戳(秒) |