[关闭]
@fuyb1986 2016-11-10T10:44:49.000000Z 字数 1631 阅读 603

相册共享

金色童年


共享、取消共享相册

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

  1. {
  2. "user": 1234
  3. }

cURL Example

  1. curl -X POST -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
  2. -H 'Content-Type: Application/json' http://localhost/photograph/album/share_to/1234/

Reponse

  1. {
  2. "pk":1,
  3. "album":5,
  4. "user":6
  5. }

共享用户列表

Method and URL Structure

Method Resource URL
GET /photograph/album/shared_user_list/${album pk}/

cURL Example

  1. curl -X POST -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
  2. -H 'Content-Type: Application/json' http://localhost/photograph/album/shared_user_list/\$\{album pk\}/

Reponse

  1. {
  2. "count":2,
  3. "next":null,
  4. "previous":null,
  5. "results":[{
  6. "profile":{
  7. "owner":6,
  8. "nickname":"xiaoming",
  9. "avatar_url":"http://www.example.com/xiaoming.jpg",
  10. "slogan":"xiaoming's slogan",
  11. "name":"",
  12. "sex":"S",
  13. "sex_display":"保密"
  14. }
  15. },..]
  16. }

收到的共享相册列表

Method and URL Structure

Method Resource URL
GET /photograph/album/shared_album_list/

cURL Example

  1. curl -X POST -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
  2. -H 'Content-Type: Application/json' http://localhost/photograph/album/shared_album_list/

Reponse

  1. {
  2. "count":1,
  3. "next":null,
  4. "previous":null,
  5. "results":[{
  6. "pk":5,
  7. "name":"xiaoming's album",
  8. "desc":"南柯郡汶汶乡大槐树",
  9. "shared":true,
  10. "created":"2016-10-27T23:59:01.587235",
  11. "photograph_set":[],
  12. "profile":{
  13. "owner":5,
  14. "nickname":"xiaoming",
  15. "avatar_url":"http://www.example.com/xiaoming.jpg",
  16. "slogan":"xiaoming's slogan",
  17. "name":"",
  18. "sex":"S",
  19. "sex_display":"保密"
  20. },
  21. "owner":5,
  22. "cover":null,
  23. "extra":"",
  24. "new_list":[],
  25. "like_count":0,
  26. "comment_count":0,
  27. "has_like":false
  28. }]
  29. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注