学生端API——徐若曦

学生中心首页

1. 用户登录(张慧斌)

/api/student/log_in POST

Request

{

  "name": 1612941,// 此处的属性名参考数据库,代表“用户名”。

  "password_hash": awgyu223

}

 

Response

{

  "state_code":0, // 0-成功,-1-用户名不存在,1-密码不正确

  "id": 139179

}

2. 用户查看个人信息(张慧斌)(哈斯普拉提)

/api/student/personal_information GET

Request

{

  "id_user": 1612841

}

 

Response

{

  "name": "xrx",

  "student_number": 1612941,

  "rank_score": 238,

  "gender": 0, // 新增性别

  "email": 1612941@mail.nankai.edu.cn

}

 

课程界面
1. 用户查看课程列表(张慧斌)(哈斯普拉提)
/api/student/course GET

Request

{

  "id_user": 1612941

}

 

Response

{

  courses: [{

    "name": "数据结构",

    "start_time": ”2019-4-1 14:00:00”,

    "end_time": ”2019-4-2 14:00:00”,

    "description":"数据结构课",

    "teacher": "刘明铭" // 新增老师姓名

  }]

}

2. 用户查看某个课程的实验课列表(费德立)

/api/student/lab_course_list GET

Request

{

  "id_course": 123

}

 

Response

{

  lab: [{

    "name":123,

    "start_time": ”2019-4-1 14:00:00”,

    "end_time": ”2019-4-2 14:00:00”,

  }]

}

3. 用户查看某个课程的主讲课列表(曹亮)

/api/student/lecture_course GET

Request

{

  "id_course": 123

}

 

Response

{

  lecture: [{

    "name":二叉树,

    "start_time": ”2019-4-1 14:00:00”,

    "end_time": ”2019-4-2 14:00:00”,

  }]

}

4. 用户查看实验课详情(费德立)

/api/student/lab_course_detail GET

Request

{

  "id_lab": 123

}

 

Response

{

  "name": "二叉树",

  "description": "实现搜索二叉树",

  "start_time": ”2019-4-1 14:00:00”,

  "end_time": ”2019-4-1 14:00:00”,

  "report_required":true,

  "problem_weight": 0.2,

  "attachment_weight": 0.8,

   [{

    "id_problem": 123,

    "name": "搜索二叉树",

    "score":100/100

   }] // 实验课问题

}

5. 用户提交实验报告(张慧斌,费德立)

/api/student/lab_attachment_hand_in POST

Request

{

  "id_user":123,

  "id_course": 1234 // 新增课程的信息

  "id_lab":123,

  "file"//本地路径地址

}

 

{

  state_code // 0-成功,-1-上传失败

}

6. 用户查看主讲课详情(曹亮)

/api/student/lecture_course_detail GET

Request

{

  "id_lecture": 123

}

 

Response

{

  "name": "数据结构",

  "description": "数据结构课程",

  "start_time": ”2019-4-1 14:00:00”,

  "end_time": ”2020-4-1 14:00:00”,

  [{

    "name": "PPT1",

    "path": "https://www.yuque.com/docs/share/e2db0e32-8463-4eac-b532-04bc6709eaa5",

    "size": 23MB

  }] // 课程资源

  [{

    "id_problem": 123,

    "name": "Traveller",

    "score":100/100

  }] // 主讲课问题

}

7. 用户下载资源(张慧斌,曹亮)

/api/student/download_resource GET

Request

{

  "id_course_resource": 123 // 课程资源id,在course_resourse表中查找

}

 

Response

{

  "name": "课件"

  "path": "https://www.yuque.com/docs/share/e2db0e32-8463-4eac-b532-04bc6709eaa5"

}

个人中心界面

1. 用户修改个人信息(哈斯普拉提)

/api/student/modify_personal_information POST

Request

{

  "id_user": 1612841,

  information: {

    "name": "xrx",

    "email": 1612941@mail.nankai.edu.cn,

    "password": 123456

  }

}

 

Response

{

  state_code: 0/-1

}

2. 用户查看课程消息(哈斯普拉提)(曹亮)

/api/student/course_message GET

Request

{

  "id_course": 123

}

 

Response

{

  "message": []

}

3. 用户查看提交记录(哈斯普拉提,费德立)

/api/student/problem_history_submission GET

Request

{

  "id_student": 1612941

}

 

Response

{

  problem: [{

    "created_at": 2019-4-1 14:00:00

    "runtime": 300ms,

    "memory": 648KB,

    "score": 20/100,

    "language": C++,

    "code":"#include<iostream>\r\nint main(){cout<<123;\r\nreturn 0;}"

  }]

}

考试界面

1. 用户查看考试详情(魏家奇)

/api/student/test_detail GET

Request

{

  "id": id // 考试id

}

 

Response

{

  “name”:“2019-2020年第2学期 算法导论考试”,

       “start_time”:”2019-4-1 14:00:00”

       “end_time”:”2019-4-1 15:00:00”

       “description”:”请同学们不要作弊,祝考试顺利”

       “created_at”:“2019-3-31 14:00:00”

       “modified_at”:”2019-4-1 9:00:00”

  exam_problem:[

              {

                     “id_problem”:1,

                     “name”:”滔滔摘苹果”

                     “type”:”A”,

                     “weight”:0.3,

                     “case_number”:10

    }

  ]

}

题目界面

1. 用户查看题目详情(魏家奇,张慧斌)

/api/student/problem_detail GET

Request

{

  "problem_id": id, // 题目id

}

 

Response

{

  “name”:“Traveler",

      “start_time”:”2019-4-1 14:00:00”,

      “end_time”:”2019-4-1 15:00:00”,

  “description”:”旅行者问题”, // 课程的具体描述

  "cases": [{

    "id": 1,

    "input": 10,

    "output": "No!",

    "weight": 0.2 // 测试样例占比

  }]

  "runtime_limit": 1000ms,

  "memory_limit": 64000KB

}

2. 用户提交题目(魏家奇,张慧斌)

/api/student/problem_hand_in POST

Request

{

  "user_id": 1,

  "problem_id": 2, // 从数据库来看,所有的提交记录都存在一张表problem_submission中

  "code": "#include<iostream>\r\nint main(){cout<<123;\r\nreturn 0;}"

}

 

{

  "runtime": 300ms,

  "memory": 648KB

}

3. 用户查看某一道题目的提交记录(魏家奇,张慧斌,费德立)

/api/student/problem_hand_in GET

Request

{

  "user_id": 1,

  "problem_id": 2

}

{

  "created_at": 2019-4-1 14:00:00

  "runtime": 300ms,

  "memory": 648KB,

  "score": 20/100,

  "language": C++,

  "code":"#include<iostream>\r\nint main(){cout<<123;\r\nreturn 0;}"

}

posted @ 2019-05-15 14:13  cs_Sunday  阅读(294)  评论(0编辑  收藏  举报