回收站
金色童年
删除照片到回收站
Method and URL Structure
Method |
Resource URL |
DELETE |
/photograph/delete/${pk}/ |
cURL Example
curl -X DELETE -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
http://localhost/photograph/delete/12356/
删除多张照片到回收站
Method and URL Structure
Method |
Resource URL |
DELETE |
/photograph/multiple_delete/ |
Request Data
{
"photograph_set": [299, 99, 100]
}
cURL Example
curl -X DELETE -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\ --data '{...}'
http://localhost/photograph/multiple_delete/
获取回收站列表
Method and URL Structure
Method |
Resource URL |
GET |
/photograph/trash/ |
cURL Example
curl -X GET -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
http://localhost/photograph/trah/
Reponse
关键字段解释
name |
Description |
Default |
in_trash |
是否在回收站 |
false |
expired |
到期日期 |
|
remain_days |
剩余到期天数 |
30 |
Response Data
{
"count":1,
"next":null,
"previous":null,
"results":[{
"pk":34,
"title":"xiaoming's photo",
"desc":"南柯郡汶汶乡大槐树",
"file_url":"http://www.example.com/1.jpg",
"taken_date":"2016-07-01",
"taken_location":"",
"author":"布可朔夫",
"created":"2017-02-19T17:32:07.532046",
"albums":[{
"album":"43",
"name":"照片第五",
"created":"2017-02-19T17:32:07.530463"
}],
"has_collect":false,
"private_url":{
"url":"http://www.example.com/1.jpg",
"url_1000":"http://www.example.com/1.jpg-w1000",
"url_500":"http://www.example.com/1.jpg-w500",
"url_150x150":"http://www.example.com/1.jpg-150x150",
},
"in_trash":true,
"expired":"2017-03-21",
"remain_days":30
}...]
}
清空回收站
Method and URL Structure
Method |
Resource URL |
DELETE |
/photograph/clean_trash/ |
cURL Example
curl -X DELETE -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
http://localhost/photograph/clean_trash/
从回收站恢复
Method and URL Structure
Method |
Resource URL |
PUT |
/photograph/put_back/ |
Request
Name |
Description |
Required |
photograph_set |
请求恢复的照片 pk 列表 |
True |
Request Data
{
"photograph_set": [13, 99, 909, 109],
}
cURL Example
curl -X PUT -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
-H 'Content-Type: appliction/jsoon' --data '{"photograph_set": [...]}'
http://localhost/photograph/put_back/