littleSharing
  1. 评论
littleSharing
  • 评论
    • 评论列表
      GET
    • 评论操作
      POST
    • 获取评论的点赞列表
      GET
    • 评论点赞操作
      POST
  • 消息
    • 发送消息
      POST
    • 获取消息
      GET
    • 删除消息
      POST
    • 获取所有类型的未读消息的数量
      GET
    • 改变消息状态为已读
      POST
  • 文章
    • 上传文章配图
      POST
    • 上传文章封面图片
      POST
    • 获取文章列表
      GET
    • 上传文章
      POST
    • 新增文章标签
      POST
    • 获取文章内容
      GET
    • 上传文章书签
      POST
    • 获取文章书签
      GET
    • 删除文章书签
      POST
    • 删除文章
      POST
    • 编辑文章
      POST
    • 更新趋势
      POST
    • 增加文章浏览量
      POST
    • 获取文章趋势列表
      GET
    • 查询文章
      GET
    • 获取相似文章
      GET
    • 获取最新发布的五篇文章
      GET
    • 保存文章内容
      POST
    • 删除文章标签
      POST
  • 用户
    • 注册用户
    • 用户登录
    • 上传头像图片
    • 上传背景图片
    • 获取用户的关键词
    • 获取文章标签列表(发布文章处)
    • 获取用户信息
    • 编辑用户信息
    • 获取用户点赞总数
    • 获取用户收藏总数
    • 获取用户被点赞文章列表
    • 获取用户被收藏文章列表
    • 用户关注操作
    • 获取用户关注列表
    • 获取用户粉丝列表
    • 获取用户发布文章的标签
    • 点赞操作
    • 收藏操作
    • 获取用户收藏列表
    • 获取用户点赞列表
    • 获取某个用户发布的文章列表(简要信息)
    • 获取某个用户发布的文章列表(详细信息)
  1. 评论

评论操作

POST
/comment/comment-action
在文章详情页面下,用户可以自行添加评论或者删除自己已经添加的评论

请求参数

Header 参数
Authorization
string 
用户鉴权token
可选
默认值:
{{token}}
Body 参数application/json
article_id
integer 
评论的对象id
必需
user_id
integer 
发布该评论的用户id
必需
action_type
integer 
评论操作
必需
0-发布评论,1-删除评论
comment_content
string 
用户填写的评论内容(action_type =1)
可选
create_date
string 
发布该评论的日期
必需
delete_comment_id
integer 
要删除的评论id(action_type = 2)
可选
response_to_user_id
integer 
发布二级评论时被评论的用户id
可选
response_to_comment_id
integer 
发布二级评论时被评论的comment_id
可选
示例
{
    "article_id": 0,
    "user_id": 0,
    "action_type": 0,
    "comment_content": "string",
    "create_date": "string",
    "delete_comment_id": 0,
    "response_to_user_id": 0,
    "response_to_comment_id": 0
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://www.nonhana-server.cn:4000/comment/comment-action' \
--header 'Authorization: {{token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "article_id": 0,
    "user_id": 0,
    "action_type": 0,
    "comment_content": "string",
    "create_date": "string",
    "delete_comment_id": 0,
    "response_to_user_id": 0,
    "response_to_comment_id": 0
}'

返回响应

