乌鸦思维文档
学管系统
新建书的分类
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
{
"title":"微课",
"content":""
}
Response
{
"pk": 3,
"title": "微课",
"content": ""
}
分类列表
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
GET |
/server/raven_think/list_category/ |
分类列表 |
YES |
Response
{
"count": 3,
"next": null,
"previous": null,
"results": [
{
"pk": 3,
"title": "微课",
"content": ""
},
{
"pk": 2,
"title": "书籍",
"content": ""
},
{
"pk": 1,
"title": "纪录片",
"content": ""
}
]
}
批量新建标签
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
{
"tag_data":{
"国家":["中国", "法国", "意大利"],
"颜色":["红色", "蓝色", "绿色"]
}
}
Response
{
"status": 0,
"message": ""
}
标签列表
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
{
"count": 3,
"next": null,
"previous": null,
"results": [
{
"pk": 3,
"category": {
"pk": 1,
"title": "纪录片",
"content": ""
},
"title": "宇宙",
"content": null
},
{
"pk": 2,
"category": {
"pk": 1,
"title": "纪录片",
"content": ""
},
"title": "自然生态",
"content": null
},
{
"pk": 1,
"category": {
"pk": 1,
"title": "纪录片",
"content": ""
},
"title": "自然科学",
"content": null
}
]
}
新建一本书
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
{
"title": "微观小世界1",
"content": "爆笑喜剧动画共两季176集,每集大概5分钟左右。通篇没有一句对话,以纪录片的风格描述虫虫们的生态环境,同时又演绎出了生动幽默的故事,场景和声音效果都是采用现实中真实的东西,而小昆虫和小动物则是用三维动画技术设计出来的,观感甚佳,老少皆宜。",
"banner": "https://static1.bcjiaoyu.com/bcgame_face2face/13301257976/b'f13475e18b45038ce889c0774c476bea'_s.-400x346",
"audio": "https://static1.bcjiaoyu.com/music/one_one_page1.m4a",
"age_type": "three",
"activity_type": "science_club",
"qrcode_url": "",
"video": "https://www.bilibili.com/video/av12252951/",
"category": 1,
"author": "",
"author_intro": "",
"tag": "自然科学,自然生态,宇宙",
"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"
}
]
}]
}
Response
{
"pk": 30,
"title": "微观小世界1",
"content": "爆笑喜剧动画共两季176集,每集大概5分钟左右。通篇没有一句对话,以纪录片的风格描述虫虫们的生态环境,同时又演绎出了生动幽默的故事,场景和声音效果都是采用现实中真实的东西,而小昆虫和小动物则是用三维动画技术设计出来的,观感甚佳,老少皆宜。",
"banner": "https://static1.bcjiaoyu.com/bcgame_face2face/13301257976/b'f13475e18b45038ce889c0774c476bea'_s.-400x346",
"age_type": "three",
"age_type_display": "4岁以上",
"qrcode_url": "",
"browser_count": 0,
"audio": "https://static1.bcjiaoyu.com/music/one_one_page1.m4a",
"activity_type": "science_club",
"is_unlock": false,
"category": {
"pk": 1,
"title": "纪录片",
"content": ""
},
"create_time": "2019-11-20T16:58:43.788861",
"author": "",
"author_intro": "",
"video": "https://www.bilibili.com/video/av12252951/",
"photos": null,
"tags": [
"宇宙",
"自然生态",
"自然科学"
],
"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\"}]}]"
}
获取书本列表
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
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"pk": 2,
"title": "我是一本 5 岁的书",
"content": "",
"banner": "",
"age_type": "two"
},
{
"pk": 1,
"title": "我是一本 3-5 岁的书",
"content": "",
"banner": "",
"age_type": "one"
}
]
}
获取书本详情
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
{
"pk": 5,
"title": "计算机特长生",
"content": "孩子处于青春期后,思维活跃,渴望独立,逆反心理极强。这本书将告诉所有家长,如何运用正面管教方法。完整成长的过程即是儿童自我创造的过程。",
"banner": "https://static1.bcjiaoyu.com/programMaMa/poster09.png-750x1335",
"age_type": "three",
"age_type_display": "4岁以上",
"qrcode_url": null,
"browser_count": 3,
"audio": "https://static1.bcjiaoyu.com/music/one_one_page1.m4a",
"activity_type": "science_club",
"is_unlock": false,
"category": null,
"create_time": "2019-11-09T16:16:24.490192",
"author": null,
"author_intro": null,
"video": null,
"photos": null
}
课程列表
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
GET |
/server/raven_think/list_course/ |
课程列表 |
YES |
Response
{
"count": 4,
"next": null,
"previous": null,
"results": [
{
"pk": 4,
"title": "皮特与魔法棒",
"content": "理解数的概念和加减法的原理",
"banner": "",
"book": 1
},
{
"pk": 3,
"title": "树叶尺子",
"content": "了解物理感和量感的概念",
"banner": "",
"book": 1
},
{
"pk": 2,
"title": "驼背奶奶与老虎",
"content": "了解物理量和量感的概念",
"banner": "",
"book": 1
},
{
"pk": 1,
"title": "小兔子滚铁环",
"content": "了解生活中的平面图形、立体图形",
"banner": "",
"book": 1
}
]
}
课节列表
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
{
"count": 3,
"next": null,
"previous": null,
"results": [
{
"pk": 3,
"title": "第3节",
"content": "",
"duration": 123,
"audio": "",
"video": "",
"course": 1
},
{
"pk": 2,
"title": "第2节",
"content": "",
"duration": 123,
"audio": "",
"video": "",
"course": 1
},
{
"pk": 1,
"title": "第1节",
"content": "",
"duration": 123,
"audio": "",
"video": "",
"course": 1
}
]
}
我的书本
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
GET |
/server/raven_think/list_mybook/ |
我的书本 |
YES |
Response
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"pk": 1,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"community": {
"post_count": 13,
"work_count": 6
}
},
"book": {
"pk": 1,
"title": "我是一本 3-5 岁的书",
"content": "",
"banner": "",
"age_type": "one"
}
}
]
}
我的课程
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
{
"count": 4,
"next": null,
"previous": null,
"results": [
{
"pk": 8,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"community": {
"post_count": 13,
"work_count": 6
}
},
"course": {
"pk": 1,
"title": "小兔子滚铁环",
"content": "了解生活中的平面图形、立体图形",
"banner": "",
"book": 1
},
"is_unlock": true
},
{
"pk": 7,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"community": {
"post_count": 13,
"work_count": 6
}
},
"course": {
"pk": 2,
"title": "驼背奶奶与老虎",
"content": "了解物理量和量感的概念",
"banner": "",
"book": 1
},
"is_unlock": false
},
{
"pk": 6,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"community": {
"post_count": 13,
"work_count": 6
}
},
"course": {
"pk": 3,
"title": "树叶尺子",
"content": "了解物理感和量感的概念",
"banner": "",
"book": 1
},
"is_unlock": false
},
{
"pk": 5,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"community": {
"post_count": 13,
"work_count": 6
}
},
"course": {
"pk": 4,
"title": "皮特与魔法棒",
"content": "理解数的概念和加减法的原理",
"banner": "",
"book": 1
},
"is_unlock": false
}
]
}
用户领取书本(课程)
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
{
"book":1
}
Response
{"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
{
"book":1
}
Response
{
"pk": 12,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"community": {
"post_count": 13,
"work_count": 6
}
},
"course": {
"pk": 1,
"title": "小兔子滚铁环",
"content": "了解生活中的平面图形、立体图形",
"banner": "",
"book": 1
},
"is_unlock": true
}
用户结束某课节
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
{
"book":1,
"course":1,
"lesson":3
}
Response
{
"pk": 11,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"community": {
"post_count": 13,
"work_count": 6
}
},
"course": {
"pk": 2,
"title": "驼背奶奶与老虎",
"content": "了解物理量和量感的概念",
"banner": "",
"book": 1
},
"is_unlock": true
}
或
{"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
{
"book_id":30,
"question_tag":"1",
"answer":"A"
}
Response
{
"pk": 4,
"owner": {
"name": "勿问情殇",
"avatar": "https://static1.bcjiaoyu.com/5a7ede147308f194ed9b108f98589a07_v.jpg-1080x1920",
"user": "15201052252",
"nickname": "chen",
"user_id": 367,
"is_staff": false
},
"book": 30,
"question_tag": "1",
"answer": "A",
"is_right": true,
"is_diamond": false,
"diamond_count": 0
}
斌叔科普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
{
"username":"15201052251",
"verification_code":"123456",
"code":"081Poj5z1jn0q9037C8z1MPX4z1Poj5Q",
"inviter_username":"15201052252"
}
Response
{
"token": "86436f75498bd0865c4f098cfefdfab1cb1f43f0",
"name": "勿问情殇",
"position": "student",
"is_staff": false
}
验证码登录
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
{
"username":"15201052251",
"verification_code":"123456"
}
Response
{
"token": "86436f75498bd0865c4f098cfefdfab1cb1f43f0",
"name": "勿问情殇",
"position": "student",
"is_staff": false
}
密码登录
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
{
"username":"15201052251",
"password":"123456"
}
Response
{
"token": "86436f75498bd0865c4f098cfefdfab1cb1f43f0",
"name": "勿问情殇",
"position": "student",
"is_staff": false
}
微信登录
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
{
"code":"001oK01l2zEW6D0asg0l2RNQ0l2oK01b"
}
Response
{
"token": "86436f75498bd0865c4f098cfefdfab1cb1f43f0",
"name": "勿问情殇",
"position": "student",
"is_staff": false
}
获取个人信息
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
{
"name": "勿问情殇",
"avatar": "http://thirdwx.qlogo.cn/mmopen/vi_32/DYAIOgq83erbSOQmibPy6OwksNTtIibDHmHiaFf0Gug3ITRjDtJ7ibfgFTKR1TrHnQ2uiaG0oF0B4MjBDEPSxp6psRg/132",
"browser_count": 0,
"join_days": 1,
"join_time": "2019-11-13 11:10:13",
"deadline_days": 3,
"is_deadline": false,
"deadline_time": "2019-11-16 11:10:13",
"invite_count": 0,
"username": "15201052251",
"membership_type": null
}
斌叔科普用户注册列表
Method and URL Structure
Method |
Method Resource URL |
Descriptions |
Authentications Required |
GET |
/server/userinfo/list_science_users/ |
斌叔科普用户注册列表 |
YES |
Response
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"pk": 8948,
"username": "15201052251",
"name": "勿问情殇",
"avatar": "http://thirdwx.qlogo.cn/mmopen/vi_32/DYAIOgq83erbSOQmibPy6OwksNTtIibDHmHiaFf0Gug3ITRjDtJ7ibfgFTKR1TrHnQ2uiaG0oF0B4MjBDEPSxp6psRg/132",
"join_time": "2019-11-15T18:21:01",
"deadline_time": "2019-11-18T18:21:01",
"membership_type": "experience",
"membership_type_display": "体验会员",
"science_openid": "o_CHzwYRfK14bo570r0D6pze8hxo",
"browser_count": 0,
"join_days": 15,
"deadline_days": 0,
"is_deadline": true,
"invite_count": 0,
"is_staff": false,
"diamond": 0,
"create_time": "2019-11-15T18:19:59",
"answer_question_count": 0,
"source": "science_club",
"source_display": "斌叔科普Club"
}
]
}
生成斌叔科普会员订单
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
{
"channel":"alipay"
}
Response
{
"amount": "299.00",
"live_course_id": null,
"channel": "alipay",
"order_number": "12345712423433562736228589",
"channel_display": "支付宝",
"status": 0,
"status_display": "待付款",
"is_done": false,
"order_type_display": "斌叔科普club",
"apple_product_id": "",
"agent_number": null,
"create_time": "2019-11-13T16:33:47.477552",
"coupon": null
}