生成知识点网络
开发中POST
/network上传本地的所有课程的topic和point,返回由这些知识点构成的图数据结构。数据结构由ECharts定义。
注意对应关系:Node.name - NodeLink.source/NodeLink.target,NodeCategory.idx - Node.category。
请求参数
Body 参数application/json
lectures
array [object {3}]
必需
id
integer
课程id
是节点路由的一部分。
topic
string
课程主题
是节点名。
points
array[object (Point) {5}]
必需
其中的name是节点名,也是节点路由的一部分。importance和节点大小有关。
示例
{
"lectures": [
{
"id": 0,
"topic": "string",
"points": [
{
"name": "string",
"importance": 1,
"subtitles": [
{
"subtitle": "string",
"md": "string",
"raw_recognition": [
{
"start": 0,
"end": 0,
"text": "string"
}
]
}
],
"links": [
{
"name": "string",
"href": "string"
}
],
"summary": "string"
}
]
}
]
}
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
nodes
array[object (Node) {5}]
节点
注意:课程主题topic和课程的所有知识点point都会作为节点。
idx
integer | null
节点索引
节点编号,从0开始。
>= 0
name
string
节点名称
可能是topic或者point.name,主键,关联NodeLink.source/target
category
integer
节点组别
和NodeCategory.idx对应,外键。
>= 0
size
integer
节点大小
对于topic来说固定为5,对于point来说为其importance,即1-5.
>= 1<= 5
route
object (NoteRoute)
节点路由
用于点击按钮跳转到前端指定的页面。格式如下:
对于topic来说:传入课程id。
对于point来说:传入课程id和知识点名称point.name。
暂时不用管subtitle字段。
categories
array[object (NodeCategory) {2}]
节点类别
注意:每个topic为一个category。
idx
integer
类别索引
主键,从0开始依次编号,和Node中的category节点相对应。
name
string
类别名
值和topic相同。
links
array[object (NodeLink) {4}]
节点链接
注意:topic节点和其子point节点之间需要建立链接、各point之间也可以建立链接。
source
string
来源节点
关联Node.name,外键。
target
string
目标节点
关联Node.name,外键。
weight
integer
关系权重
1-5。数字越大表示关系越紧密。
>= 1<= 5
isUserGenerated
boolean
是否由用户自己链接
所有从后端传来的NodeLink此字段均为false.
默认值:
false
示例
{
"nodes": [
{
"idx": 0,
"name": "string",
"category": 0,
"size": 1,
"route": {
"id": 0,
"point": "string",
"subtitle": "string"
}
}
],
"categories": [
{
"idx": 0,
"name": "string"
}
],
"links": [
{
"source": "string",
"target": "string",
"weight": 1,
"isUserGenerated": false
}
]
}
最后修改时间: 1 个月前