直播
美音
1. 创建直播频道
Description
用户创建直播频道
Method and URL Structure
| Method |
Resource URL |
| GET |
/live/create_live/ |
Request Parameters
| Name |
Description |
Required |
Default |
| username |
用户账号 |
Yes |
|
| password |
密码 |
Yes |
|
| course_title |
直播课标题 |
Yes |
|
| course_intro |
直播课简介 |
Yes |
|
| lecturer |
讲师 |
Yes |
|
| lecturer_intro |
讲师介绍 |
Yes |
|
| live_time |
直播时间 |
Yes |
|
| limit_number |
限制人数 |
Yes |
|
| picture |
直播课图片 |
Yes |
|
| price |
直播课价格 |
Yes |
|
| thumb |
老师头像 |
Yes |
|
Request
{ "username":"15201052252", "password":"123456", "course_title":"01", "course_intro":"good", "lecturer":"test01", "live_time":"2016-03-03,2016-03-07", "limit_number":10, "picture":"http://123.jpg", "price":10.2, "thumb":"http://13.jpg",}
URL Example
http://127.0.0.1:8000/live/create_live/?course_title=01&course_intro=good&lecturer=test01&lecturer_intro=very%20good&live_time=2016-03-3,2016-03-7&limit_number=10&picture=http://123.jpg&price=10.2&thumb=http://123.jpg&username=15201052252&password=123456
JSON Response
{ "item": { "lecturer": "test01", "picture": "http:123.jpg", "course_title": "01", "price": "10.2", "live_time": "2016-03-3,2016-03-7", "create_time": "2016-05-17T11:46:09.635", "auto_play": "YES", "id": 4, "token": "", "web_url": "", "course_intro": "good", "lecturer_intro": "very good", "live_url": "", "limit_number": "10" "thumb":"http://123.jpg", }, "reason": "", "ret": "success"}
2. 加入/退出直播频道
Description
用户进入/退出直播频道(课程免费时,直接进入)
Method and URL Structure
| Method |
Resource URL |
| GET |
/live/enter_live/ |
Request Parameters
| Name |
Description |
Required |
Default |
| username |
用户帐户 |
Yes |
|
| password |
密码 |
Yes |
|
| id |
直播id |
Yes |
|
| flag |
进入/退出的判断 |
Yes |
|
flag 字段存在并且值为1时,进入,其余均为退出。
URL Example
http://127.0.0.1:8000/live/enter_live/?id=2&flag=1&username=teacher1&password=123456
JSON Response
{ "item": { "lecturer": "teacher01", "picture": "http://p3.ifengimg.com/cmpp/2016/05/13/08/f601587c-af1d-4832-9320-4ccd796e4fc8_size81_w550_h366.jpg", "participant_number": 2, "course_title": "课程2", "price": "0.00", "live_time": "2016-03-3,2016-03-7", "create_time": "2016-05-05T15:49:57.185", "auto_play": "YES", "id": 2, "token": "", "web_url": "http://test.haoanjing.haorenao.cn:8084/static/liketea/app/me/live.html?opennewwindow=false", "course_intro": "课程2是一门比较好的课程。", "lecturer_intro": "他是一名非常优秀的老师", "live_url": "servicetype=2&uid=30467503&fid=68B6127DC67E56DFEFE86B44B24741A09E83674F", "limit_number": 10 "thumb":"http://123.jpg", }, "reason": "", "ret": "success"}
3. 进入具体直播频道
Description
用户进入具体直播频道(已付款)
Method and URL Structure
| Method |
Resource URL |
| GET |
/live/get_live/ |
Request Parameters
| Name |
Description |
Required |
Default |
| id |
直播id |
Yes |
|
Request
{ "id":2,}
URL Example
http://127.0.0.1:8000/live/get_live/?id=2
JSON Response
{ "item": { "lecturer": "teacher01", "picture": "http://p3.ifengimg.com/cmpp/2016/05/13/08/f601587c-af1d-4832-9320-4ccd796e4fc8_size81_w550_h366.jpg", "participant_number": 2, "course_title": "课程2", "price": "0.00", "live_time": "2016-03-3,2016-03-7", "create_time": "2016-05-05T15:49:57.185", "auto_play": "YES", "id": 2, "token": "", "web_url": "http://test.haoanjing.haorenao.cn:8084/static/liketea/app/me/live.html?opennewwindow=false", "course_intro": "课程2是一门比较好的课程。", "lecturer_intro": "他是一名非常优秀的老师", "live_url": "servicetype=2&uid=30467503&fid=68B6127DC67E56DFEFE86B44B24741A09E83674F", "limit_number": 10, "thumb":"http://123.jpg", }, "reason": "", "ret": "success"}
4. 获取所有直播课程
Description
获取所有的直播频道
Method and URL Structure
| Method |
Resource URL |
| GET |
/live/get_lives/ |
Request Parameters
| Name |
Description |
Required |
Default |
| username |
用户帐户 |
Yes |
|
| password |
密码 |
Yes |
|
| page |
分页 |
Yes |
|
URL Example
http://127.0.0.1:8000/live/get_lives/?username=teacher1&password=123456&page=1
JSON Response Parameters
- status: 为-1时,免费课程;为0时,需要购买;为1时,已经购买。
- im_id=-1 或者 im_name=undefined,该直播课没有创建聊天室
JSON Response
{ "items": [ { "status": -1, "lecturer": "test01", "participant_number": 0, "course_title": "01", "picture": "http:123.jpg", "im_id": -1, "price": "0.00", "live_time": "2016-03-3,2016-03-7", "web_url": "", "im_name": "undefined", "token": "", "create_time": "2016-05-17T11:46:09.635", "course_intro": "good", "lecturer_intro": "very good", "auto_play": "YES", "live_url": "", "limit_number": 10, "id": 4 "thumb":"http://123.jpg", }, { "status": 0, "lecturer": "小小", "participant_number": 0, "course_title": "课程3", "picture": "http://p3.ifengimg.com/cmpp/2016/05/13/08/f601587c-af1d-4832-9320-4ccd796e4fc8_size81_w550_h366.jpg", "im_id": -1, "price": "10.00", "live_time": "2016-03-3,2016-03-7", "web_url": "http://test.haoanjing.haorenao.cn:8084/static/liketea/app/me/live.html?opennewwindow=false", "im_name": "undefined", "token": "", "create_time": "2016-05-05T20:57:45.226", "course_intro": "这是一个最近比较流行的课目", "lecturer_intro": "很是阳光灿烂的一个老师", "auto_play": "YES", "live_url": "servicetype=2&uid=30467503&fid=68B6127DC67E56DFEFE86B44B24741A09E83674F", "limit_number": 10, "id": 3, "thumb":"http://123.jpg", }, { "status": -1, "lecturer": "teacher01", "participant_number": 2, "course_title": "课程2", "picture": "http://p3.ifengimg.com/cmpp/2016/05/13/08/f601587c-af1d-4832-9320-4ccd796e4fc8_size81_w550_h366.jpg", "im_id": 7, "price": "0.00", "live_time": "2016-03-3,2016-03-7", "web_url": "http://test.haoanjing.haorenao.cn:8084/static/liketea/app/me/live.html?opennewwindow=false", "im_name": "聊天室", "token": "", "create_time": "2016-05-05T15:49:57.185", "course_intro": "课程2是一门比较好的课程。", "lecturer_intro": "他是一名非常优秀的老师", "auto_play": "YES", "live_url": "servicetype=2&uid=30467503&fid=68B6127DC67E56DFEFE86B44B24741A09E83674F", "limit_number": 10, "id": 2, "thumb":"http://123.jpg", }, { "status": -1, "lecturer": "test01", "participant_number": 4, "course_title": "01", "picture": "", "im_id": -1, "price": "0.00", "live_time": "2016-03-3,2016-03-7", "web_url": "http://test.haoanjing.haorenao.cn:8084/static/liketea/app/me/live.html?opennewwindow=false", "im_name": "undefined", "token": "", "create_time": "2016-05-05T15:48:02.654", "course_intro": "good", "lecturer_intro": "very good", "auto_play": "YES", "live_url": "servicetype=2&uid=30467503&fid=68B6127DC67E56DFEFE86B44B24741A09E83674F", "limit_number": 10, "id": 1, "thumb":"http://123.jpg", } ], "reason": "", "ret": "success"}