每日一星点赞
金色童年
点赞每日一星
Method and URL Structure
| Method |
Resource URL |
| POST |
/comment/post/like/ |
Request Parameters
| Name |
Decription |
Required |
| post |
每日一星 post_id |
True |
cURL Example
curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\ --data '{...}' \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
curl -X DELETE -H 'Content-Type: application/json' -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\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
curl http://localhost/comment/post/like/statistics/?post=13469
Response
{ "count":2, "has_like": true,}
点赞列表
Method and URL Structure
| Method |
Resource URL |
Decription |
| GET |
/comment/post/likes/ |
|
Request Parameters
| Name |
Decription |
Required |
| post |
每日一星 post_id |
True |
cURL Example
curl http://localhost/comment/post/likes/?post=13469
Response
{ "count":5, "next":null, "previous":null, "results":[{ "pk":3, "post":5, "owner":{ "owner":4, "username":"18516271364", "nickname":"xiaoming", "avatar_url":"http://www.example.com/xiaoming.jpg", "slogan":"xiaoming's slogan", "name":"", "sex":"S", "sex_display":"保密", "birthday":null }, "created":"2017-02-22T17:22:28.936701" }, ... ]}