[关闭]
@fuyb1986 2017-05-11T03:51:06.000000Z 字数 1533 阅读 553

相册收藏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

  1. curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\ --data '{...}' \
  2. 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

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

  1. curl http://localhost/comment/post/collect/statistics/?post=13469

Response Data

Name Descritpion
count 数量
has_collect 是否收藏

Response

  1. {
  2. "count":2,
  3. "has_collect": true,
  4. }

用户的相册收藏列表

Method and URL Structure

Method Resource URL Decription
GET /comment/post/collects/

Request Parameters

Name Decription Required
collect_type 类型: album True

cURL Example

  1. 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

  1. {
  2. "count":1,
  3. "next":null,
  4. "previous":null,
  5. "results":[{
  6. "pk":4,
  7. "owner":8,
  8. "post":{
  9. "pk":9,
  10. "title":"独怆然而泪下",
  11. "album": 15,
  12. "published":"2017-02-23"
  13. },
  14. "created":"2017-02-23T18:03:45.551346"
  15. "collect_type": album,
  16. }]
  17. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注