管理员加精华、置顶帖子
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
curl -X PUT -H 'Authorization: token 95b7b4d8fff5d76c9d3d2954fe5c7d456c110a8c' -H 'Content-Type: application/json' http://localhost/program_girl/forum/posts_essence/170/
Response
{
"pk": 170,
"author": "opSbp1JARhmzgmez9yObTt9aSybs4",
"userinfo": {
....
},
"section": {
.....
},
"title": "11111111",
"content": "face[兔子]",
"ispay": false,
"islocked": false,
"isessence": true,
"istop": false,
"browse_count": 1,
"reply_count": 0,
"last_replied": "2017-07-14T16:47:57.229561",
"images": null,
"create_time": "2017-07-14T16:47:57.229462"
}
取消加精华帖子
Method and URL Structure
Method |
Resource URL |
Authorization |
PUT |
/program_girl/forum/posts_essence/cancel/${post pk}/ |
YES |
cURL Example
curl -X PUT -H 'Authorization: token 95b7b4d8fff5d76c9d3d2954fe5c7d456c110a8c' -H 'Content-Type: application/json' http://localhost/program_girl/forum/posts_essence/170/
Response
{
...
}
置顶帖子
Method and URL Structure
Method |
Resource URL |
Authorization |
PUT |
/program_girl/forum/posts_top/${post pk}/ |
YES |
cURL Example
curl -X PUT -H 'Authorization: token 95b7b4d8fff5d76c9d3d2954fe5c7d456c110a8c' -H 'Content-Type: application/json' http://localhost/program_girl/forum/posts_top/172/
Response
{
"pk": 172,
"author": "opSbp1JARhmzgmez9yObTt9aSybs4",
"userinfo": {
....
},
"section": {
.....
},
"title": "11111111",
"content": "face[兔子]",
"ispay": false,
"islocked": false,
"isessence": false,
"istop": true,
"browse_count": 1,
"reply_count": 0,
"last_replied": "2017-07-14T16:47:57.229561",
"images": null,
"create_time": "2017-07-14T16:47:57.229462"
}
取消置顶帖子
Method and URL Structure
Method |
Resource URL |
Authorization |
PUT |
/program_girl/forum/posts_top/cancel/${post pk}/ |
YES |
cURL Example
curl -X PUT -H 'Authorization: token 95b7b4d8fff5d76c9d3d2954fe5c7d456c110a8c' -H 'Content-Type: application/json' http://localhost/program_girl/forum/posts_top/172/
Response
{
...
}