[关闭]
@fuyb1986 2017-05-11T03:52:24.000000Z 字数 1375 阅读 532

每日一星点赞

金色童年


点赞每日一星

Method and URL Structure

Method Resource URL
POST /comment/post/like/

Request Parameters

Name Decription Required
post 每日一星 post_id True

cURL Example

  1. curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\ --data '{...}' \
  2. http://localhost/comment/post/like/?post=34

取消点赞每日一星

Method and URL Structure

Method Resource URL
DELETE /comment/post/dislike/

Request Parameters

Name Decription Required
post 每日一星 post_id True

cURL Example

  1. curl -X DELETE -H 'Content-Type: application/json' -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\
  2. http://localhost/comment/post/dislike/?post=34

点赞统计

Method and URL Structure

Method Resource URL Decription
GET /comment/post/like/statistics/

Request Parameters

Name Decription Required
post 每日一星 post_id True

cURL Example

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

Response

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

点赞列表

Method and URL Structure

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

Request Parameters

Name Decription Required
post 每日一星 post_id True

cURL Example

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

Response

  1. {
  2. "count":5,
  3. "next":null,
  4. "previous":null,
  5. "results":[{
  6. "pk":3,
  7. "post":5,
  8. "owner":{
  9. "owner":4,
  10. "username":"18516271364",
  11. "nickname":"xiaoming",
  12. "avatar_url":"http://www.example.com/xiaoming.jpg",
  13. "slogan":"xiaoming's slogan",
  14. "name":"",
  15. "sex":"S",
  16. "sex_display":"保密",
  17. "birthday":null
  18. },
  19. "created":"2017-02-22T17:22:28.936701"
  20. }, ... ]
  21. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注