|
|
1 tahun lalu | |
|---|---|---|
| build | 1 tahun lalu | |
| docker | 1 tahun lalu | |
| src | 1 tahun lalu | |
| test | 1 tahun lalu | |
| .dockerignore | 1 tahun lalu | |
| .gitattributes | 1 tahun lalu | |
| .gitignore | 1 tahun lalu | |
| README_API.md | 1 tahun lalu | |
| YGNT.Exam.sln | 1 tahun lalu | |
| YGNT.Exam.sln.DotSettings | 1 tahun lalu | |
| 组卷系统交接文档.txt | 1 tahun lalu |
HTTPS || HTTP协议
本文档的接口遵循RESTful设计风格。
HTTP通讯及报文BASE64编码均采用UTF-8字符集编码格式。
元素出现要求说明:
| 符号 | 说明 |
|---|---|
| R | 报文中该元素必须出现(Required) |
| O | 报文中该元素可选出现(Optional) |
| C | 报文中该元素在一定条件下出现(Conditional) |
报文规范仅针对交易请求数据进行描述;
报文规范中请求报文的内容为Https请求报文中RequestData值的明文内容;
报文规范分为请求报文和响应报文。请求报文描述由发起方,响应报文由报文接收方响应。
接口只接收两个参数 RequestData 和 SignData ,其中RequestData的值为请求内容,SignData的值为签名内容。
RequestData(请求内容): 其明文为每次请求的具体参数,采用 JSON 格式,依次经过 DES 加密(以UTF-8编码、BASE64编码输出结果)和 URLEncode 后,作为 RequestData 的值。
SignData(签名内容): 请求参数(明文)的MD5加密字符串,用于校验RequestData是否合法。
采用JSON格式,其中包含Header(公有参数)、Body(私有参数)节点:
| 名称 | 描述 | 备注 |
|---|---|---|
| 公共参数 | 每个接口都包含的通用参数,以JSON格式存放在Header属性 | 详见以下公共参数说明 |
| 私有参数 | 每个接口特有的参数,以JSON格式存放在Body属性 | 详见每个接口定义 |
公共参数说明:
公共参数(Header)是用于标识产品及接口鉴权的参数,每次请求均需要携带这些参数:
| 参数名称 | 类型 | 出现要求 | 描述 |
|---|---|---|---|
| authorization | string | R | 用户登录后token,没有登录则为空字符串 |
| 参数名称 | 类型 | 出现要求 | 描述 |
|---|---|---|---|
| Header | R | 请求报文头 | |
| authorization | string | R | 用户登录后token,没有登录则为空字符串 |
请求示例:
{
"Header":{
"authorization":"",
},
}
| 参数名称 | 类型 | 出现要求 | 描述 |
|---|---|---|---|
| success | bool | R | 响应码,true为成功,false失败 |
| error | string | R | |
| result | array | R | |
| name | string | R | 名称 |
| value | string | R | ID |
示例:
{
"success":true,
"error":null,
"result":[{
"name":'容易',
"value":1,
}]
}
| 参数名称 | 类型 | 出现要求 | 描述 |
|---|---|---|---|
| Header | R | 请求报文头 | |
| authorization | string | R | 用户登录后token,没有登录则为空字符串 |
| Body | R | ||
| EducationCategoryId | int | O | 教育类别Id |
| KeyWord | string | O | 学科名称 |
| SkipCount | int | R | 开始记录数 |
| MaxResultCount | int | R | 记录的条数 |
请求示例:
{
"Header":{
"authorization":"",
},
"Body":{
"EducationCategoryId":null,
"KeyWord":null,
"SkipCount":0,
"MaxResultCount":9999
}
}
| 参数名称 | 类型 | 出现要求 | 描述 |
|---|---|---|---|
| success | bool | R | 响应码,true为成功,false失败 |
| error | string | R | |
| result | object | R | |
| totalCount | int | R | 总记录数 |
| items | array | R | |
| id | int | R | 学科ID |
| name | string | R | 学科名称 |
| educationCategoryId | int | R | 教育类别Id |
| EducationCategory | string | R | 教育类别名称 |
示例:
{
"success":true,
"error":null,
"result":{
"totalCount":1,
"items":[{
"id":10,
"name":"数学",
"educationCategoryId":4,
"EducationCategory":"高中"
}],
}
}
| 参数名称 | 类型 | 出现要求 | 描述 |
|---|---|---|---|
| Header | R | 请求报文头 | |
| authorization | string | R | 用户登录后token,没有登录则为空字符串 |
| Body | R | ||
| educationCategoryId | int | O | 教育类别Id |
| DisciplineId | int | O | 学科id |
| IsActive | bool | O | 是否激活 |
| SkipCount | int | R | 开始记录数 |
| MaxResultCount | int | R | 记录的条数 |
请求示例:
{
"Header":{
"authorization":"",
},
"Body":{
"EducationCategoryId":null,
"DisciplineId":10,
"IsActive":true,
"SkipCount":0,
"MaxResultCount":9999
}
}
| 参数名称 | 类型 | 出现要求 | 描述 |
|---|---|---|---|
| success | bool | R | 响应码,true为成功,false失败 |
| error | string | R | |
| result | object | R | |
| totalCount | int | R | 总记录数 |
| items | array | R | |
| id | int | R | 教材ID |
| name | string | R | 教材名称 |
| isActive | bool | R | 是否激活 |
| educationCategory | string | R | 教育类别名称 |
| disciplineId | int | R | 学科ID |
| discipline | string | R | 学科名称 |
示例:
{
"success":true,
"error":null,
"result":{
"totalCount":1,
"items":[{
"id":2,
"name":"教材1",
"isActive":4,
"educationCategory":"高中",
"disciplineId":10,
"discipline":"数学"
}],
}
}
| 参数名称 | 类型 | 出现要求 | 描述 |
|---|---|---|---|
| Header | R | 请求报文头 | |
| authorization | string | R | 用户登录后token,没有登录则为空字符串 |
| Body | R | ||
| ParentId | int | O | 父章节Id |
| TextbookId | int | R | 教材id |
| KeyWord | string | O | 章节名称 |
| SkipCount | int | R | 开始记录数 |
| MaxResultCount | int | R | 记录的条数 |
请求示例:
{
"Header":{
"authorization":"",
},
"Body":{
"ParentId":null,
"TextbookId":2,
"KeyWord":null,
"SkipCount":0,
"MaxResultCount":9999
}
}
| 参数名称 | 类型 | 出现要求 | 描述 |
|---|---|---|---|
| success | bool | R | 响应码,true为成功,false失败 |
| error | string | R | |
| result | object | R | |
| totalCount | int | R | 总记录数 |
| items | array | R | |
| id | int | R | 章节ID |
| name | string | R | 章节名称 |
| parentId | int | R | 父章节Id |
| disciplineId | int | R | 学科ID |
| discipline | string | R | 学科名称 |
| textbookId | string | R | 教材id |
| textbook | string | R | 教材名称 |
| path | string | R | 章节名称路径 |
| hasChild | true | R | 是否有子章节 |
示例:
{
"success":true,
"error":null,
"result":{
"totalCount":1,
"items":[{
"id":33,
"name":"章节1",
"parentId":null,
"disciplineId":10,
"discipline":"数学",
"textbookId":2,
"textbook":"教材1",
"path":"章节1",
"hasChild":true
}],
}
}
| 参数名称 | 类型 | 出现要求 | 描述 |
|---|---|---|---|
| Header | R | 请求报文头 | |
| authorization | string | R | 用户登录后token,没有登录则为空字符串 |
| Body | R | ||
| disciplineId | int | R | 学科id |
请求示例:
{
"Header":{
"authorization":"",
},
"Body":{
"disciplineId":10
}
}
| 参数名称 | 类型 | 出现要求 | 描述 |
|---|---|---|---|
| success | bool | R | 响应码,true为成功,false失败 |
| error | string | R | |
| result | array | R | |
| id | int | R | 试题题型Id |
| name | string | R | 试题题型名称 |
| discipline | string | R | 学科名称 |
| questionCategory | string | R | 试题类别 代码定义请见“附录A 试题类别说明” |
| questionType | string | R | 试题类型 |
示例:
{
"success":true,
"error":null,
"result":[{
"id":18,
"name":"单选题1",
"discipline":"数学",
"questionCategory":0,
"questionType":"单选题"
}]
}
| 参数名称 | 类型 | 出现要求 | 描述 |
|---|---|---|---|
| Header | R | 请求报文头 | |
| authorization | string | R | 用户登录后token,没有登录则为空字符串 |
| Body | R | ||
| ParentId | int | O | 父知识点Id |
| DisciplineId | int | O | 学科id |
| CognitiveAbilityId | int | O | 认知能力Id |
| KeyWord | string | O | 知识点名称 |
| SkipCount | int | R | 开始记录数 |
| MaxResultCount | int | R | 记录的条数 |
请求示例:
{
"Header":{
"authorization":"",
},
"Body":{
"ParentId":null,
"DisciplineId":10,
"CognitiveAbilityId":null,
"KeyWord":null,
"SkipCount":0,
"MaxResultCount":9999
}
}
| 参数名称 | 类型 | 出现要求 | 描述 |
|---|---|---|---|
| success | bool | R | 响应码,true为成功,false失败 |
| error | string | R | |
| result | object | R | |
| totalCount | int | R | 总记录数 |
| items | array | R | |
| id | int | R | 知识点ID |
| name | string | R | 知识点名称 |
| parentId | int | R | 父知识点Id |
| disciplineId | int | R | 学科ID |
| discipline | string | R | 学科名称 |
| cognitiveAbilityId | string | R | 认知能力Id |
| cognitiveAbility | string | R | 认知能力称 |
| path | string | R | 章知识点名称路径 |
| hasChild | true | R | 是否有子知识点 |
示例:
{
"success":true,
"error":null,
"result":{
"totalCount":1,
"items":[{
"id":110,
"name":"三角函数的相关概念",
"parentId":null,
"disciplineId":10,
"discipline":"数学",
"cognitiveAbilityId":0,
"cognitiveAbility":null,
"path":"三角函数的相关概念",
"hasChild":true
}],
}
}
| 参数名称 | 类型 | 出现要求 | 描述 |
|---|---|---|---|
| Header | R | 请求报文头 | |
| authorization | string | R | 用户登录后token,没有登录则为空字符串 |
| Body | R | ||
| DisciplineId | int | R | 学科id |
| QuestionTypeId | int | O | 题型Id |
| DisciplineQuestionTypeId | int | O | 学科细分题型Id |
| Difficulty | int | O | 试题难度 代码定义请见“附录B 试题难度说明” |
| IsActive | bool | O | 是否激活 |
| KnowledgePointIdList | array | O | 知识点id |
| ChapterId | long | O | 章节id |
| IncludeChildChapter | bool | O | 是否包括子章节(默认包括) |
| IncludeAncestor | bool | O | 是否包括父级知识点(默认不包括) |
| StartAriseTime | datetime | O | 出题年份(范围开始) |
| EndAriseTime | datetime | O | 出题年份(范围结束) |
| KeyWord | string | O | 试题简称 |
| SkipCount | int | R | 开始记录数 |
| MaxResultCount | int | R | 记录的条数 |
| 参数名称 | 类型 | 出现要求 | 描述 |
|---|---|---|---|
| success | bool | R | 响应码,true为成功,false失败 |
| error | string | R | |
| result | object | R | |
| totalCount | int | R | 总记录数 |
| items | array | R | |
| id | int | R | 试题ID |
| shortName | string | R | 试题简称 |
| analysis | string | R | 解析html |
| answer | string | R | 答案html |
| ariseTime | datetime | R | 出题年份 |
| chapter | string | R | 章节 |
| checkPoints | string | R | 考点 |
| convertFailMessage | string | R | 转换失败信息 |
| difficulty | string | R | 难度 |
| discipline | string | R | 学科名称 |
| disciplineId | string | R | 学科ID |
| disciplineQuestionType | string | R | 学科细分题型 |
| disciplineQuestionTypeId | int | R | 学科细分题型Id |
| html | string | R | 试题html |
| questionCategory | int | R | 题型类别 代码定义请见“附录A 试题类别说明” |
| questionConvertState | int | R | 试题转换状态 代码定义请见“附录C 试题转换状态说明” |
| questionType | string | R | 题型名称 |
| questionTypeId | int | R | 题型Id |
| knowledgePoints | array | R | |
| id | int | R | 知识点名称ID |
| name | string | R | 知识点名称 |
示例:
{
"success":true,
"error":null,
"result":{
"totalCount":1,
"items":[{
"id":382,
"shortName":"一幅完整的机械零件制图需包括的要素有( )。",
"analysis":"<html><head><style></style></head><body></body></html>",
"answer":"A,B,C,D,E",
"ariseTime":null,
"chapter":"章节2",
"checkPoints":null,
"convertFailMessage":null,
"difficulty":"较易",
"discipline":"数学",
"disciplineId":10,
"disciplineQuestionType":"多选12",
"disciplineQuestionTypeId":21,
"html":"<html><head><style></style></head><body></body></html>",
"questionCategory":0,
"questionConvertState":0,
"questionType":"选择题",
"questionTypeId":1,
"knowledgePoints":[{
“id”:110,
"name":"三角函数的相关概念"
}]
}]
}
}
| 响应码 | 说明 |
|---|---|
| 0 | 客观题 |
| 1 | 判断题 |
| 2 | 非客观题 |
| 响应码 | 说明 |
|---|---|
| 1 | 容易 |
| 2 | 较易 |
| 3 | 中等 |
| 4 | 较难 |
| 5 | 困难 |
| 响应码 | 说明 |
|---|---|
| 0 | 正常 |
| 1 | 转换中 |
| 2 | 转换失败 |
| 3 | 解析替换失败 |