[关闭]
@chengxuyuan 2019-11-30T08:37:56.000000Z 字数 13850 阅读 365

乌鸦思维文档

学管系统


新建书的分类

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /server/raven_think/create_category/ 新建分类 YES

Request Parameters

Name Description Required Default
title 分类标题 NO
content 分类简介 NO

Request Data

  1. {
  2. "title":"微课",
  3. "content":""
  4. }

Response

  1. {
  2. "pk": 3,
  3. "title": "微课",
  4. "content": ""
  5. }

分类列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/raven_think/list_category/ 分类列表 YES

Response

  1. {
  2. "count": 3,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 3,
  8. "title": "微课",
  9. "content": ""
  10. },
  11. {
  12. "pk": 2,
  13. "title": "书籍",
  14. "content": ""
  15. },
  16. {
  17. "pk": 1,
  18. "title": "纪录片",
  19. "content": ""
  20. }
  21. ]
  22. }

批量新建标签

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /server/raven_think/create_tag/ 新建标签 YES

Request Parameters

Name Description Required Default
tag_data tag 标签 YES

Request Data

  1. {
  2. "tag_data":{
  3. "国家":["中国", "法国", "意大利"],
  4. "颜色":["红色", "蓝色", "绿色"]
  5. }
  6. }

Response

  1. {
  2. "status": 0,
  3. "message": ""
  4. }

标签列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/raven_think/list_tag/ 标签列表 YES

按条件过滤列表释义如下 :
tag_category分类的 pk: /server/raven_think/list_tag/?tag_category=1

Response

  1. {
  2. "count": 3,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 3,
  8. "category": {
  9. "pk": 1,
  10. "title": "纪录片",
  11. "content": ""
  12. },
  13. "title": "宇宙",
  14. "content": null
  15. },
  16. {
  17. "pk": 2,
  18. "category": {
  19. "pk": 1,
  20. "title": "纪录片",
  21. "content": ""
  22. },
  23. "title": "自然生态",
  24. "content": null
  25. },
  26. {
  27. "pk": 1,
  28. "category": {
  29. "pk": 1,
  30. "title": "纪录片",
  31. "content": ""
  32. },
  33. "title": "自然科学",
  34. "content": null
  35. }
  36. ]
  37. }

新建一本书

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /server/raven_think/create_book/ 新建书本 YES

Request Parameters

Name Description Required Default
title 书的标题 NO
content 书的简介 NO
banner 书的封面图 NO
age_type 年龄段 NO
qrcode_url 微信二维码图片地址 NO
audio 音频地址 NO
activity_type 活动类型(乌鸦思维:raven_think,家长读书会:read_club,斌叔科普:science_club) YES raven_think
category 分类的 pk NO
author 作者的名字 NO
author_intro 作者的介绍 NO
photos 书本详情图片组介绍 NO
tag 标签 NO 多个的话,以逗号隔开
question_json 书本习题配置 NO

age_type: one(2 岁) 、two(2 岁-3 岁)、three(3岁以上)

Request Data

  1. {
  2. "title": "微观小世界1",
  3. "content": "爆笑喜剧动画共两季176集,每集大概5分钟左右。通篇没有一句对话,以纪录片的风格描述虫虫们的生态环境,同时又演绎出了生动幽默的故事,场景和声音效果都是采用现实中真实的东西,而小昆虫和小动物则是用三维动画技术设计出来的,观感甚佳,老少皆宜。",
  4. "banner": "https://static1.bcjiaoyu.com/bcgame_face2face/13301257976/b'f13475e18b45038ce889c0774c476bea'_s.-400x346",
  5. "audio": "https://static1.bcjiaoyu.com/music/one_one_page1.m4a",
  6. "age_type": "three",
  7. "activity_type": "science_club",
  8. "qrcode_url": "",
  9. "video": "https://www.bilibili.com/video/av12252951/",
  10. "category": 1,
  11. "author": "",
  12. "author_intro": "",
  13. "tag": "自然科学,自然生态,宇宙",
  14. "question_json": [{
  15. "type": "adaptProblem",
  16. "answer": "A",
  17. "tag": "1",
  18. "message": "1+1=等于多少呢?",
  19. "imgs": [],
  20. "options": [{
  21. "message": "2",
  22. "imgs": [],
  23. "content": "A"
  24. },
  25. {
  26. "message": "1",
  27. "imgs": [],
  28. "content": "B"
  29. },
  30. {
  31. "message": "3",
  32. "imgs": [],
  33. "content": "C"
  34. }
  35. ]
  36. }]
  37. }

