[关闭]
@chenwei123 2016-05-20T03:13:29.000000Z 字数 5597 阅读 393

直播

美音


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

  1. {
  2. "username":"15201052252",
  3. "password":"123456",
  4. "course_title":"01",
  5. "course_intro":"good",
  6. "lecturer":"test01",
  7. "live_time":"2016-03-03,2016-03-07",
  8. "limit_number":10,
  9. "picture":"http://123.jpg",
  10. "price":10.2,
  11. "thumb":"http://13.jpg",
  12. }

URL Example

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

  1. {
  2. "item": {
  3. "lecturer": "test01",
  4. "picture": "http:123.jpg",
  5. "course_title": "01",
  6. "price": "10.2",
  7. "live_time": "2016-03-3,2016-03-7",
  8. "create_time": "2016-05-17T11:46:09.635",
  9. "auto_play": "YES",
  10. "id": 4,
  11. "token": "",
  12. "web_url": "",
  13. "course_intro": "good",
  14. "lecturer_intro": "very good",
  15. "live_url": "",
  16. "limit_number": "10"
  17. "thumb":"http://123.jpg",
  18. },
  19. "reason": "",
  20. "ret": "success"
  21. }

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

  1. http://127.0.0.1:8000/live/enter_live/?id=2&flag=1&username=teacher1&password=123456

JSON Response

  1. {
  2. "item": {
  3. "lecturer": "teacher01",
  4. "picture": "http://p3.ifengimg.com/cmpp/2016/05/13/08/f601587c-af1d-4832-9320-4ccd796e4fc8_size81_w550_h366.jpg",
  5. "participant_number": 2,
  6. "course_title": "课程2",
  7. "price": "0.00",
  8. "live_time": "2016-03-3,2016-03-7",
  9. "create_time": "2016-05-05T15:49:57.185",
  10. "auto_play": "YES",
  11. "id": 2,
  12. "token": "",
  13. "web_url": "http://test.haoanjing.haorenao.cn:8084/static/liketea/app/me/live.html?opennewwindow=false",
  14. "course_intro": "课程2是一门比较好的课程。",
  15. "lecturer_intro": "他是一名非常优秀的老师",
  16. "live_url": "servicetype=2&uid=30467503&fid=68B6127DC67E56DFEFE86B44B24741A09E83674F",
  17. "limit_number": 10
  18. "thumb":"http://123.jpg",
  19. },
  20. "reason": "",
  21. "ret": "success"
  22. }

3. 进入具体直播频道

Description

用户进入具体直播频道(已付款)

Method and URL Structure

Method Resource URL
GET /live/get_live/

Request Parameters

Name Description Required Default
id 直播id Yes

Request

  1. {
  2. "id":2,
  3. }

URL Example

  1. http://127.0.0.1:8000/live/get_live/?id=2