🟢200成功
application/json
Body
result_code
integer 
状态码
必需
0-成功,1-失败
>= 0<= 0
result_msg
string 
状态信息
必需
result
integer 
返回信息
可选
新添加的评论id
示例
{
    "result_code": 0,
    "result_msg": null,
    "comment_list": [
        {
            "comment_id": "59",
            "content": "sint",
            "create_date": "1974-08-01",
            "commentator": {
                "id": 89,
                "name": "被命府料设件",
                "header_photo": "http://dummyimage.com/400x400"
            },
            "response": [
                {
                    "comment_id": "59",
                    "content": "Duis dolor nulla irure",
                    "response_date": "1996-11-18",
                    "respondent": {
                        "id": 44,
                        "name": "命角第你算法",
                        "header_photo": "http://dummyimage.com/400x400"
                    },
                    "response_to": {
                        "id": "65",
                        "name": "他着也百"
                    },
                    "likes": 13
                },
                {
                    "comment_id": "63",
                    "content": "labore aute Lorem",
                    "response_date": "2019-05-11",
                    "respondent": {
                        "id": 98,
                        "name": "几可查调出",
                        "header_photo": "http://dummyimage.com/400x400"
                    },
                    "response_to": {
                        "id": "43",
                        "name": "率难强土"
                    },
                    "likes": 5
                },
                {
                    "comment_id": "18",
                    "content": "dolore consequat",
                    "response_date": "1991-08-20",
                    "respondent": {
                        "id": 27,
                        "name": "并资片研",
                        "header_photo": "http://dummyimage.com/400x400"
                    },
                    "response_to": {
                        "id": "28",
                        "name": "六都温员通"
                    },
                    "likes": 71
                },
                {
                    "comment_id": "88",
                    "content": "consectetur ex",
                    "response_date": "1996-09-15",
                    "respondent": {
                        "id": 71,
                        "name": "在气结系争分一",
                        "header_photo": "http://dummyimage.com/400x400"
                    },
                    "response_to": {
                        "id": "64",
                        "name": "报且要长多还"
                    },
                    "likes": 4
                },
                {
                    "comment_id": "52",
                    "content": "dolor",
                    "response_date": "1977-02-23",
                    "respondent": {
                        "id": 91,
                        "name": "越连单用基",
                        "header_photo": "http://dummyimage.com/400x400"
                    },
                    "response_to": {
                        "id": "75",
                        "name": "决我放约阶斯"
                    },
                    "likes": 40
                }
            ],
            "likes": 94
        },
        {
            "comment_id": "30",
            "content": "nostrud adipisicing enim consequat culpa",
            "create_date": "2000-03-28",
            "commentator": {
                "id": 57,
                "name": "加没带术状计",
                "header_photo": "http://dummyimage.com/400x400"
            },
            "response": [
                {
                    "comment_id": "87",
                    "content": "velit consectetur exercitation",
                    "response_date": "2019-10-16",
                    "respondent": {
                        "id": 12,
                        "name": "或厂者气状",
                        "header_photo": "http://dummyimage.com/400x400"
                    },
                    "response_to": {
                        "id": "65",
                        "name": "还领元真不般养"
                    },
                    "likes": 88
                },
                {
                    "comment_id": "88",
                    "content": "eiusmod proident",
                    "response_date": "1978-01-04",
                    "respondent": {
                        "id": 4,
                        "name": "议月得先定设机",
                        "header_photo": "http://dummyimage.com/400x400"
                    },
                    "response_to": {
                        "id": "92",
                        "name": "面它西精按"
                    },
                    "likes": 75
                }
            ],
            "likes": 84
        },
        {
            "comment_id": "99",
            "content": "nulla nostrud",
            "create_date": "2010-02-18",
            "commentator": {
                "id": 73,
                "name": "今三五科相线学",
                "header_photo": "http://dummyimage.com/400x400"
            },
            "response": [
                {
                    "comment_id": "68",
                    "content": "ut commodo eiusmod do",
                    "response_date": "1987-09-01",
                    "respondent": {
                        "id": 72,
                        "name": "院农务报革斯",
                        "header_photo": "http://dummyimage.com/400x400"
                    },
                    "response_to": {
                        "id": "34",
                        "name": "资明节斯局二而"
                    },
                    "likes": 52
                },
                {
                    "comment_id": "25",
                    "content": "ex veniam minim in do",
                    "response_date": "2011-11-30",
                    "respondent": {
                        "id": 68,
                        "name": "料那产第构",
                        "header_photo": "http://dummyimage.com/400x400"
                    },
                    "response_to": {
                        "id": "39",
                        "name": "争其北律"
                    },
                    "likes": 24
                },
                {
                    "comment_id": "3",
                    "content": "consectetur labore occaecat id Lorem",
                    "response_date": "2020-09-04",
                    "respondent": {
                        "id": 44,
                        "name": "条值华色满离己",
                        "header_photo": "http://dummyimage.com/400x400"
                    },
                    "response_to": {
                        "id": "54",
                        "name": "但克划无连"
                    },
                    "likes": 52
                }
            ],
            "likes": 25
        },
        {
            "comment_id": "76",
            "content": "occaecat dolor officia reprehenderit",
            "create_date": "1972-06-09",
            "commentator": {
                "id": 58,
                "name": "热斯代至效",
                "header_photo": "http://dummyimage.com/400x400"
            },
            "response": [
                {
                    "comment_id": "58",
                    "content": "Lorem nulla enim aliquip est",
                    "response_date": "1978-11-01",
                    "respondent": {
                        "id": 54,
                        "name": "面二南真是常参",
                        "header_photo": "http://dummyimage.com/400x400"
                    },
                    "response_to": {
                        "id": "87",
                        "name": "值任把把军专"
                    },
                    "likes": 98
                }
            ],
            "likes": 68
        },
        {
            "comment_id": "61",
            "content": "veniam",
            "create_date": "1999-03-21",
            "commentator": {
                "id": 16,
                "name": "主院至比",
                "header_photo": "http://dummyimage.com/400x400"
            },
            "response": [
                {
                    "comment_id": "98",
                    "content": "est in",
                    "response_date": "2006-05-23",
                    "respondent": {
                        "id": 10,
                        "name": "红常用其",
                        "header_photo": "http://dummyimage.com/400x400"
                    },
                    "response_to": {
                        "id": "63",
                        "name": "少向龙百米"
                    },
                    "likes": 88
                },
                {
                    "comment_id": "49",
                    "content": "eu exercitation dolor",
                    "response_date": "2013-11-02",
                    "respondent": {
                        "id": 45,
                        "name": "清次如",
                        "header_photo": "http://dummyimage.com/400x400"
                    },
                    "response_to": {
                        "id": "23",
                        "name": "实方了"
                    },
                    "likes": 100
                },
                {
                    "comment_id": "56",
                    "content": "esse quis incididunt sunt",
                    "response_date": "2019-06-16",
                    "respondent": {
                        "id": 37,
                        "name": "间天团具严",
                        "header_photo": "http://dummyimage.com/400x400"
                    },
                    "response_to": {
                        "id": "9",
                        "name": "直天看长"
                    },
                    "likes": 62
                },
                {
                    "comment_id": "92",
                    "content": "cillum exercitation",
                    "response_date": "1993-10-23",
                    "respondent": {
                        "id": 17,
                        "name": "族什革做据取",
                        "header_photo": "http://dummyimage.com/400x400"
                    },
                    "response_to": {
                        "id": "65",
                        "name": "照响龙达"
                    },
                    "likes": 71
                }
            ],
            "likes": 72
        }
    ],
    "thisID": "22"
}
上一页
评论列表
下一页
获取评论的点赞列表
Built with