[关闭]
@fuyb1986 2017-05-24T10:04:14.000000Z 字数 1364 阅读 534

页面的备注

冰橙课件


获取备注

Method and URL Structure

只有老师可以获取备注

Method Resource URL Authorization
GET /api/book/page/${page_pk}/comment/ YES

cURL Example

  1. 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

  1. {
  2. "content":"这是一个备注",
  3. "teacher":99,
  4. "page":134
  5. }

创建备注

Method and URL Structure

只有老师可以创建备注

Method Resource URL Authorization
POST /api/book/page/${page_pk}/comment/create/ YES

cURL Example

  1. 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

  1. {
  2. "content": "这是一个备注"
  3. }

Response Data

Name Description
content 备注内容
page 对应的页面 id
teacher 对应的老师 id

Response

  1. {
  2. "content":"这是一个备注",
  3. "teacher":99,
  4. "page":134
  5. }

更新备注

Method and URL Structure

只有老师可以更新备注

Method Resource URL Authorization
PUT /api/book/page/${page_pk}/comment/update/ YES

cURL Example

  1. 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

  1. {
  2. "content": "更新一个备注"
  3. }

Response Data

Name Description
content 备注内容
page 对应的页面 id
teacher 对应的老师 id

Response

  1. {
  2. "content":"更新一个备注",
  3. "teacher":99,
  4. "page":134
  5. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注