相册收藏2
金色童年
收藏相册
Method and URL Structure
Method |
Resource URL |
POST |
/comment/post/collect/ |
Request Parameters
Name |
Decription |
Required |
post |
相册的 post_ptr |
True |
Request Data
Name |
Description |
Required |
collect_type |
搜藏类型 |
YES |
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_ptr |
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_ptr |
True |
cURL Example
curl http://localhost/comment/post/collect/statistics/?post=13469
Response Data
Name |
Descritpion |
count |
数量 |
has_collect |
是否收藏 |
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 |
类型: album |
True |
cURL Example
curl http://localhost/comment/post/collects/?collect_type=album
Response Data
Name |
Descritpion |
pk |
收藏主键 |
owner |
用户 id |
collect_type |
收藏类型 |
post |
相册对应的 post |
Post
Name |
Description |
title |
标题 |
album |
收藏的相册 id |
published |
收藏时间 |
Response
{
"count":1,
"next":null,
"previous":null,
"results":[{
"pk":4,
"owner":8,
"post":{
"pk":9,
"title":"独怆然而泪下",
"album": 15,
"published":"2017-02-23"
},
"created":"2017-02-23T18:03:45.551346"
"collect_type": album,
}]
}