[关闭]
@fuyb1986 2017-07-25T07:58:01.000000Z 字数 1901 阅读 575

管理员加精华、置顶帖子

program_girl


判断一个帐号是否管理员

/userinfo/whoami/ 接口返回的数据里有一个 is_staff 字段,
true 表示这是管理员帐号。
可以像 token 一样存储到 cookie 里面。

加精华帖子

Method and URL Structure

Method Resource URL Authorization
PUT /program_girl/forum/posts_essence/${post pk}/ YES

cURL Example

  1. curl -X PUT -H 'Authorization: token 95b7b4d8fff5d76c9d3d2954fe5c7d456c110a8c' -H 'Content-Type: application/json' http://localhost/program_girl/forum/posts_essence/170/

Response

  1. {
  2. "pk": 170,
  3. "author": "opSbp1JARhmzgmez9yObTt9aSybs4",
  4. "userinfo": {
  5. ....
  6. },
  7. "section": {
  8. .....
  9. },
  10. "title": "11111111",
  11. "content": "face[兔子]",
  12. "ispay": false,
  13. "islocked": false,
  14. "isessence": true,
  15. "istop": false,
  16. "browse_count": 1,
  17. "reply_count": 0,
  18. "last_replied": "2017-07-14T16:47:57.229561",
  19. "images": null,
  20. "create_time": "2017-07-14T16:47:57.229462"
  21. }

取消加精华帖子

Method and URL Structure

Method Resource URL Authorization
PUT /program_girl/forum/posts_essence/cancel/${post pk}/ YES

cURL Example

  1. curl -X PUT -H 'Authorization: token 95b7b4d8fff5d76c9d3d2954fe5c7d456c110a8c' -H 'Content-Type: application/json' http://localhost/program_girl/forum/posts_essence/170/

Response

  1. {
  2. ...
  3. }

置顶帖子

Method and URL Structure

Method Resource URL Authorization
PUT /program_girl/forum/posts_top/${post pk}/ YES

cURL Example

  1. curl -X PUT -H 'Authorization: token 95b7b4d8fff5d76c9d3d2954fe5c7d456c110a8c' -H 'Content-Type: application/json' http://localhost/program_girl/forum/posts_top/172/

Response

  1. {
  2. "pk": 172,
  3. "author": "opSbp1JARhmzgmez9yObTt9aSybs4",
  4. "userinfo": {
  5. ....
  6. },
  7. "section": {
  8. .....
  9. },
  10. "title": "11111111",
  11. "content": "face[兔子]",
  12. "ispay": false,
  13. "islocked": false,
  14. "isessence": false,
  15. "istop": true,
  16. "browse_count": 1,
  17. "reply_count": 0,
  18. "last_replied": "2017-07-14T16:47:57.229561",
  19. "images": null,
  20. "create_time": "2017-07-14T16:47:57.229462"
  21. }

取消置顶帖子

Method and URL Structure

Method Resource URL Authorization
PUT /program_girl/forum/posts_top/cancel/${post pk}/ YES

cURL Example

  1. curl -X PUT -H 'Authorization: token 95b7b4d8fff5d76c9d3d2954fe5c7d456c110a8c' -H 'Content-Type: application/json' http://localhost/program_girl/forum/posts_top/172/

Response

  1. {
  2. ...
  3. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注