登录接口
http://localhost:9000/login 请求:post json 参数:{ “code”:“zhangsan”, “password”:“qwerty” }
返回的同时,服务器会把token设置到header的Authorization里,其他请求必须带这个token,不然会被拦截未登录: { “data”: { “code”: “zhangsan”, “name”: “张三”, “address”: “湖北省”, “phone”: “13423452345”, “mobileNumber”: “12312345432”, “educationalBackground”: “本科”, “title”: “教授”, “note”: null }, “code”: 200 }
course 课程
分页查询课程
http://localhost:9000/course/list 请求:post json 参数:{ “pageNo”:1, “pageSize”:10 } 返回: { “data”: { “total”: 11, “records”: [ { “id”: 1, “name”: “数学”, “teacherCode”: “zhangsan”, “note”: null }, { “id”: 2, “name”: “语文”, “teacherCode”: “lisi”, “note”: null }, { “id”: 3, “name”: “语文2”, “teacherCode”: “lisi2”, “note”: null }, { “id”: 4, “name”: “语文3”, “teacherCode”: “lisi3”, “note”: null }, { “id”: 5, “name”: “语文4”, “teacherCode”: “lisi4”, “note”: null }, { “id”: 6, “name”: “语文5”, “teacherCode”: “lisi5”, “note”: null }, { “id”: 7, “name”: “语文6”, “teacherCode”: “lisi6”, “note”: null }, { “id”: 8, “name”: “语文7”, “teacherCode”: “lisi7”, “note”: null }, { “id”: 9, “name”: “语文8”, “teacherCode”: “lisi8”, “note”: null }, { “id”: 10, “name”: “语文9”, “teacherCode”: “lisi9”, “note”: null } ] }, “code”: 200 }
课程保存(新增或更新)
http://localhost:9000/course/save 请求:post json 参数:{ “id”:null,//id为null是新增,不为null是更新 “name”:“英语”, “teacherCode”:“zhangsan2”, “note”:“xxxxx” } 返回: { “data”: null, “code”: 200 }
查询课程
http://localhost:9000/course/info?id=12 请求:get 返回: { “data”: { “id”: 12, “name”: “英语”, “teacherCode”: “zhangsan3”, “note”: “xxxxx” }, “code”: 200 }
删除课程
http://localhost:9000/course/delete?id=12 请求:post 返回: { “data”: null, “code”: 200 }
试题
分页查询试题
http://localhost:9000/question/list 请求:post json 参数: { “id“:3, “chapter”:“第一节”, “answer”:“因为”, “courseId”:1, “content”:“天空”, “minScore”:“4”, “maxScore”:“6”, “type”:“select”, “pageNo”:1, “pageSize”:10 } 返回: { “data”: { “total”: 1, “records”: [ { “id”: 3, “courseId”: 1, “courseName”: “数学”, “chapter”: “第一节”, “content”: “为什么天空这么蓝3”, “answer”: “因为天空很蓝”, “score”: 5, “type”: “select”, “difficulty”: 0.34, “createDate”: null, “note”: null } ] }, “code”: 200 }
保存试题
http://localhost:9000/question/save 请求:post json 参数: { “id”:null,//id不为null是更新,为null是新增 “chapter”:“第一节”, “answer”:“因为”, “courseId”:1, “content”:“天空”, “score”:4, “type”:“select”, “difficulty”:0.23 } 返回: { “data”: null, “code”: 200 }
查询试题
http://localhost:9000/question/info?id=12 请求:get 返回: { “data”: { “id”: 12, “courseId”: 1, “courseName”: “数学”, “chapter”: “第一节”, “content”: “天空”, “answer”: “因为”, “score”: 4, “type”: “select”, “difficulty”: 0.23, “createDate”: “2022-04-16T14:30:42.000+00:00”, “note”: null }, “code”: 200 }
删除试题
http://localhost:9000/question/delete?id=12 请求:post 返回: { “data”: null, “code”: 200 }
考试/试卷
获取所有试卷
http://localhost:9000/exam/list 请求:get 返回: { “data”: [ { “id”: 1, “name”: “期末考试”, “courseId”: 1, “courseName”: “数学”, “type”: “final”, “teachers”: “zhangsan”, “totalScore”: 100, “createDate”: null, “note”: “xxx” } ], “code”: 200 }
保存试卷
http://localhost:9000/exam/save 请求:post json 参数: { “id”: null,//id为null是新增,不为null是修改 “name”: “期末考试8”, “courseId”: 1, “type”: “final”, “teachers”: “zhangsan”, “totalScore”: 100, “note”: “wwww” } 返回: { “data”: null, “code”: 200 }
将试题加入到试卷
http://localhost:9000/exam/question/add 请求:post json 参数: { “examId”: 1, “questionId”: “1”, “note”: “wwww” } 返回: { “data”: null, “code”: 200 }
|