页面的备注
冰橙课件
获取备注
Method and URL Structure
只有老师可以获取备注
Method |
Resource URL |
Authorization |
GET |
/api/book/page/${page_pk}/comment/ |
YES |
cURL Example
curl -X GET -H 'Authorization: token 95b7b4d8fff5d76c9d3d2954fe5c7d456c110a8c' -H 'Content-Type: application/json' http://localhost/api/book/page/134/comment/
Response Data
Name |
Description |
content |
备注内容 |
page |
对应的页面 id |
teacher |
对应的老师 id |
Response
{
"content":"这是一个备注",
"teacher":99,
"page":134
}
创建备注
Method and URL Structure
只有老师可以创建备注
Method |
Resource URL |
Authorization |
POST |
/api/book/page/${page_pk}/comment/create/ |
YES |
cURL Example
curl -X POST -H 'Authorization: token 95b7b4d8fff5d76c9d3d2954fe5c7d456c110a8c' -H 'Content-Type: application/json' --data '{...}' http://localhost/api/book/page/134/comment/create/
Request Parameters
Name |
Description |
Required |
content |
备注内容 |
YES |
Request
{
"content": "这是一个备注"
}
Response Data
Name |
Description |
content |
备注内容 |
page |
对应的页面 id |
teacher |
对应的老师 id |
Response
{
"content":"这是一个备注",
"teacher":99,
"page":134
}
更新备注
Method and URL Structure
只有老师可以更新备注
Method |
Resource URL |
Authorization |
PUT |
/api/book/page/${page_pk}/comment/update/ |
YES |
cURL Example
curl -X PUT -H 'Authorization: token 95b7b4d8fff5d76c9d3d2954fe5c7d456c110a8c' -H 'Content-Type: application/json' --data '{...}' http://localhost/api/book/page/134/comment/update/
Request Parameters
Name |
Description |
Required |
content |
备注内容 |
YES |
Request
{
"content": "更新一个备注"
}
Response Data
Name |
Description |
content |
备注内容 |
page |
对应的页面 id |
teacher |
对应的老师 id |
Response
{
"content":"更新一个备注",
"teacher":99,
"page":134
}