帖子 评论

优质
小牛编辑
143浏览
2023-12-01

帖子评论列表

get /group-posts/:post/comments

响应

status 200

参数说明

名称类型说明
limitinteger默认 20 ,数据返回条数 默认为20
afterinegter可选,上次获取到数据最后一条 ID,用于获取该 ID 之后的数据。
{
  "pinneds": [],// 置顶评论列表,同comments结构一样
  "comments": [ // 帖子评论
    {
      "id": 65, // 评论唯一id
      "user_id": 1,//评论人id
      "target_user": 1,// 目标用户
      "reply_user": 0,// 回复的用户
      "body": "测试", // 内容
      "commentable_id": 121,// 资源id
      "commentable_type": "group-posts",// 资源类型
      "created_at": "2017-11-30 03:04:03",
      "updated_at": "2017-11-30 03:04:03",
      "user": {// 回复用户信息
        "id": 1,
        "name": "admin",
        "bio": null,
        "sex": 2,
        "location": "四川省 巴中市 南江县",
        "created_at": "2017-10-23 01:17:34",
        "updated_at": "2017-11-15 07:36:17",
        "avatar": "http://thinksns-plus.dev/api/v2/users/1/avatar",
        "bg": null,
        "verified": {
          "type": "user",
          "icon": "https://www.xnip.cn/wp-content/uploads/2021/docimg15/41-ezzkknhc4yw.png",
          "description": "1111"
        },
        "extra": {
          "user_id": 1,
          "likes_count": 5,
          "comments_count": 13,
          "followers_count": 0,
          "followings_count": 6,
          "updated_at": "2017-11-30 03:04:06",
          "feeds_count": 33,
          "questions_count": 2,
          "answers_count": 0,
          "checkin_count": 7,
          "last_checkin_count": 1
        }
      },
      "reply": {//被回复用户信息
        "id": 1,
        "name": "admin",
        "bio": null,
        "sex": 2,
        "location": "四川省 巴中市 南江县",
        "created_at": "2017-10-23 01:17:34",
        "updated_at": "2017-11-15 07:36:17",
        "avatar": "http://thinksns-plus.dev/api/v2/users/1/avatar",
        "bg": null,
        "verified": {
          "type": "user",
          "icon": "https://www.xnip.cn/wp-content/uploads/2021/docimg15/41-ezzkknhc4yw.png",
          "description": "1111"
        },
        "extra": {
          "user_id": 1,
          "likes_count": 5,
          "comments_count": 13,
          "followers_count": 0,
          "followings_count": 6,
          "updated_at": "2017-11-30 03:04:06",
          "feeds_count": 33,
          "questions_count": 2,
          "answers_count": 0,
          "checkin_count": 7,
          "last_checkin_count": 1
        }
      },

    },
  ]
}

评论帖子

POST /group-posts/:post/comments

响应

status 201

参数说明

名称类型说明
bodystring必须 评论内容 最大长度225
reply_userinegter回复的用户的id

删除评论

DELETE /group-posts/:post/comments/:comment

响应

status 204 not content