Response

  1. {
  2. "pk": 30,
  3. "title": "微观小世界1",
  4. "content": "爆笑喜剧动画共两季176集,每集大概5分钟左右。通篇没有一句对话,以纪录片的风格描述虫虫们的生态环境,同时又演绎出了生动幽默的故事,场景和声音效果都是采用现实中真实的东西,而小昆虫和小动物则是用三维动画技术设计出来的,观感甚佳,老少皆宜。",
  5. "banner": "https://static1.bcjiaoyu.com/bcgame_face2face/13301257976/b'f13475e18b45038ce889c0774c476bea'_s.-400x346",
  6. "age_type": "three",
  7. "age_type_display": "4岁以上",
  8. "qrcode_url": "",
  9. "browser_count": 0,
  10. "audio": "https://static1.bcjiaoyu.com/music/one_one_page1.m4a",
  11. "activity_type": "science_club",
  12. "is_unlock": false,
  13. "category": {
  14. "pk": 1,
  15. "title": "纪录片",
  16. "content": ""
  17. },
  18. "create_time": "2019-11-20T16:58:43.788861",
  19. "author": "",
  20. "author_intro": "",
  21. "video": "https://www.bilibili.com/video/av12252951/",
  22. "photos": null,
  23. "tags": [
  24. "宇宙",
  25. "自然生态",
  26. "自然科学"
  27. ],
  28. "question_json": "[{\"type\": \"adaptProblem\", \"answer\": \"A\", \"tag\": \"1\", \"message\": \"1+1=等于多少呢?\", \"imgs\": [], \"options\": [{\"message\": \"2\", \"imgs\": [], \"content\": \"A\"}, {\"message\": \"1\", \"imgs\": [], \"content\": \"B\"}, {\"message\": \"3\", \"imgs\": [], \"content\": \"C\"}]}]"
  29. }

获取书本列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/raven_think/list_book/ 书本列表

按条件过滤列表释义如下 :
activity_type活动类型: read_club(家长读书会),raven_think(乌鸦思维),science_club(斌叔科普 club)示例: /server/raven_think/list_book/?activity_type=science_club
category分类的 pk,示例:
/server/raven_think/list_book/?activity_type=science_club&category=1
tags(书本标签pk)示例:/server/raven_think/list_book/?activity_type=science_club&tags=1,2 (多个 tag,以dou)
is_recommend(是否斌叔推荐):/server/raven_think/list_book/?is_recommend=True

按照书名搜索列表释义如下:
search 示例:/server/raven_think/list_book/?search=微观小世界

Response

  1. {
  2. "count": 2,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 2,
  8. "title": "我是一本 5 岁的书",
  9. "content": "",
  10. "banner": "",
  11. "age_type": "two"
  12. },
  13. {
  14. "pk": 1,
  15. "title": "我是一本 3-5 岁的书",
  16. "content": "",
  17. "banner": "",
  18. "age_type": "one"
  19. }
  20. ]
  21. }

获取书本详情

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/raven_think/detail_book/${pk}/ 书本详情

示例: /server/raven_think/detail_book/1/?activity_type=science_club

Response

  1. {
  2. "pk": 5,
  3. "title": "计算机特长生",
  4. "content": "孩子处于青春期后,思维活跃,渴望独立,逆反心理极强。这本书将告诉所有家长,如何运用正面管教方法。完整成长的过程即是儿童自我创造的过程。",
  5. "banner": "https://static1.bcjiaoyu.com/programMaMa/poster09.png-750x1335",
  6. "age_type": "three",
  7. "age_type_display": "4岁以上",
  8. "qrcode_url": null,
  9. "browser_count": 3,
  10. "audio": "https://static1.bcjiaoyu.com/music/one_one_page1.m4a",
  11. "activity_type": "science_club",
  12. "is_unlock": false,
  13. "category": null,
  14. "create_time": "2019-11-09T16:16:24.490192",
  15. "author": null,
  16. "author_intro": null,
  17. "video": null,
  18. "photos": null
  19. }

课程列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/raven_think/list_course/ 课程列表 YES

