- 用户接口
- 关注分组
- 发帖管理接口
- 分区接口
- 评论接口
- 评论回复接口
- 收藏接口
- 点赞接口
- 搜索及统计相关接口
- ws接口
新增点赞
测试中
POST
/likes/add
最后修改时间:2022-02-27 13:57:13
责任人:cosine_yu
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token示例:
Authorization: Bearer ********************
Body 参数application/json
type
点赞类型
One of
target_id
必需
One of
>= 1<= 100
示例
{
"target_id": 8,
"type": "comment"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://cosine.ren:8000/likes/add' \
--header 'Content-Type: application/json' \
--data-raw '{
"target_id": 8,
"type": "comment"
}'
返回响应
🟢200成功
application/json
Body
code
integer
必需
message
string
必需
result
object
必需
like_id
integer
必需
user_id
integer
必需
type
string
必需
target_id
integer
必需
示例
{
"code": 0,
"message": "点赞成功!",
"result": {
"like_id": 3,
"user_id": 1,
"type": "comment",
"target_id": 5
}
}
🟠409Conflict
修改于 2022-02-27 13:57:13