JSON Response

  1. {
  2. "item": {
  3. "lecturer": "teacher01",
  4. "picture": "http://p3.ifengimg.com/cmpp/2016/05/13/08/f601587c-af1d-4832-9320-4ccd796e4fc8_size81_w550_h366.jpg",
  5. "participant_number": 2,
  6. "course_title": "课程2",
  7. "price": "0.00",
  8. "live_time": "2016-03-3,2016-03-7",
  9. "create_time": "2016-05-05T15:49:57.185",
  10. "auto_play": "YES",
  11. "id": 2,
  12. "token": "",
  13. "web_url": "http://test.haoanjing.haorenao.cn:8084/static/liketea/app/me/live.html?opennewwindow=false",
  14. "course_intro": "课程2是一门比较好的课程。",
  15. "lecturer_intro": "他是一名非常优秀的老师",
  16. "live_url": "servicetype=2&uid=30467503&fid=68B6127DC67E56DFEFE86B44B24741A09E83674F",
  17. "limit_number": 10,
  18. "thumb":"http://123.jpg",
  19. },
  20. "reason": "",
  21. "ret": "success"
  22. }

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

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

  1. {
  2. "items": [
  3. {
  4. "status": -1,
  5. "lecturer": "test01",
  6. "participant_number": 0,
  7. "course_title": "01",
  8. "picture": "http:123.jpg",
  9. "im_id": -1,
  10. "price": "0.00",
  11. "live_time": "2016-03-3,2016-03-7",
  12. "web_url": "",
  13. "im_name": "undefined",
  14. "token": "",
  15. "create_time": "2016-05-17T11:46:09.635",
  16. "course_intro": "good",
  17. "lecturer_intro": "very good",
  18. "auto_play": "YES",
  19. "live_url": "",
  20. "limit_number": 10,
  21. "id": 4
  22. "thumb":"http://123.jpg",
  23. },
  24. {
  25. "status": 0,
  26. "lecturer": "小小",
  27. "participant_number": 0,
  28. "course_title": "课程3",
  29. "picture": "http://p3.ifengimg.com/cmpp/2016/05/13/08/f601587c-af1d-4832-9320-4ccd796e4fc8_size81_w550_h366.jpg",
  30. "im_id": -1,
  31. "price": "10.00",
  32. "live_time": "2016-03-3,2016-03-7",
  33. "web_url": "http://test.haoanjing.haorenao.cn:8084/static/liketea/app/me/live.html?opennewwindow=false",
  34. "im_name": "undefined",
  35. "token": "",
  36. "create_time": "2016-05-05T20:57:45.226",
  37. "course_intro": "这是一个最近比较流行的课目",
  38. "lecturer_intro": "很是阳光灿烂的一个老师",
  39. "auto_play": "YES",
  40. "live_url": "servicetype=2&uid=30467503&fid=68B6127DC67E56DFEFE86B44B24741A09E83674F",
  41. "limit_number": 10,
  42. "id": 3,
  43. "thumb":"http://123.jpg",
  44. },
  45. {
  46. "status": -1,
  47. "lecturer": "teacher01",
  48. "participant_number": 2,
  49. "course_title": "课程2",
  50. "picture": "http://p3.ifengimg.com/cmpp/2016/05/13/08/f601587c-af1d-4832-9320-4ccd796e4fc8_size81_w550_h366.jpg",
  51. "im_id": 7,
  52. "price": "0.00",
  53. "live_time": "2016-03-3,2016-03-7",
  54. "web_url": "http://test.haoanjing.haorenao.cn:8084/static/liketea/app/me/live.html?opennewwindow=false",
  55. "im_name": "聊天室",
  56. "token": "",
  57. "create_time": "2016-05-05T15:49:57.185",
  58. "course_intro": "课程2是一门比较好的课程。",
  59. "lecturer_intro": "他是一名非常优秀的老师",
  60. "auto_play": "YES",
  61. "live_url": "servicetype=2&uid=30467503&fid=68B6127DC67E56DFEFE86B44B24741A09E83674F",
  62. "limit_number": 10,
  63. "id": 2,
  64. "thumb":"http://123.jpg",
  65. },
  66. {
  67. "status": -1,
  68. "lecturer": "test01",
  69. "participant_number": 4,
  70. "course_title": "01",
  71. "picture": "",
  72. "im_id": -1,
  73. "price": "0.00",
  74. "live_time": "2016-03-3,2016-03-7",
  75. "web_url": "http://test.haoanjing.haorenao.cn:8084/static/liketea/app/me/live.html?opennewwindow=false",
  76. "im_name": "undefined",
  77. "token": "",
  78. "create_time": "2016-05-05T15:48:02.654",
  79. "course_intro": "good",
  80. "lecturer_intro": "very good",
  81. "auto_play": "YES",
  82. "live_url": "servicetype=2&uid=30467503&fid=68B6127DC67E56DFEFE86B44B24741A09E83674F",
  83. "limit_number": 10,
  84. "id": 1,
  85. "thumb":"http://123.jpg",
  86. }
  87. ],
  88. "reason": "",
  89. "ret": "success"
  90. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注