Response

  1. {
  2. "count": 4,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 4,
  8. "title": "皮特与魔法棒",
  9. "content": "理解数的概念和加减法的原理",
  10. "banner": "",
  11. "book": 1
  12. },
  13. {
  14. "pk": 3,
  15. "title": "树叶尺子",
  16. "content": "了解物理感和量感的概念",
  17. "banner": "",
  18. "book": 1
  19. },
  20. {
  21. "pk": 2,
  22. "title": "驼背奶奶与老虎",
  23. "content": "了解物理量和量感的概念",
  24. "banner": "",
  25. "book": 1
  26. },
  27. {
  28. "pk": 1,
  29. "title": "小兔子滚铁环",
  30. "content": "了解生活中的平面图形、立体图形",
  31. "banner": "",
  32. "book": 1
  33. }
  34. ]
  35. }

课节列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/raven_think/list_lesson/ 课节列表 YES

按条件过滤列表释义如下 :
course(课程 pk): 示例: /server/raven_think/list_lesson/?course=1
上述参数可自由组合

Response

  1. {
  2. "count": 3,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 3,
  8. "title": "第3节",
  9. "content": "",
  10. "duration": 123,
  11. "audio": "",
  12. "video": "",
  13. "course": 1
  14. },
  15. {
  16. "pk": 2,
  17. "title": "第2节",
  18. "content": "",
  19. "duration": 123,
  20. "audio": "",
  21. "video": "",
  22. "course": 1
  23. },
  24. {
  25. "pk": 1,
  26. "title": "第1节",
  27. "content": "",
  28. "duration": 123,
  29. "audio": "",
  30. "video": "",
  31. "course": 1
  32. }
  33. ]
  34. }

我的书本

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/raven_think/list_mybook/ 我的书本 YES

Response

  1. {
  2. "count": 1,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 1,
  8. "owner": {
  9. "name": "勿问情殇",
  10. "avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
  11. "user": "15201052252",
  12. "nickname": "chen",
  13. "user_id": 367,
  14. "community": {
  15. "post_count": 13,
  16. "work_count": 6
  17. }
  18. },
  19. "book": {
  20. "pk": 1,
  21. "title": "我是一本 3-5 岁的书",
  22. "content": "",
  23. "banner": "",
  24. "age_type": "one"
  25. }
  26. }
  27. ]
  28. }

我的课程

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/raven_think/list_mycourse/ 我的课程 YES

按条件过滤列表释义如下 :
book(书本 pk): 示例: /server/raven_think/list_mycourse/?book=1
上述参数可自由组合

Response

  1. {
  2. "count": 4,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 8,
  8. "owner": {
  9. "name": "勿问情殇",
  10. "avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
  11. "user": "15201052252",
  12. "nickname": "chen",
  13. "user_id": 367,
  14. "community": {
  15. "post_count": 13,
  16. "work_count": 6
  17. }
  18. },
  19. "course": {
  20. "pk": 1,
  21. "title": "小兔子滚铁环",
  22. "content": "了解生活中的平面图形、立体图形",
  23. "banner": "",
  24. "book": 1
  25. },
  26. "is_unlock": true
  27. },
  28. {
  29. "pk": 7,
  30. "owner": {
  31. "name": "勿问情殇",
  32. "avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
  33. "user": "15201052252",
  34. "nickname": "chen",
  35. "user_id": 367,
  36. "community": {
  37. "post_count": 13,
  38. "work_count": 6
  39. }
  40. },
  41. "course": {
  42. "pk": 2,
  43. "title": "驼背奶奶与老虎",
  44. "content": "了解物理量和量感的概念",
  45. "banner": "",
  46. "book": 1
  47. },
  48. "is_unlock": false
  49. },
  50. {
  51. "pk": 6,
  52. "owner": {
  53. "name": "勿问情殇",
  54. "avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
  55. "user": "15201052252",
  56. "nickname": "chen",
  57. "user_id": 367,
  58. "community": {
  59. "post_count": 13,
  60. "work_count": 6
  61. }
  62. },
  63. "course": {
  64. "pk": 3,
  65. "title": "树叶尺子",
  66. "content": "了解物理感和量感的概念",
  67. "banner": "",
  68. "book": 1
  69. },
  70. "is_unlock": false
  71. },
  72. {
  73. "pk": 5,
  74. "owner": {
  75. "name": "勿问情殇",
  76. "avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
  77. "user": "15201052252",
  78. "nickname": "chen",
  79. "user_id": 367,
  80. "community": {
  81. "post_count": 13,
  82. "work_count": 6
  83. }
  84. },
  85. "course": {
  86. "pk": 4,
  87. "title": "皮特与魔法棒",
  88. "content": "理解数的概念和加减法的原理",
  89. "banner": "",
  90. "book": 1
  91. },
  92. "is_unlock": false
  93. }
  94. ]
  95. }

