[关闭]
@chengxuyuan 2020-08-20T07:45:42.000000Z 字数 2766 阅读 346

直播教室-点名记录-文档

橙旭园服务器


点名记录列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/classroom/list_rollcall/ 列表 YES

按条件过滤列表释义如下 :
1. classroom_id(直播教室的 pk) 示例: /server/classroom/list_rollcall/?classroom_id=1
2. user_id(用户 id)示例:
/server/classroom/list_rollcall/?user_id=1
3. course_id(课程 id)示例:
/server/classroom/list_rollcall/?course_id=1

cURL Example

  1. curl -X GET http://127.0.0.1:8000/server/classroom/list_rollcall/ -H 'Content-Type: application/json' -H 'Authorization: Token f5d99e3acf2b3e76d63d4a8a8a2389d86e43d9cc'

Response

  1. {
  2. "count": 2,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "id": 2,
  8. "owner": {
  9. "name": "勿问情殇_1111_23",
  10. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/5690023e83a72af4ff5be0badaadfbe4_k.gif-658x658",
  11. "user": "15201052252",
  12. "nickname": "chen",
  13. "realname": "陈微",
  14. "user_id": 367,
  15. "is_staff": false,
  16. "segment": {
  17. "name": "黄金",
  18. "image": "https://static1.bcjiaoyu.com/community/touxiangkuang/king.png"
  19. },
  20. "job_title": "讲师"
  21. },
  22. "classroom": 215,
  23. "pk": 2,
  24. "course_rollcall_count": 2,
  25. "deleted": false,
  26. "create_time": "2020-08-17T16:11:58.257899",
  27. "order_index": 1000,
  28. "audio": null
  29. }
  30. ]
  31. }

新建直播教室点名记录

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /server/classroom/create_rollcall/ 新建 YES

cURL Example

  1. curl -X POST http://127.0.0.1:8000/server/classroom/create_rollcall/ -H 'Content-Type: application/json' -H 'Authorization: Token f5d99e3acf2b3e76d63d4a8a8a2389d86e43d9cc' --data '{"username":"15201052252", "classroom_id":1}'

Request Parameters

Name Description Required Default
username 用户的账号 NO
user_id 用户id NO
classroom_id 直播教室 id YES
audio 音频地址 NO
action 用户的行为 YES chat/close/audio

Request

  1. {
  2. "classroom_id":1,
  3. "action":'audio',
  4. "audio":"https://12.mp3"
  5. }

Response

  1. {
  2. "id": 2,
  3. "owner": {
  4. "name": "勿问情殇_1111_23",
  5. "avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/5690023e83a72af4ff5be0badaadfbe4_k.gif-658x658",
  6. "user": "15201052252",
  7. "nickname": "chen",
  8. "realname": "陈微",
  9. "user_id": 367,
  10. "is_staff": false,
  11. "segment": {
  12. "name": "黄金",
  13. "image": "https://static1.bcjiaoyu.com/community/touxiangkuang/king.png"
  14. },
  15. "job_title": "讲师"
  16. },
  17. "classroom": 215,
  18. "pk": 2,
  19. "course_rollcall_count": 2,
  20. "deleted": false,
  21. "create_time": "2020-08-17T16:11:58.257899",
  22. "order_index": 1000,
  23. "audio": null
  24. }

教室已到用户的点名数据

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/classroom/attendance_user_rollcall/ 列表 YES

按条件过滤列表释义如下 :
1. classroom_id(直播教室的 pk) 示例: /server/classroom/attendance_user_rollcall/?classroom_id=38

cURL Example

  1. curl -X GET http://127.0.0.1:8000/server/classroom/attendance_user_rollcall/?classroom_id=38 -H 'Content-Type: application/json' -H 'Authorization: Token f5d99e3acf2b3e76d63d4a8a8a2389d86e43d9cc'

Response

  1. {
  2. "count": 1,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 1,
  8. "username": "15201052252",
  9. "classroom_rollcall": {
  10. "action": "chat",
  11. "action_display": "聊天区回答",
  12. "audio": ""
  13. },
  14. "course_rollcall_count": 4
  15. }
  16. ]
  17. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注