作品点赞评论
儿童编程
点赞或取消
Method and Url Structure
Method |
Resource URL |
POST |
/server/show/showwork_like_or_cancle/ |
cURL Example
curl -X POST -H 'Authorization: Token tester001' -d data{...}
localhost:8000/server/show/showwork_like_or_cancle/
Request
Name |
Description |
Required |
Default |
pk |
作品pk |
YES |
|
Request Data
{
"pk": 3
}
JSON Response
{
"message": "点赞成功"
}
or
{
"message": "取消点赞成功"
}
作品评论
Method and Url Structure
Method |
Resource URL |
POST |
/server/show/showworks/ |
cURL Example
curl -X GET -H 'Authorization: Token tester001' -d data{...}
localhost:8000/server/show/showworks/
Request
Name |
Description |
Required |
Default |
pk |
作品pk |
YES |
|
content |
评论内容 |
NO |
|
images |
评论图片 |
NO |
|
Request Data
{
"pk": 11,
"content": "12345",
"images": "img"
}
JSON Response
{
"pk": 3,
"owner": 2,
"show_work": 11,
"content": "12345",
"images": "img",
"create_time": "2018-09-05T11:19:08.500224"
}
作品评论列表
Method and Url Structure
Method |
Resource URL |
GET |
/server/show/showwork_replies/ |
cURL Example
curl -X GET -H 'Authorization: Token tester001' -d data{...}
# 核审通过才有
localhost:8000/server/show/showwork_replies/?show_work=11
JSON Response
{
"count": 3,
"next": null,
"previous": null,
"results": [
{
"pk": 3,
"owner": 2,
"show_work": 11,
"content": "12345",
"images": "img",
"create_time": "2018-09-05T11:19:08.500224"
},
{
"pk": 2,
"owner": 2,
"show_work": 11,
"content": null,
"images": null,
"create_time": "2018-09-05T11:18:19.217236"
},
{
"pk": 1,
"owner": 2,
"show_work": 11,
"content": null,
"images": null,
"create_time": "2018-09-03T18:57:51.584807"
}
]
}
作品评论详情
Method and Url Structure
Method |
Resource URL |
GET |
/server/show/showwork_replies/pk/ |
cURL Example
curl -X GET -H 'Authorization: Token tester001' -d data{...}
localhost:8000/server/show/showwork_replies/2/
JSON Response
{
"pk": 2,
"owner": 2,
"show_work": 11,
"content": null,
"images": null,
"create_time": "2018-09-05T11:18:19.217236"
}