用户领取书本(课程)

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/raven_think/receive_mybook/ 用户领取 YES

Request Parameters

Name Description Required Default
book 书的 pk NO

Request Data

  1. {
  2. "book":1
  3. }

Response

  1. {"status":0, "message":""}

用户解锁某个书本下的待解锁课程的首个课程

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/raven_think/unlock_next_mycourse/ 解锁课程 YES

Request Parameters

Name Description Required Default
book 书的 pk NO

Request Data

  1. {
  2. "book":1
  3. }

Response

  1. {
  2. "pk": 12,
  3. "owner": {
  4. "name": "勿问情殇",
  5. "avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
  6. "user": "15201052252",
  7. "nickname": "chen",
  8. "user_id": 367,
  9. "community": {
  10. "post_count": 13,
  11. "work_count": 6
  12. }
  13. },
  14. "course": {
  15. "pk": 1,
  16. "title": "小兔子滚铁环",
  17. "content": "了解生活中的平面图形、立体图形",
  18. "banner": "",
  19. "book": 1
  20. },
  21. "is_unlock": true
  22. }

用户结束某课节

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /server/raven_think/finish_mylesson/ 结束课节 YES

Request Parameters

Name Description Required Default
book 书的 pk YES
course 课程的pk YES
lesson 课节的pk YES

Request Data

  1. {
  2. "book":1,
  3. "course":1,
  4. "lesson":3
  5. }

Response

  1. {
  2. "pk": 11,
  3. "owner": {
  4. "name": "勿问情殇",
  5. "avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
  6. "user": "15201052252",
  7. "nickname": "chen",
  8. "user_id": 367,
  9. "community": {
  10. "post_count": 13,
  11. "work_count": 6
  12. }
  13. },
  14. "course": {
  15. "pk": 2,
  16. "title": "驼背奶奶与老虎",
  17. "content": "了解物理量和量感的概念",
  18. "banner": "",
  19. "book": 1
  20. },
  21. "is_unlock": true
  22. }
  23. {"status":0, "message":""}

创建书本答题记录

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /server/raven_think/create_answer_record/ 新建答题记录 YES

Request Parameters

Name Description Required Default
book_id 书本的pk YES
question_tag 书本中习题的 tag 编号 YES
answer 用户的答案 YES

Request

  1. {
  2. "book_id":30,
  3. "question_tag":"1",
  4. "answer":"A"
  5. }

Response

  1. {
  2. "pk": 4,
  3. "owner": {
  4. "name": "勿问情殇",
  5. "avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
  6. "user": "15201052252",
  7. "nickname": "chen",
  8. "user_id": 367,
  9. "is_staff": false
  10. },
  11. "book": 30,
  12. "question_tag": "1",
  13. "answer": "A",
  14. "is_right": true,
  15. "is_diamond": false,
  16. "diamond_count": 0
  17. }

斌叔科普club

验证码注册

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /server/userinfo/science_login/ 验证码注册 NO

Request Parameters

Name Description Required Default
username 用户的账号 YES
verification_code 验证码 YES
code 微信授权获取用户信息的码 YES
inviter_username 邀请者的账号 NO

code,用于存储用户的头像、昵称、和 openid (便于后面的微信登录)

Request Data

  1. {
  2. "username":"15201052251",
  3. "verification_code":"123456",
  4. "code":"081Poj5z1jn0q9037C8z1MPX4z1Poj5Q",
  5. "inviter_username":"15201052252"
  6. }

Response

  1. {
  2. "token": "86436f75498bd0865c4f098cfefdfab1cb1f43f0",
  3. "name": "勿问情殇",
  4. "position": "student",
  5. "is_staff": false
  6. }

验证码登录

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /server/userinfo/science_login/ 验证码登录 NO

Request Parameters

Name Description Required Default
username 用户的账号 YES
verification_code 验证码 YES

Request Data

  1. {
  2. "username":"15201052251",
  3. "verification_code":"123456"
  4. }

