直播教室
学管系统
获取直播课分类下所有教室、获取直播课程下所有教室、获取所有教室
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
GET |
/server/job_management/list_live_classroom/ |
获取直播课分类下所有教室、获取直播课程下所有教室、获取所有教室 |
YES |
category
(直播课分类pk):示例: /server/job_management/list_live_classroom/?category=1
live_course
(直播课程pk): 示例: /server/job_management/list_live_classroom/?live_course=1
两个参数都不传时,默认取所有教室
course_type
(直播课类型normal
practice
): 示例:/server/job_management/list_live_classroom/?course_type=normal
Response
{
"count": 17,
"next": "http://127.0.0.1:8000/server/job_management/list_live_classroom/?category=2&page=2",
"previous": null,
"results": [
{
"pk": 129,
"title": "试讲05",
"url": "https://live.coding61.com/chengxuyuan-live/vf46a9v6eu4qjuu8xk2urww4fomd3iq8.flv?auth_key=1550401200-y18wm198b4n4bsds-0-8ec073d5b66865cc1fa396ed31e11620",
"push_url": "rtmp://push1.coding61.com/chengxuyuan-live/vf46a9v6eu4qjuu8xk2urww4fomd3iq8?auth_key=1550401200-ho5xmyg9p5956l83-0-0c4a6f4b3887b886e8f36d817334ef3a",
"live_url": "https://live.coding61.com/chengxuyuan-live/vf46a9v6eu4qjuu8xk2urww4fomd3iq8.flv?auth_key=1550401200-y18wm198b4n4bsds-0-8ec073d5b66865cc1fa396ed31e11620",
"mobile_live_url": "https://live.coding61.com/chengxuyuan-live/vf46a9v6eu4qjuu8xk2urww4fomd3iq8.m3u8?auth_key=1550401200-43vkftb9sdxypxj2-0-77f147f855abd22d06848752aff5e998",
"admin": "17338156831",
"tag": null,
"user_list": "15010710528,15016152275,88820190201,88820190202,88820190203,88820190203,88820190204,88820190205,88820190206,88820190207,88820190207,88820190208,88820190209,88820190210",
"introduction": "试讲",
"start_time": "2019-02-17T17:00:00",
"isfinish": false,
"mins": 60,
"stream_name": "vf46a9v6eu4qjuu8xk2urww4fomd3iq8",
"video_id": null,
"teacher_userinfo": {
"name": "橙旭园张燕菲老师",
"avatar": "https://static1.bcjiaoyu.com/head1@3x.png",
"user": "17338156831",
"nickname": null
},
"question_config": null,
"live_type": "private",
"course_type": "normal",
"rongyun_group_id": "rongyun-group-id-129",
"need_practice": false,
"total_normal_class": 0,
"live_course": 3,
"course_num": 0,
"practice_url": "",
"is_audio": true,
"editor_type": "python"
}
]
}
新建直播教室
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
POST |
/server/job_management/create_live_classroom/ |
新建教室 |
YES |
Request Parameters
Name |
Description |
Required |
Default |
admin |
班主任的账号 |
YES |
|
teacher |
教师的账号 |
YES |
|
live_course |
直播课程的pk |
YES |
|
title |
标题 |
YES |
|
tag |
活动 tag |
YES |
|
user_list |
观看用户列表 |
YES |
|
introduction |
详情介绍 |
YES |
|
start_time |
开始时间 |
YES |
|
mins |
时长(分钟) |
YES |
|
video_id |
视频ID |
YES |
|
question_config |
答题配置 |
YES |
|
record |
是否录播 |
YES |
|
isfinish |
是否结束 |
YES |
|
live_type |
直播类型 |
YES |
|
course_type |
教室类型 |
YES |
|
total_normal_class |
正课课时总数 |
YES |
|
course_num |
本期课程教室编号 |
YES |
|
need_practice |
是否需要练习 |
YES |
|
practice_url |
课后习题地址列表 |
YES |
|
exercises |
课中习题列表 |
YES |
|
practice_exercises |
练习课中习题列表(格式啥的同 exercises 一样) |
YES |
|
live_type
: public
(公开) 和 private
(不公开)
course_type
: normal
(正课) 和 practice
(练习课)
question_config
: 答题配置,如果有合法的.json地址,则传,否则填空。不能填url 后缀非.json或者不合法的地址
editor_type
: applab
(APPLab 编辑器) 、gamelab
(GameLab 编辑器)、 scratch
(Scratch 编辑器)、 python
(Python 编辑器)
Request Data
{
"admin":"15201052252",
"live_course":2,
"title":"直播教室标题",
"tag":"",
"user_list":"15201052252,15010710528",
"introduction":"直播教室详情介绍",
"start_time":"2019-04-14 17:30:00",
"mins":60,
"video_id":"",
"question_config":"",
"record":true,
"isfinish":false,
"live_type":"private",
"course_type":"normal",
"total_normal_class":20,
"course_num":1,
"need_practice":false,
"practice_url":"",
"exercises":"",
"practice_exercises"
}
Response
{
"pk": 144,
"title": "直播教室标题",
"url": "https://live.coding61.com/chengxuyuan-live/b8p47a3akoi4hfln8nhj38swag3ifz73.flv?auth_key=1519990880-jgrhcnk8gia3hxhu-0-d267d54f315fe351c3380417208f140e",
"push_url": "rtmp://push1.coding61.com/chengxuyuan-live/b8p47a3akoi4hfln8nhj38swag3ifz73?auth_key=1519990880-2k1rxaw7oq5ufpbp-0-e4818300d14e73faaca941962b88d4f8",
"live_url": "https://live.coding61.com/chengxuyuan-live/b8p47a3akoi4hfln8nhj38swag3ifz73.flv?auth_key=1519990880-jgrhcnk8gia3hxhu-0-d267d54f315fe351c3380417208f140e",
"mobile_live_url": "https://live.coding61.com/chengxuyuan-live/b8p47a3akoi4hfln8nhj38swag3ifz73.m3u8?auth_key=1519990880-5m1hcnai3xu7e4k4-0-e150451c4614017d62b9a58d9da55c3f",
"admin": "15201052252",
"tag": "",
"user_list": "15201052252,15010710528",
"introduction": "直播教室详情介绍",
"start_time": "2019-04-14T17:30:00",
"isfinish": false,
"mins": 60,
"stream_name": "b8p47a3akoi4hfln8nhj38swag3ifz73",
"video_id": "",
"teacher_userinfo": {
"name": "啦啦啦",
"avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
"user": "15201052252",
"nickname": "chen"
},
"question_config": "",
"live_type": "private",
"course_type": "normal",
"rongyun_group_id": "rongyun-group-id-144",
"need_practice": false,
"total_normal_class": 20,
"live_course": 2,
"course_num": 1,
"practice_url": "",
"is_audio": true,
"editor_type": "python"
}
修改直播教室
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
PATCH |
/server/job_management/update_live_classroom/${pk}/ |
修改教室 |
YES |
pk: 教室的 pk
Request Parameters
Name |
Description |
Required |
Default |
title |
标题 |
YES |
|
start_time |
开始时间 |
YES |
|
total_normal_class |
正课课时总数 |
YES |
|
course_num |
本期课程教室编号 |
YES |
|
handout |
该教室对应的讲义地址 |
NO |
|
Request Data
{
"title":"试讲051",
"start_time":"2019-02-17 17:01:00",
"total_normal_class":10,
"course_num":1,
"handout":"fdsf"
}
Response
{
"pk": 129,
"title": "试讲051",
"url": "https://live.coding61.com/chengxuyuan-live/vf46a9v6eu4qjuu8xk2urww4fomd3iq8.flv?auth_key=1550401200-y18wm198b4n4bsds-0-8ec073d5b66865cc1fa396ed31e11620",
"push_url": "rtmp://push1.coding61.com/chengxuyuan-live/vf46a9v6eu4qjuu8xk2urww4fomd3iq8?auth_key=1550401200-ho5xmyg9p5956l83-0-0c4a6f4b3887b886e8f36d817334ef3a",
"live_url": "https://live.coding61.com/chengxuyuan-live/vf46a9v6eu4qjuu8xk2urww4fomd3iq8.flv?auth_key=1550401200-y18wm198b4n4bsds-0-8ec073d5b66865cc1fa396ed31e11620",
"mobile_live_url": "https://live.coding61.com/chengxuyuan-live/vf46a9v6eu4qjuu8xk2urww4fomd3iq8.m3u8?auth_key=1550401200-43vkftb9sdxypxj2-0-77f147f855abd22d06848752aff5e998",
"admin": "17338156831",
"tag": null,
"user_list": "15010710528,15016152275,88820190201,88820190202,88820190203,88820190203,88820190204,88820190205,88820190206,88820190207,88820190207,88820190208,88820190209,88820190210",
"introduction": "试讲",
"start_time": "2019-02-17T17:01:00",
"isfinish": false,
"mins": 60,
"stream_name": "vf46a9v6eu4qjuu8xk2urww4fomd3iq8",
"video_id": null,
"teacher_userinfo": {
"name": "橙旭园张燕菲老师",
"avatar": "https://static1.bcjiaoyu.com/head1@3x.png",
"user": "17338156831",
"nickname": null
},
"question_config": null,
"live_type": "private",
"course_type": "normal",
"rongyun_group_id": "rongyun-group-id-129",
"need_practice": false,
"total_normal_class": 10,
"live_course": 3,
"course_num": 1,
"practice_url": "",
"handout":"fdsf"
}
刷新直播教室推流地址
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
PUT |
/server/job_management/refresh_live_classroom/${pk}/ |
刷新教室 |
YES |
批量建教室
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
POST |
/server/job_management/add_classrooms/ |
批量建教室 |
YES |
Request Parameters
Name |
Description |
Required |
Default |
admin |
管理员账号 |
YES |
|
teacher |
班主任账号 |
YES |
|
live_course |
直播课程的 pk |
YES |
|
course_type |
教室类型 |
YES |
|
user_list |
观看用户列表 |
YES |
|
start_time |
开始时间 |
YES |
|
total_lesson |
一次性建几节教室 |
YES |
|
live_type |
直播教室类型公开还是私有 |
YES |
private |
batch_type |
批量创建的方式选择 |
YES |
three |
course_type
: 直播课(normal
)、练习课(practice
)、项目课(project
)
live_type
: public
(公开教室)、private
(非公开教室)
batch_type
: one
(周六周日无教室,周一至周五有教室)、two
(周二周三无教室,周四至周一有教室,教室之间的间隔是一天)、three
(每节教室的上课时间间隔 7 天)、four
(同一个时间)
Request Data
{
"admin":"15201052252",
"live_course":2,
"course_type":"normal",
"user_list":"",
"start_time":"2019-04-28 17:30:00",
"total_lesson":4
}
Response
{
"status": 0,
"message": ""
}
批量修改已知教室组某些字段(讲义)
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
PUT |
/server/job_management/update_handout_classrooms/ |
批量修改已知教室组某些字段 |
YES |
Request Parameters
Name |
Description |
Required |
Default |
classrooms |
直播教室pk组 |
YES |
|
handout |
讲义 |
NO |
|
Request Data
{
"classrooms":[66, 67],
"handout":"212"
}
Response
{
"status": 0,
"message": ""
}
批量修改教室的时间
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
PUT |
/server/job_management/update_classrooms/ |
批量修改教室时间 |
YES |
Request Parameters
Name |
Description |
Required |
Default |
live_classroom |
要修改的教室组中的第一个(教室的开始时间靠前的那一个)教室 pk |
YES |
|
start_time |
开始时间 |
YES |
|
batch_type |
|
|
|
course_type
: 直播课(normal)、练习课(practice)、项目课(project)
batch_type
取值如下:
one
周六周日无教室,周一至周五有教室,教室之间的间隔是一天
two
周二周三无教室,周四至周一有教室,教室之间的间隔是一天
three
每节教室的上课时间间隔 7 天
four
同一个时间
Request Data
{
"start_time":"2019-05-08 17:30:00",
"live_classroom":164,
"batch_type":"three"
}
Response
{
"status": 0,
"message": ""
}
批量将直播教室的是否有语音变成 False
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
GET |
/server/job_management/update_is_audio_classrooms/ |
批量修改是否有语音 |
YES |
Request Parameters
Name |
Description |
Required |
Default |
classroom_pks |
批量修改的教室组 pk |
YES |
|
示例:/server/job_management/update_is_audio_classrooms/?classroom_pks=70,71
不传的话,默认修改全部
Response
{
"status": 0,
"message": ""
}
直播教室结束时,获取教室的评分
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
PUT |
/server/job_management/live_classroom_evaluate/ |
直播教室的评分 |
YES |
Request Parameters
Name |
Description |
Required |
Default |
pk |
直播教室的pk |
YES |
|
Response Parameters
Name |
Description |
attendance_rate |
到课率 |
interactive_rate |
互动率 |
right_rate |
正确率 |
Response
{
"pk": 1,
"live_classroom": {
"title": "测试电话提醒",
"pk": 142
},
"attendance_rate": "0.25",
"interactive_rate": "0.50",
"right_rate": "0.00"
}
加入直播教室
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
POST |
/server/classroom/create_attendance/ |
加入直播教室 |
YES |
cURL Example
curl -X POST http://127.0.0.1:8000/server/classroom/create_attendance/ -H 'Content-Type: application/json' -H 'Authorization: Token f5d99e3acf2b3e76d63d4a8a8a2389d86e43d9cc' --data '{"classroom_id":38, "status":"live"}'
Request Parameters
Name |
Description |
Required |
Default |
classroom_id |
直播教室id |
YES |
|
status |
直播教室的状态(直播live 、回放replay ) |
|
|
Request
{
"classroom_id":38,
"status":"replay"
}
Response
{
"id": 2,
"owner": {
"name": "勿问情殇_1111_23",
"avatar": "https://static1.bcjiaoyu.com/bcgame_face2face/15201052252/5690023e83a72af4ff5be0badaadfbe4_k.gif-658x658",
"user": "15201052252",
"nickname": "chen",
"realname": "陈微",
"user_id": 367,
"is_staff": false,
"segment": {
"name": "黄金",
"image": "https://static1.bcjiaoyu.com/community/touxiangkuang/king.png"
}
},
"classroom": 38,
"deleted": false,
"create_time": "2020-04-28T16:12:00.843144",
"order_index": 1000,
"status": "replay"
}