[关闭]
@JackieQu 2018-09-05T11:25:43.000000Z 字数 1635 阅读 296

作品点赞评论

儿童编程


点赞或取消

Method and Url Structure

Method Resource URL
POST /server/show/showwork_like_or_cancle/

cURL Example

  1. curl -X POST -H 'Authorization: Token tester001' -d data{...}
  2. localhost:8000/server/show/showwork_like_or_cancle/

Request

Name Description Required Default
pk 作品pk YES

Request Data

  1. {
  2. "pk": 3
  3. }

JSON Response

  1. {
  2. "message": "点赞成功"
  3. }
  4. or
  5. {
  6. "message": "取消点赞成功"
  7. }

作品评论

Method and Url Structure

Method Resource URL
POST /server/show/showworks/

cURL Example

  1. curl -X GET -H 'Authorization: Token tester001' -d data{...}
  2. localhost:8000/server/show/showworks/

Request

Name Description Required Default
pk 作品pk YES
content 评论内容 NO
images 评论图片 NO

Request Data

  1. {
  2. "pk": 11,
  3. "content": "12345",
  4. "images": "img"
  5. }

JSON Response

  1. {
  2. "pk": 3,
  3. "owner": 2,
  4. "show_work": 11,
  5. "content": "12345",
  6. "images": "img",
  7. "create_time": "2018-09-05T11:19:08.500224"
  8. }

作品评论列表

Method and Url Structure

Method Resource URL
GET /server/show/showwork_replies/

cURL Example

  1. curl -X GET -H 'Authorization: Token tester001' -d data{...}
  2. # 核审通过才有
  3. localhost:8000/server/show/showwork_replies/?show_work=11

JSON Response

  1. {
  2. "count": 3,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 3,
  8. "owner": 2,
  9. "show_work": 11,
  10. "content": "12345",
  11. "images": "img",
  12. "create_time": "2018-09-05T11:19:08.500224"
  13. },
  14. {
  15. "pk": 2,
  16. "owner": 2,
  17. "show_work": 11,
  18. "content": null,
  19. "images": null,
  20. "create_time": "2018-09-05T11:18:19.217236"
  21. },
  22. {
  23. "pk": 1,
  24. "owner": 2,
  25. "show_work": 11,
  26. "content": null,
  27. "images": null,
  28. "create_time": "2018-09-03T18:57:51.584807"
  29. }
  30. ]
  31. }

作品评论详情

Method and Url Structure

Method Resource URL
GET /server/show/showwork_replies/pk/

cURL Example

  1. curl -X GET -H 'Authorization: Token tester001' -d data{...}
  2. localhost:8000/server/show/showwork_replies/2/

JSON Response

  1. {
  2. "pk": 2,
  3. "owner": 2,
  4. "show_work": 11,
  5. "content": null,
  6. "images": null,
  7. "create_time": "2018-09-05T11:18:19.217236"
  8. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注