Response

  1. {
  2. "token": "86436f75498bd0865c4f098cfefdfab1cb1f43f0",
  3. "name": "勿问情殇",
  4. "position": "student",
  5. "is_staff": false
  6. }

密码登录

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /server/userinfo/science_login/ 密码登录 NO

Request Parameters

Name Description Required Default
username 用户的账号 YES
password 密码 YES

Request Data

  1. {
  2. "username":"15201052251",
  3. "password":"123456"
  4. }

Response

  1. {
  2. "token": "86436f75498bd0865c4f098cfefdfab1cb1f43f0",
  3. "name": "勿问情殇",
  4. "position": "student",
  5. "is_staff": false
  6. }

微信登录

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /server/userinfo/science_login/ 微信登录 NO

Request Parameters

Name Description Required Default
code 微信授权获取用户信息的码 YES

Request Data

  1. {
  2. "code":"001oK01l2zEW6D0asg0l2RNQ0l2oK01b"
  3. }

Response

  1. {
  2. "token": "86436f75498bd0865c4f098cfefdfab1cb1f43f0",
  3. "name": "勿问情殇",
  4. "position": "student",
  5. "is_staff": false
  6. }

获取个人信息

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/userinfo/science_userinfo/ 获取个人信息 YES

Response Parameters

Name Description
name 用户名称
avatar 头像
browser_count 书本浏览数量
join_days 加入 club 多少天
join_time 加入 club 的时间
is_deadline 会员是否到期
deadline_days 会员剩余天数
deadline_time 会员截止时间
invite_count 已邀请的用户数
username 当前登录者的账号
membership_type 会员类型(experience:经验, normal:正式)

Response

  1. {
  2. "name": "勿问情殇",
  3. "avatar": "http://thirdwx.qlogo.cn/mmopen/vi_32/DYAIOgq83erbSOQmibPy6OwksNTtIibDHmHiaFf0Gug3ITRjDtJ7ibfgFTKR1TrHnQ2uiaG0oF0B4MjBDEPSxp6psRg/132",
  4. "browser_count": 0,
  5. "join_days": 1,
  6. "join_time": "2019-11-13 11:10:13",
  7. "deadline_days": 3,
  8. "is_deadline": false,
  9. "deadline_time": "2019-11-16 11:10:13",
  10. "invite_count": 0,
  11. "username": "15201052251",
  12. "membership_type": null
  13. }

斌叔科普用户注册列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/userinfo/list_science_users/ 斌叔科普用户注册列表 YES

Response

  1. {
  2. "count": 1,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 8948,
  8. "username": "15201052251",
  9. "name": "勿问情殇",
  10. "avatar": "http://thirdwx.qlogo.cn/mmopen/vi_32/DYAIOgq83erbSOQmibPy6OwksNTtIibDHmHiaFf0Gug3ITRjDtJ7ibfgFTKR1TrHnQ2uiaG0oF0B4MjBDEPSxp6psRg/132",
  11. "join_time": "2019-11-15T18:21:01",
  12. "deadline_time": "2019-11-18T18:21:01",
  13. "membership_type": "experience",
  14. "membership_type_display": "体验会员",
  15. "science_openid": "o_CHzwYRfK14bo570r0D6pze8hxo",
  16. "browser_count": 0,
  17. "join_days": 15,
  18. "deadline_days": 0,
  19. "is_deadline": true,
  20. "invite_count": 0,
  21. "is_staff": false,
  22. "diamond": 0,
  23. "create_time": "2019-11-15T18:19:59",
  24. "answer_question_count": 0,
  25. "source": "science_club",
  26. "source_display": "斌叔科普Club"
  27. }
  28. ]
  29. }

生成斌叔科普会员订单

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /server/market/science_club_purchase/ 生成斌叔科普会员订单 YES

Request Parameters

Name Description
channel 支付方式(支付宝:alipay, 微信:wx_pub)

Request

  1. {
  2. "channel":"alipay"
  3. }

Response

  1. {
  2. "amount": "299.00",
  3. "live_course_id": null,
  4. "channel": "alipay",
  5. "order_number": "12345712423433562736228589",
  6. "channel_display": "支付宝",
  7. "status": 0,
  8. "status_display": "待付款",
  9. "is_done": false,
  10. "order_type_display": "斌叔科普club",
  11. "apple_product_id": "",
  12. "agent_number": null,
  13. "create_time": "2019-11-13T16:33:47.477552",
  14. "coupon": null
  15. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注