每日一星收藏
金色童年
收藏每日一星
Method and URL Structure
Method |
Resource URL |
POST |
/comment/post/collect/ |
Request Parameters
Name |
Decription |
Required |
post |
每日一星 post_id |
True |
cURL Example
curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\ --data '{...}' \
http://localhost/comment/post/collect/?post=34
取消收藏每日一星
Method and URL Structure
Method |
Resource URL |
DELETE |
/comment/post/collect/delete/ |
Request Parameters
Name |
Decription |
Required |
post |
每日一星 post_id |
True |
cURL Example
curl -X DELETE -H 'Content-Type: application/json' -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
http://localhost/comment/post/collect/delete/?post=34
收藏统计
Method and URL Structure
Method |
Resource URL |
Decription |
GET |
/comment/post/collect/statistics/ |
|
Request Parameters
Name |
Decription |
Required |
post |
每日一星 post_id |
True |
cURL Example
curl http://localhost/comment/post/collect/statistics/?post=13469
Response
{
"count":2,
"has_collect": true,
}
用户的每日一星收藏列表
Method and URL Structure
Method |
Resource URL |
Decription |
GET |
/comment/post/collects/ |
|
Request Parameters
Name |
Decription |
Required |
collect_type |
类型: star_baby |
True |
cURL Example
curl http://localhost/comment/post/collects/?collect_type=star_baby
Response
{
"count":1,
"next":null,
"previous":null,
"results":[{
"pk":4,
"owner":8,
"post":{
"pk":9,
"title":"独怆然而泪下",
"published":"2017-02-23"
},
"created":"2017-02-23T18:03:45.551346"
}]
}