[关闭]
@fuyb1986 2017-03-01T04:18:19.000000Z 字数 1926 阅读 552

回收站

金色童年


删除照片到回收站

Method and URL Structure

Method Resource URL
DELETE /photograph/delete/${pk}/

cURL Example

  1. curl -X DELETE -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
  2. http://localhost/photograph/delete/12356/

删除多张照片到回收站

Method and URL Structure

Method Resource URL
DELETE /photograph/multiple_delete/

Request Data

  1. {
  2. "photograph_set": [299, 99, 100]
  3. }

cURL Example

  1. curl -X DELETE -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\ --data '{...}'
  2. http://localhost/photograph/multiple_delete/

获取回收站列表

Method and URL Structure

Method Resource URL
GET /photograph/trash/

cURL Example

  1. curl -X GET -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
  2. http://localhost/photograph/trah/

Reponse

关键字段解释

name Description Default
in_trash 是否在回收站 false
expired 到期日期
remain_days 剩余到期天数 30

Response Data

  1. {
  2. "count":1,
  3. "next":null,
  4. "previous":null,
  5. "results":[{
  6. "pk":34,
  7. "title":"xiaoming's photo",
  8. "desc":"南柯郡汶汶乡大槐树",
  9. "file_url":"http://www.example.com/1.jpg",
  10. "taken_date":"2016-07-01",
  11. "taken_location":"",
  12. "author":"布可朔夫",
  13. "created":"2017-02-19T17:32:07.532046",
  14. "albums":[{
  15. "album":"43",
  16. "name":"照片第五",
  17. "created":"2017-02-19T17:32:07.530463"
  18. }],
  19. "has_collect":false,
  20. "private_url":{
  21. "url":"http://www.example.com/1.jpg",
  22. "url_1000":"http://www.example.com/1.jpg-w1000",
  23. "url_500":"http://www.example.com/1.jpg-w500",
  24. "url_150x150":"http://www.example.com/1.jpg-150x150",
  25. },
  26. "in_trash":true,
  27. "expired":"2017-03-21",
  28. "remain_days":30
  29. }...]
  30. }

清空回收站

Method and URL Structure

Method Resource URL
DELETE /photograph/clean_trash/

cURL Example

  1. curl -X DELETE -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
  2. 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

  1. {
  2. "photograph_set": [13, 99, 909, 109],
  3. }

cURL Example

  1. curl -X PUT -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
  2. -H 'Content-Type: appliction/jsoon' --data '{"photograph_set": [...]}'
  3. http://localhost/photograph/put_back/
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注