Request {
"page": 1
}
Response {
"total_pages": 20,
"current_page": 1,
"courses": [
//上次更新:已经弃置,并不再可用
{
"course_id" : 1,
"name" : "数据结构",
"teacher" : "张三",
"start_time" : 2003-05-17,
"end_time" : 2003-08-17,
"description" : "本课程针对大二学生开设,主要介绍...",
},{
"course_id" : 2,
"name" : "Java程序设计",
"teacher" : "李四",
"start_time" : 2003-05-17,
"end_time" : 2003-08-17,
"description" : "本课程针对大一学生开设,主要介绍...",
}]
}
Request {
"page": 1
}
Response {
"total_pages": 10,
"current_page": 1,
"courses":[
//上次更新:已经弃置,并不再可用
{
"course_id" : 1,
"name" : "数据结构",
"teacher" : "张三",
"start_time" : 2003-05-17 12:00,
"end_time" : 2003-08-17 12:00,
"description" : "本课程针对大二学生开设,主要介绍...",
},{
"course_id" : 2,
"name" : "算法导论",
"teacher" : "张三",
"start_time" : 2003-05-17 12:00,
"end_time" : 2003-08-17 12:00,
"description" : "本课程针对大二学生开设,主要介绍...",
}]
}
Request {
"page": 1,
"course_id" : 1,
}
Response{
"total_pages": 10,
"current_page": 1,
"lectures":[
{
"lecture_id" : 1,
"name" : "lecture1"
},{
"lecture_id" : 2,
"name" : "lecture2"
}]
}
Request {
"page": 1,
"course_id" : 1,
}
Response{
"total_pages": 10,
"current_page": 1,
"labs":[
{
"lab_id" : 1,
"name" : "二叉搜索树"
},{
"lab_id" : 2,
"name" : "B树和B+树"
}]
}
Request {
"page": 1,
"course_id" : 1,
}
Response{
"total_pages": 1,
"current_page": 1,
"exams":[
{
"exam_id" : 1,
"name" : "期中考试",
"start_time" : 2003-08-15 12:00,
"end_time": 2003-08-15 15:00,
"description": "请遵守考试纪律"
},{
"exam_id" : 2,
"name" : "期末考试"
"start_time" : 2003-09-15 12:00,
"end_time": 2003-09-15 15:00,
"description": "请遵守考试纪律"
}]
}
Request {
"page": 1,
"course_id" : 1,
}
Response{
"total_pages": 10,
"current_page": 1,
"students":[
{
"student_id" : 1,
"student_number" : "1612000",
"student_name" : "王五"
},{
"student_id" : 2,
"student_number" : "1612000",
"student_name" : "赵六"
}]
}
Request {
"student_id": 1
}
Response{
//在删除成功时返回200,否则返回具体错误code并且更新error_msg
"error_msg" : ""
}
//新建课时
/teacher/lecture/create-lecture POST
Request {
"course_id" : 1,
"name" : "二叉树的搜索",
"description" : "主要介绍二叉树的递归和非递归搜索方式。"
}
Response{
//在新建成功时返回200,否则返回具体错误code并且更新error_msg
"error_msg" : ""
//如果发生错误则不存在以下内容,因此前端应该先执行检查
//事实上,前端在获取到任何后端数据时都应先检查是否为200
"lecture_id" : 10
}
Request {
"lecture_id" : 1,
"name" : "二叉树的先序遍历搜索",
"description" : "主要介绍二叉树的先序遍历搜索方式。"
}
Response{
//在编辑成功时返回200,否则返回具体错误code并且更新error_msg
"error_msg" : ""
}
//获取某个课时的信息
/teacher/lecture/get-lecture GET
Request {
"lecture_id" : 1,
}
Response{
"name" : "二叉树的先序遍历搜索",
"description" : "主要介绍二叉树的先序遍历搜索方式。"
}
Request {
"lecture_id" : 1,
}
Response{
"problems":[
{
"problem_id" : 1,
"problem_name" : "猴子吃桃问题",
},{
"problem_id" : 2,
"problem_name" : "A + B问题",
}]
}
Request {
"lecture_id" : 1,
"problem_ids":[
{
"problem_id" : 1
}, {
"problem_id" : 3
}]
}
Response{
//在编辑成功时返回200,否则返回具体错误code并且更新error_msg
"error_msg" : ""
}
Request {
"lecture_id" : 1,
"filename" : "二叉树先序遍历课件.pptx",
"file": [文件信息]########[文件信息]
}
Response{
//在添加成功时返回200,否则返回具体错误code并且更新error_msg
"error_msg" : ""
}
Request {
"lecture_id" : 1,
"filename" : "二叉树先序遍历课件.pptx"
}
Response{
//在删除成功时返回200,否则返回具体错误code并且更新error_msg
"error_msg" : ""
}
//获取某个课时的全部题目的提交统计
Request {
"page": 1,
"lecture_id" : 1
}
Response {
"total_pages": 10,
"current_page": 1,
"submissions":[
//查重率:已经弃置,并不再可用
{
"problem_id" : 1,
"problem_name" : "猴子吃桃问题",
//可根据业务逻辑调整
"submissions_count" : 100,
"TLEsubmissions_count" : 50,
"WAsubmissions_count": 30,
"ACsubmissions_count": 20
},{
"problem_id" : 1,
"problem_name" : "A + B问题",
//可根据业务逻辑调整
"submissions_count" : 100,
"TLEsubmissions_count" : 0,
"WAsubmissions_count": 10,
"ACsubmissions_count": 90
}]
}
Request {
"page": 1,
"problem_id" : 1
}
Response{
"total_pages": 10,
"current_page": 1,
"submissions":[
//查重率:已经弃置,并不再可用
{
"submission_id" : 1,
"problem_id" : 1,
"student_id" : 1,
"student_number" : "1612000",
"created_time" : 2003-08-17 15:00,
"succeed_cases_count" : 3,
"all_cases_count" : 5,
"language_id": 1,
},{
"submission_id" : 2,
"problem_id" : 1,
"student_id" : 3,
"student_number" : "1612001",
"created_time" : 2003-08-17 16:20,
"succeed_cases_count" : 5,
"all_cases_count" : 5
"language_id": 2,
}]
}
Request {
"course_id" : 1,
"name" : "二叉树的搜索",
"description" : "实验练习二叉树的搜索。",
"start_time" : 2007-06-15,
"end_time" : 2007-06-26,
"report_required" : false
}
Response{
//在新建成功时返回200,否则返回具体错误code并且更新error_msg
"error_msg" : ""
//如果发生错误则不存在以下内容,因此前端应该先执行检查
//事实上,前端在获取到任何后端数据时都应先检查是否为200
"lab_id" : 10
}
Request {
"lab_id" : 1,
"name" : "二叉树的先序遍历搜索",
"description" : "实验练习二叉树的先序遍历搜索。",
"start_time" : 2007-06-25,
"end_time" : 2007-06-30,
"report_required" : true
}
Response{
//在编辑成功时返回200,否则返回具体错误code并且更新error_msg
"error_msg" : ""
}
Request {
"lab_id" : 1,
}
Response{
"name" : "二叉树的先序遍历搜索",
"description" : "主要介绍二叉树的先序遍历搜索方式。"
"start_time" : 2007-06-25,
"end_time" : 2007-06-30,
"report_required" : true
}
Request {
"lab_id" : 1,
}
Response{
"problems":[
{
"problem_id" : 1,
"problem_name" : "猴子吃桃问题",
},{
"problem_id" : 2,
"problem_name" : "A + B问题",
}]
}
Request {
"lab_id" : 1,
"problem_ids":[
{
"problem_id" : 1
}, {
"problem_id" : 3
}]
}
Response{
//在编辑成功时返回200,否则返回具体错误code并且更新error_msg
"error_msg" : ""
}
Request {
"lab_id" : 1,
"filename" : "二叉树先序遍历实验要求.pptx",
"file": [文件信息]########[文件信息]
}
Response{
//在添加成功时返回200,否则返回具体错误code并且更新error_msg
"error_msg" : ""
}
Request {
"lab_id" : 1,
"filename" : "二叉树先序遍历实验要求.pptx"
}
Response{
//在删除成功时返回200,否则返回具体错误code并且更新error_msg
"error_msg" : ""
}
Request {
"page": 1,
"lab_id" : 1
}
Response{
"total_pages": 10,
"current_page": 1,
"submissions" : [
{
"submission_id" : 101,
"student_id" : 1,
"attachment_grade" : 90,
"problem_grade" : 100
}, {
"submission_id" : 102,
"student_id" : 2,
"attachment_grade" : 60,
"problem_grade" : 60
}]
}
Request {
"submission_id" : 101
}
Response{
"student_id": 1,
"student_number" : 1612000,
"student_name": "赵六",
"problem_submission_id": 1001,
"attachments" : [
{
"attachment_id" : 10,
"attachment_name" : "实验报告1612000.pdf",
}, {
"attachment_id" : 20,
"attachment_name" : "实验报告2.pdf",
}]
}
Request {
"attachment_id" : 10
}
Response{
"file": [文件信息]########[文件信息]
}
Request {
"submission_id" : 1001
}
Response{
"id_problem" : 1,
"id_student" : 1,
"code" : "import java.util.*; \n public class Main{ \n public static void main(String []args...",
"created_at" 2007-08-16,
"runtime" : 993ms,
"language_id" : 1,
"memory" : 1036,
"IP" : "10.0.0.91",
"succeed_cases_count" : 5,
"all_cases_count" : 5
}
Request {
"page": 1,
}
Response{
"total_pages": 10,
"current_page": 1,
"problems": [
{
"problem_id" : 1,
"problem_name" : "猴子吃桃问题",
"created_teacher_id" : 1,
"created_time" : 2007-06-13 14:00,
"submit_count" : 80,
"accepted_count" : 10
}, {
"problem_id" : 2,
"problem_name" : "A + B问题",
"created_teacher_id" : 1,
"created_time" : 2007-06-13 13:00,
"submit_count" : 100,
"accepted_count" : 90
}]
}
Request {
"problem_id": 1,
}
Response{
"problem_name" : "猴子吃桃问题",
"description": "有m个猴子,n个桃子,请设计一种算法,使得..."
"created_teacher_id" : 1,
"created_time" : 2007-06-13 14:00,
"modified_time" : 2007-06-13 15:00,
"runtime_limit" : 1024,
"memory_limit" : 1024,
"tags":[{
"tag_id" : 1,
"tag_name" : "贪心"
}, {
"tag_id" : 2,
"tag_name" : "动态规划"
}]
"cases":[{
"case_id" : 1001,
"input" : "2, 3, 4",
"output" : "5"
"tags":[{
"tag_id" : 1,
"tag_name" : "数组越界检查"
}, {
"tag_id" : 2,
"tag_name" : "除零错检查"
}]
}, {
"case_id" : 1002,
"input" : "2, 3, 0",
"output" : "0"
"tags":[{
"tag_id" : 2,
"tag_name" : "除零错检查"
}, {
"tag_id" : 3,
"tag_name" : "栈溢出检查"
}]
]
}
Request {
"problem_name" : "猴子吃桃问题",
"description": "有m个猴子,n个桃子,请设计一种算法,使得..."
"created_teacher_id" : 1,
"runtime_limit" : 1024,
"memory_limit" : 1024,
"tags":[{
"tag_id" : 1,
"tag_name" : "贪心"
}, {
"tag_id" : 2,
"tag_name" : "动态规划"
}]
"cases":[{
"case_id" : 1001,
"input" : "2, 3, 4",
"output" : "5"
"tags":[{
"tag_id" : 1,
"tag_name" : "数组越界检查"
}, {
"tag_id" : 2,
"tag_name" : "除零错检查"
}]
}, {
"case_id" : 1002,
"input" : "2, 3, 0",
"output" : "0"
"tags":[{
"tag_id" : 2,
"tag_name" : "除零错检查"
}, {
"tag_id" : 3,
"tag_name" : "栈溢出检查"
}]
]
}
Response{
//在新建成功时返回200,否则返回具体错误code并且更新error_msg
"error_msg" : ""
//如果发生错误则不存在以下内容,因此前端应该先执行检查
//事实上,前端在获取到任何后端数据时都应先检查是否为200
"problem_id" : 3
}
Request {
"problem_id" : 3,
"problem_name" : "猴子吃桃问题",
"description": "有m个猴子,n个桃子,请设计一种算法,使得..."
"created_teacher_id" : 1,
"runtime_limit" : 1024,
"memory_limit" : 1024,
"tags":[{
"tag_id" : 1,
"tag_name" : "贪心"
}, {
"tag_id" : 2,
"tag_name" : "动态规划"
}]
"cases":[{
"case_id" : 1001,
"input" : "2, 3, 4",
"output" : "5"
"tags":[{
"tag_id" : 1,
"tag_name" : "数组越界检查"
}, {
"tag_id" : 2,
"tag_name" : "除零错检查"
}]
}, {
"case_id" : 1002,
"input" : "2, 3, 0",
"output" : "0"
"tags":[{
"tag_id" : 2,
"tag_name" : "除零错检查"
}, {
"tag_id" : 3,
"tag_name" : "栈溢出检查"
}]
]
}
Response{
//在编辑成功时返回200,否则返回具体错误code并且更新error_msg
"error_msg" : ""
}
Request {
"page": 1,
//为空表示最早时间
"begin_time":2007-06-17 15:00,
//为空表示最晚时间
"end_time":2007-06-17 15:00
}
Response{
"total_pages": 10,
"current_page": 1,
"submissions": [
{
"submission_id" : 1,
"problem_id" : 1,
"student_id" : 1,
"student_number" : "1612000",
"created_time" : 2003-08-17 15:00,
"succeed_cases_count" : 3,
"all_cases_count" : 5,
"language_id": 1
}, {
"submission_id" : 2,
"problem_id" : 1,
"student_id" : 1,
"student_number" : "1612000",
"created_time" : 2003-08-17 16:00,
"succeed_cases_count" : 5,
"all_cases_count" : 5,
"language_id": 1
}]
}
Request {
}
Response {
"teacher_id" : 1,
"name" : "张三",
"email" : "zhangsan@gmail.com",
"gender_id" : 0,
}
//修改自己的个人信息
/teacher/information/edit-information POST
Request {
"teacher_id" : 1,
"password" : "*******",
"name" : "张三",
"email" : "zhangsan@gmail.com",
"gender_id" : 0,
}
Response {
//在编辑成功时返回200,否则返回具体错误code并且更新error_msg
"error_msg" : ""
}
原文:https://www.cnblogs.com/cs-sunday/p/10869122.html