相册共享
金色童年
共享、取消共享相册
Method and URL Structure
DELETE 也要指定 user id
Method |
Resource URL |
POST |
/photograph/album/share_to/${album pk}/ |
DELETE |
/photograph/album/share_to/remove/${album pk}/ |
Request Parameters
Name |
Description |
user |
user id |
Request Data
{
"user": 1234
}
cURL Example
curl -X POST -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
-H 'Content-Type: Application/json' http://localhost/photograph/album/share_to/1234/
Reponse
{
"pk":1,
"album":5,
"user":6
}
共享用户列表
Method and URL Structure
Method |
Resource URL |
GET |
/photograph/album/shared_user_list/${album pk}/ |
cURL Example
curl -X POST -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
-H 'Content-Type: Application/json' http://localhost/photograph/album/shared_user_list/\$\{album pk\}/
Reponse
{
"count":2,
"next":null,
"previous":null,
"results":[{
"profile":{
"owner":6,
"nickname":"xiaoming",
"avatar_url":"http://www.example.com/xiaoming.jpg",
"slogan":"xiaoming's slogan",
"name":"",
"sex":"S",
"sex_display":"保密"
}
},..]
}
收到的共享相册列表
Method and URL Structure
Method |
Resource URL |
GET |
/photograph/album/shared_album_list/ |
cURL Example
curl -X POST -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
-H 'Content-Type: Application/json' http://localhost/photograph/album/shared_album_list/
Reponse
{
"count":1,
"next":null,
"previous":null,
"results":[{
"pk":5,
"name":"xiaoming's album",
"desc":"南柯郡汶汶乡大槐树",
"shared":true,
"created":"2016-10-27T23:59:01.587235",
"photograph_set":[],
"profile":{
"owner":5,
"nickname":"xiaoming",
"avatar_url":"http://www.example.com/xiaoming.jpg",
"slogan":"xiaoming's slogan",
"name":"",
"sex":"S",
"sex_display":"保密"
},
"owner":5,
"cover":null,
"extra":"",
"new_list":[],
"like_count":0,
"comment_count":0,
"has_like":false
}]
}