简介

文章评论列表接口

接口地址

/api/v1/comments

请求参数

名称 必须 描述
id

文章ID

root

默认为0

根评论ID

page 页码 默认为1
limit 每页显示数量 默认为10
timestamp 当前时间戳
sign 签名结果,签名算法介绍请点击这里

返回结果

名称 描述
total 总数
last_page 最后页码
current_page 当前页面
per_page 每页显示数量
comment 商品信息
   |--id 评论ID
   |--single_id 文章ID
   |--user_id 用户ID
   |--root_id 评论根ID
   |--parent_id 评论父ID
   |--content 评论内容
   |--created_at 评论时间
   |--user 评论用户信息

 返回示例

{
    "result": {
        "total": 3,
        "last_page": 1,
        "current_page": 1,
        "per_page": 10,
        "data": [
            {
                "id": 2,
                "single_id": 121,
                "user_id": 1,
                "root_id": 1,
                "parent_id": 1,
                "content": "粤式早茶是广东省早点小吃的统称,属于粤菜。",
                "created_at": "2021-11-09 23:22:49",
                "user": {
                    "id": 1,
                    "name": "我是会员",
                    "img": null
                }
            },
            {
                "id": 3,
                "single_id": 121,
                "user_id": 5,
                "root_id": 1,
                "parent_id": 2,
                "content": "所以在广州,你一定不要错过粤式早茶,各种美味的点心绝对能够满足你的味蕾。",
                "created_at": "2021-11-09 23:23:54",
                "user": {
                    "id": 5,
                    "name": "我也是会员",
                    "img": null
                }
            },
            {
                "id": 4,
                "single_id": 121,
                "user_id": 1,
                "root_id": 1,
                "parent_id": 3,
                "content": "哈哈哈哈",
                "created_at": "2021-11-09 23:24:11",
                "user": {
                    "id": 1,
                    "name": "我是会员",
                    "img": null
                }
            }
        ]
    },
    "msg": "返回成功",
    "code": 200
}