-
Notifications
You must be signed in to change notification settings - Fork 2
HTTP API
fushang318 edited this page Jan 14, 2014
·
33 revisions
四叶草知识手册服务端 HTTP API
- 用户登录(登陆成功时返回的信息包括用户姓名头像信息)
- 用户登出
- 知识网列表(切换知识网时的列表)
- 用户某个知识网的经验状态
- 用户某个知识单元网状图
- 知识单元下的节点列表
- 随机获得一个节点下的一个练习题
- 随机获得一个节点下的13个练习题
- 练习成功
包括单元是否解锁信息,是否学习信息,用户的经验状态
url
/knowledge_nets/:id
method
get
response
{
:exp_status => {
:level => status.level,
:level_up_exp_num => status.level_up_exp_num,
:exp_num => status.exp_num,
:total_exp_num => status.total_exp_num
},
:id => net.id,
:name => net.name,
:sets => [
{
:id => set.id,
:name => set.name,
:icon -> set.icon,
:deep => set.deep
:is_unlocked => true,
:is_learned => true,
:node_count => 5,
:learned_node_count => 1
},
...
],
:checkpoints => [
{
:id => checkpoint.id,
:learned_sets => ["set-1","set-2"],
:is_unlocked => true,
:is_learned => true
},
...
],
:relations => [
{
:parent => "set-1",
:child => "set-2"
},
{
:parent => "set-2",
:child => "checkpoint-1"
},
...
]
}
[ { :node_id => "node-31", :id => question.id, :kind => question.kind, :content => question.make_content, :choices => [ "", "", "", "" ], :answer => question.answer
},
...
]
<h2 id="test_success">练习成功</h2>
url /knowledge_nets/:knowledge_net_id/knowledge_nodes/:id/test_success method POST response { :add_exp_num => num, # 本次练习获取的经验值 :history_info => [1, 2, 3, 4, 5] # 最近五天每天获取的经验值 }