|
|
@@ -0,0 +1,544 @@
|
|
|
+### User
|
|
|
+
|
|
|
+1. 用户注册 POST /user/register
|
|
|
+
|
|
|
+```
|
|
|
+ /**
|
|
|
+ * @api {POST} /user/register register
|
|
|
+ * @apiVersion 1.0.0
|
|
|
+ * @apiGroup UserController
|
|
|
+ * @apiName register
|
|
|
+ * body参数 (JSON)
|
|
|
+ * @apiParam (请求体) {String} uname
|
|
|
+ * @apiParam (请求体) {String} phone
|
|
|
+ * @apiParam (请求体) {String} password
|
|
|
+ * @apiParam (请求体) {String} picture
|
|
|
+ * @apiParam (请求体) {String} userRole STUDENT,TEACHER,ADMIN
|
|
|
+ * @apiParamExample 请求体示例
|
|
|
+ * {
|
|
|
+ "uname":"小张同学",
|
|
|
+ "phone":"102123456789",
|
|
|
+ "password":"123456",
|
|
|
+ "picture":"1.png",
|
|
|
+ "userRole":"STUDENT"
|
|
|
+ }
|
|
|
+ * @apiSuccess (响应结果) {Number} code
|
|
|
+ * @apiSuccess (响应结果) {String} msg
|
|
|
+ * @apiSuccess (响应结果) {Object} data
|
|
|
+ * @apiSuccess (响应结果) {Number} data.id
|
|
|
+ * @apiSuccess (响应结果) {String} data.uname
|
|
|
+ * @apiSuccess (响应结果) {String} data.phone
|
|
|
+ * @apiSuccess (响应结果) {String} data.password
|
|
|
+ * @apiSuccess (响应结果) {String} data.picture
|
|
|
+ * @apiSuccess (响应结果) {Number} data.balance
|
|
|
+ * @apiSuccess (响应结果) {String} data.userRole STUDENT,TEACHER,ADMIN
|
|
|
+ * @apiSuccess (响应结果) {String} data.createTime yyyy-MM-dd HH:mm:ss
|
|
|
+ * @apiSuccessExample 响应结果示例
|
|
|
+ {
|
|
|
+ "code": 1,
|
|
|
+ "msg": "账号注册成功!",
|
|
|
+ "data": {
|
|
|
+ "id": 3,
|
|
|
+ "uname": "小张同学",
|
|
|
+ "phone": "102123456789",
|
|
|
+ "password": null,
|
|
|
+ "picture": "1.png",
|
|
|
+ "balance": 0,
|
|
|
+ "userRole": "STUDENT",
|
|
|
+ "createTime": "2021-03-13T01:45:48.246+00:00"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ */
|
|
|
+```
|
|
|
+
|
|
|
+2. 用户登录 POST /user/login
|
|
|
+
|
|
|
+```
|
|
|
+ /**
|
|
|
+ * @api {POST} /user/login login
|
|
|
+ * @apiVersion 1.0.0
|
|
|
+ * @apiGroup UserController
|
|
|
+ * @apiName login
|
|
|
+ * body参数 (JSON)
|
|
|
+ * @apiParam (请求体) {String} phone
|
|
|
+ * @apiParam (请求体) {String} password
|
|
|
+ * @apiParamExample 请求体示例
|
|
|
+ * {"phone":"10212345678", "password":"123456"}
|
|
|
+ * @apiSuccess (响应结果) {Number} code
|
|
|
+ * @apiSuccess (响应结果) {String} msg
|
|
|
+ * @apiSuccess (响应结果) {Object} data
|
|
|
+ * @apiSuccess (响应结果) {Number} data.id
|
|
|
+ * @apiSuccess (响应结果) {String} data.uname
|
|
|
+ * @apiSuccess (响应结果) {String} data.phone
|
|
|
+ * @apiSuccess (响应结果) {String} data.password
|
|
|
+ * @apiSuccess (响应结果) {String} data.picture
|
|
|
+ * @apiSuccess (响应结果) {Number} data.balance
|
|
|
+ * @apiSuccess (响应结果) {String} data.userRole STUDENT,TEACHER,ADMIN
|
|
|
+ * @apiSuccess (响应结果) {Number} data.createTime yyyy-MM-dd HH:mm:ss
|
|
|
+ * @apiSuccessExample 响应结果示例
|
|
|
+ {
|
|
|
+ "code": 1,
|
|
|
+ "msg": "账号登陆成功!",
|
|
|
+ "data": {
|
|
|
+ "id": 2,
|
|
|
+ "uname": "小明",
|
|
|
+ "phone": "10212345678",
|
|
|
+ "password": null,
|
|
|
+ "picture": null,
|
|
|
+ "balance": 0,
|
|
|
+ "userRole": "STUDENT",
|
|
|
+ "createTime": "2020-12-18T02:00:00.000+00:00"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ */
|
|
|
+```
|
|
|
+
|
|
|
+3. 用户充值 POST /user/recharge
|
|
|
+
|
|
|
+```
|
|
|
+ /**
|
|
|
+ * @api {POST} /user/recharge recharge
|
|
|
+ * @apiVersion 1.0.0
|
|
|
+ * @apiGroup UserController
|
|
|
+ * @apiName recharge
|
|
|
+ * body参数 (JSON)
|
|
|
+ * @apiParam (请求体) {Number} userId
|
|
|
+ * @apiParam (请求体) {Number} value
|
|
|
+ * @apiParam (请求体) {String} createTime
|
|
|
+ * @apiParamExample 请求体示例
|
|
|
+ * {"userId":1,"value":10}
|
|
|
+ * @apiSuccess (响应结果) {Number} code
|
|
|
+ * @apiSuccess (响应结果) {String} msg
|
|
|
+ * @apiSuccess (响应结果) {Object} data
|
|
|
+ * @apiSuccess (响应结果) {Number} data.id
|
|
|
+ * @apiSuccess (响应结果) {String} data.uname
|
|
|
+ * @apiSuccess (响应结果) {String} data.phone
|
|
|
+ * @apiSuccess (响应结果) {String} data.password
|
|
|
+ * @apiSuccess (响应结果) {String} data.picture
|
|
|
+ * @apiSuccess (响应结果) {Number} data.balance
|
|
|
+ * @apiSuccess (响应结果) {String} data.userRole STUDENT,TEACHER,ADMIN
|
|
|
+ * @apiSuccess (响应结果) {Number} data.createTime
|
|
|
+ * @apiSuccessExample 响应结果示例
|
|
|
+ {
|
|
|
+ "code": 1,
|
|
|
+ "msg": "充值成功",
|
|
|
+ "data": {
|
|
|
+ "id": 1,
|
|
|
+ "uname": "刘钦",
|
|
|
+ "phone": "10112345678",
|
|
|
+ "password": null,
|
|
|
+ "picture": null,
|
|
|
+ "balance": 50,
|
|
|
+ "userRole": "TEACHER",
|
|
|
+ "createTime": "2020-12-18T02:00:00.000+00:00"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ */
|
|
|
+```
|
|
|
+
|
|
|
+4. 获取用户 GET /user/{uid}
|
|
|
+
|
|
|
+```
|
|
|
+ /**
|
|
|
+ * @api {GET} /user/{uid} getUser
|
|
|
+ * @apiVersion 1.0.0
|
|
|
+ * @apiGroup UserController
|
|
|
+ * @apiName getUser
|
|
|
+ * @apiParam (请求参数) {Number} uid
|
|
|
+ * @apiParamExample 请求参数示例
|
|
|
+ * GET /user/2
|
|
|
+ * @apiSuccess (响应结果) {Number} id
|
|
|
+ * @apiSuccess (响应结果) {String} uname
|
|
|
+ * @apiSuccess (响应结果) {String} phone
|
|
|
+ * @apiSuccess (响应结果) {String} password
|
|
|
+ * @apiSuccess (响应结果) {String} picture
|
|
|
+ * @apiSuccess (响应结果) {Number} balance
|
|
|
+ * @apiSuccess (响应结果) {String} userRole STUDENT,TEACHER,ADMIN
|
|
|
+ * @apiSuccess (响应结果) {Number} createTime
|
|
|
+ * @apiSuccessExample 响应结果示例
|
|
|
+ {
|
|
|
+ "id": 2,
|
|
|
+ "uname": "小明",
|
|
|
+ "phone": "10212345678",
|
|
|
+ "password": null,
|
|
|
+ "picture": null,
|
|
|
+ "balance": 0,
|
|
|
+ "userRole": "STUDENT",
|
|
|
+ "createTime": "2020-12-18T02:00:00.000+00:00"
|
|
|
+ }
|
|
|
+ */
|
|
|
+```
|
|
|
+
|
|
|
+### Course
|
|
|
+
|
|
|
+1. 获取一门课程 GET /course/{courseId}?uid={uid}
|
|
|
+
|
|
|
+```
|
|
|
+ /**
|
|
|
+ * @api {GET} /course/{courseId} getCoursesByKey
|
|
|
+ * @apiVersion 1.0.0
|
|
|
+ * @apiGroup CourseController
|
|
|
+ * @apiName getCoursesByKey
|
|
|
+ * @apiParam (请求参数) {Number} uid
|
|
|
+ * @apiParam (请求参数) {Number} courseId
|
|
|
+ * @apiParamExample 请求参数示例
|
|
|
+ * GET /course/1?uid=1
|
|
|
+ * @apiSuccess (响应结果) {Number} id
|
|
|
+ * @apiSuccess (响应结果) {String} name
|
|
|
+ * @apiSuccess (响应结果) {String} type
|
|
|
+ * @apiSuccess (响应结果) {String} intro
|
|
|
+ * @apiSuccess (响应结果) {String} picture
|
|
|
+ * @apiSuccess (响应结果) {String} school
|
|
|
+ * @apiSuccess (响应结果) {Number} createTime
|
|
|
+ * @apiSuccess (响应结果) {Number} cost
|
|
|
+ * @apiSuccess (响应结果) {Number} teacherId
|
|
|
+ * @apiSuccess (响应结果) {String} teacherName
|
|
|
+ * @apiSuccess (响应结果) {Boolean} bought
|
|
|
+ * @apiSuccess (响应结果) {Boolean} manageable
|
|
|
+ * @apiSuccessExample 响应结果示例
|
|
|
+ {
|
|
|
+ "id": 1,
|
|
|
+ "name": "软件工程与计算 I",
|
|
|
+ "type": "中级",
|
|
|
+ "intro": "通过Scheme、Python和Java语言,让你分别体会函数式编程范式、结构化编程范式和面向对象编程范式",
|
|
|
+ "picture": "course1.png",
|
|
|
+ "school": "南京大学",
|
|
|
+ "createTime": "2020-12-20T02:00:00.000+00:00",
|
|
|
+ "cost": 1,
|
|
|
+ "teacherId": 1,
|
|
|
+ "teacherName": "刘钦",
|
|
|
+ "bought": false,
|
|
|
+ "manageable": true
|
|
|
+ }
|
|
|
+ */
|
|
|
+```
|
|
|
+
|
|
|
+2. 根据关键字 分页获取课程列表 GET /course/all/{page}?uid={uid}&key={key}
|
|
|
+
|
|
|
+```
|
|
|
+ /**
|
|
|
+ * @api {GET} /course/all/{page} getCoursesByKey
|
|
|
+ * @apiVersion 1.0.0
|
|
|
+ * @apiGroup CourseController
|
|
|
+ * @apiName getCoursesByKey
|
|
|
+ * @apiParam (可选请求参数) {Number} uid
|
|
|
+ * @apiParam (可选请求参数) {String} key
|
|
|
+ * @apiParam (必选请求参数) {Number} page
|
|
|
+ * @apiParamExample 请求参数示例
|
|
|
+ * GET /course/all/1?uid=2&key=软件
|
|
|
+ * @apiSuccess (响应结果) {Number} pageNum
|
|
|
+ * @apiSuccess (响应结果) {Number} pageSize
|
|
|
+ * @apiSuccess (响应结果) {Number} size
|
|
|
+ * @apiSuccess (响应结果) {Number} startRow
|
|
|
+ * @apiSuccess (响应结果) {Number} endRow
|
|
|
+ * @apiSuccess (响应结果) {Number} total
|
|
|
+ * @apiSuccess (响应结果) {Number} pages
|
|
|
+ * @apiSuccess (响应结果) {Array} list
|
|
|
+ * @apiSuccess (响应结果) {Number} list.id
|
|
|
+ * @apiSuccess (响应结果) {String} list.name
|
|
|
+ * @apiSuccess (响应结果) {String} list.type
|
|
|
+ * @apiSuccess (响应结果) {String} list.intro
|
|
|
+ * @apiSuccess (响应结果) {String} list.picture
|
|
|
+ * @apiSuccess (响应结果) {String} list.school
|
|
|
+ * @apiSuccess (响应结果) {Number} list.createTime
|
|
|
+ * @apiSuccess (响应结果) {Number} list.cost
|
|
|
+ * @apiSuccess (响应结果) {Number} list.teacherId
|
|
|
+ * @apiSuccess (响应结果) {String} list.teacherName
|
|
|
+ * @apiSuccess (响应结果) {Boolean} list.bought
|
|
|
+ * @apiSuccess (响应结果) {Boolean} list.manageable
|
|
|
+ * @apiSuccess (响应结果) {Number} prePage
|
|
|
+ * @apiSuccess (响应结果) {Number} nextPage
|
|
|
+ * @apiSuccess (响应结果) {Boolean} isFirstPage
|
|
|
+ * @apiSuccess (响应结果) {Boolean} isLastPage
|
|
|
+ * @apiSuccess (响应结果) {Boolean} hasPreviousPage
|
|
|
+ * @apiSuccess (响应结果) {Boolean} hasNextPage
|
|
|
+ * @apiSuccess (响应结果) {Number} navigatePages
|
|
|
+ * @apiSuccess (响应结果) {Array} navigatepageNums
|
|
|
+ * @apiSuccess (响应结果) {Number} navigateFirstPage
|
|
|
+ * @apiSuccess (响应结果) {Number} navigateLastPage
|
|
|
+ * @apiSuccessExample 响应结果示例
|
|
|
+ {
|
|
|
+ "pageNum": 1,
|
|
|
+ "pageSize": 3,
|
|
|
+ "size": 3,
|
|
|
+ "startRow": 1,
|
|
|
+ "endRow": 3,
|
|
|
+ "total": 4,
|
|
|
+ "pages": 2,
|
|
|
+ "list": [
|
|
|
+ {
|
|
|
+ "id": 1,
|
|
|
+ "name": "软件工程与计算 I",
|
|
|
+ "type": "中级",
|
|
|
+ "intro": "通过Scheme、Python和Java语言,让你分别体会函数式编程范式、结构化编程范式和面向对象编程范式",
|
|
|
+ "picture": "course1.png",
|
|
|
+ "school": "南京大学",
|
|
|
+ "createTime": "2020-12-20T02:00:00.000+00:00",
|
|
|
+ "cost": 1,
|
|
|
+ "teacherId": 1,
|
|
|
+ "teacherName": "刘钦",
|
|
|
+ "bought": false,
|
|
|
+ "manageable": false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id": 2,
|
|
|
+ "name": "软件工程与计算 II",
|
|
|
+ "type": "中级",
|
|
|
+ "intro": "基于DevOps培养团队开发中小规模软件系统的能力",
|
|
|
+ "picture": "course2.png",
|
|
|
+ "school": "南京大学",
|
|
|
+ "createTime": "2020-12-20T02:00:00.000+00:00",
|
|
|
+ "cost": 1,
|
|
|
+ "teacherId": 1,
|
|
|
+ "teacherName": "刘钦",
|
|
|
+ "bought": false,
|
|
|
+ "manageable": false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id": 3,
|
|
|
+ "name": "程序猿与攻城狮",
|
|
|
+ "type": "初级",
|
|
|
+ "intro": "我们将由5位老师从不同的角度来说说他们对软件工程的理解。我们并非试图去覆盖所有软件工程的知识点,我们只是希望去让对软件工程有兴趣的你们了解到\"我要学什么\"\"我应如何学\"\"我今后能做什么\"这样一些基本的问题的部分答案。\r\n\r\n 刘钦老师会介绍软件工程的历史和软件工程建模;丁二玉老师会谈谈软件工程师和软件工程团队;冯桂焕老师会通过案例让大家体验人机交互的魅力;陈振宇老师会从概率统计讲到软件测试;刘嘉老师会娓娓道来他对最热门的移动互联网发展的本质的理解。",
|
|
|
+ "picture": "course3.png",
|
|
|
+ "school": "南京大学",
|
|
|
+ "createTime": "2020-12-20T02:00:00.000+00:00",
|
|
|
+ "cost": 1,
|
|
|
+ "teacherId": 1,
|
|
|
+ "teacherName": "刘钦",
|
|
|
+ "bought": false,
|
|
|
+ "manageable": false
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "prePage": 0,
|
|
|
+ "nextPage": 2,
|
|
|
+ "isFirstPage": true,
|
|
|
+ "isLastPage": false,
|
|
|
+ "hasPreviousPage": false,
|
|
|
+ "hasNextPage": true,
|
|
|
+ "navigatePages": 8,
|
|
|
+ "navigatepageNums": [
|
|
|
+ 1,
|
|
|
+ 2
|
|
|
+ ],
|
|
|
+ "navigateFirstPage": 1,
|
|
|
+ "navigateLastPage": 2,
|
|
|
+ "lastPage": 2,
|
|
|
+ "firstPage": 1
|
|
|
+ }
|
|
|
+ */
|
|
|
+```
|
|
|
+
|
|
|
+3. 根据课程分类 分页获取课程列表
|
|
|
+```
|
|
|
+ /**
|
|
|
+ * @api {GET} /course/type/{page} getCoursesByType
|
|
|
+ * @apiVersion 1.0.0
|
|
|
+ * @apiGroup CourseController
|
|
|
+ * @apiName getCoursesByType
|
|
|
+ * @apiParam (请求参数) {Number} uid
|
|
|
+ * @apiParam (请求参数) {String} type
|
|
|
+ * @apiParam (请求参数) {Number} page
|
|
|
+ * @apiParamExample 请求参数示例
|
|
|
+ * GET /course/type/1?uid=2&type=初级
|
|
|
+ * @apiSuccess (响应结果) {Number} pageNum
|
|
|
+ * @apiSuccess (响应结果) {Number} pageSize
|
|
|
+ * @apiSuccess (响应结果) {Number} size
|
|
|
+ * @apiSuccess (响应结果) {Number} startRow
|
|
|
+ * @apiSuccess (响应结果) {Number} endRow
|
|
|
+ * @apiSuccess (响应结果) {Number} total
|
|
|
+ * @apiSuccess (响应结果) {Number} pages
|
|
|
+ * @apiSuccess (响应结果) {Array} list
|
|
|
+ * @apiSuccess (响应结果) {Number} list.id
|
|
|
+ * @apiSuccess (响应结果) {String} list.name
|
|
|
+ * @apiSuccess (响应结果) {String} list.type
|
|
|
+ * @apiSuccess (响应结果) {String} list.intro
|
|
|
+ * @apiSuccess (响应结果) {String} list.picture
|
|
|
+ * @apiSuccess (响应结果) {String} list.school
|
|
|
+ * @apiSuccess (响应结果) {Number} list.createTime
|
|
|
+ * @apiSuccess (响应结果) {Number} list.cost
|
|
|
+ * @apiSuccess (响应结果) {Number} list.teacherId
|
|
|
+ * @apiSuccess (响应结果) {String} list.teacherName
|
|
|
+ * @apiSuccess (响应结果) {Boolean} list.bought
|
|
|
+ * @apiSuccess (响应结果) {Boolean} list.manageable
|
|
|
+ * @apiSuccess (响应结果) {Number} prePage
|
|
|
+ * @apiSuccess (响应结果) {Number} nextPage
|
|
|
+ * @apiSuccess (响应结果) {Boolean} isFirstPage
|
|
|
+ * @apiSuccess (响应结果) {Boolean} isLastPage
|
|
|
+ * @apiSuccess (响应结果) {Boolean} hasPreviousPage
|
|
|
+ * @apiSuccess (响应结果) {Boolean} hasNextPage
|
|
|
+ * @apiSuccess (响应结果) {Number} navigatePages
|
|
|
+ * @apiSuccess (响应结果) {Array} navigatepageNums
|
|
|
+ * @apiSuccess (响应结果) {Number} navigateFirstPage
|
|
|
+ * @apiSuccess (响应结果) {Number} navigateLastPage
|
|
|
+ * @apiSuccessExample 响应结果示例
|
|
|
+ {
|
|
|
+ "pageNum": 1,
|
|
|
+ "pageSize": 3,
|
|
|
+ "size": 2,
|
|
|
+ "startRow": 1,
|
|
|
+ "endRow": 2,
|
|
|
+ "total": 2,
|
|
|
+ "pages": 1,
|
|
|
+ "list": [
|
|
|
+ {
|
|
|
+ "id": 3,
|
|
|
+ "name": "程序猿与攻城狮",
|
|
|
+ "type": "初级",
|
|
|
+ "intro": "我们将由5位老师从不同的角度来说说他们对软件工程的理解。我们并非试图去覆盖所有软件工程的知识点,我们只是希望去让对软件工程有兴趣的你们了解到\"我要学什么\"\"我应如何学\"\"我今后能做什么\"这样一些基本的问题的部分答案。\r\n\r\n 刘钦老师会介绍软件工程的历史和软件工程建模;丁二玉老师会谈谈软件工程师和软件工程团队;冯桂焕老师会通过案例让大家体验人机交互的魅力;陈振宇老师会从概率统计讲到软件测试;刘嘉老师会娓娓道来他对最热门的移动互联网发展的本质的理解。",
|
|
|
+ "picture": "course3.png",
|
|
|
+ "school": "南京大学",
|
|
|
+ "createTime": "2020-12-20T02:00:00.000+00:00",
|
|
|
+ "cost": 1,
|
|
|
+ "teacherId": 1,
|
|
|
+ "teacherName": "刘钦",
|
|
|
+ "bought": false,
|
|
|
+ "manageable": false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "id": 4,
|
|
|
+ "name": "基于Java的面向对象编程范式",
|
|
|
+ "type": "初级",
|
|
|
+ "intro": "本课程完成了编程思维、结构化编程范式、面向对象编程方式的介绍,并且着重强调了面向对象编程中封装、协作和可修改性三个重要概念。通过客观题和6道编程题的训练,进一步加深对面向对象编程范式的理解,初步领略面向对象编程范式的风采。",
|
|
|
+ "picture": "course4.png",
|
|
|
+ "school": "南京大学",
|
|
|
+ "createTime": "2020-12-20T02:00:00.000+00:00",
|
|
|
+ "cost": 1,
|
|
|
+ "teacherId": 1,
|
|
|
+ "teacherName": "刘钦",
|
|
|
+ "bought": false,
|
|
|
+ "manageable": false
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "prePage": 0,
|
|
|
+ "nextPage": 0,
|
|
|
+ "isFirstPage": true,
|
|
|
+ "isLastPage": true,
|
|
|
+ "hasPreviousPage": false,
|
|
|
+ "hasNextPage": false,
|
|
|
+ "navigatePages": 8,
|
|
|
+ "navigatepageNums": [
|
|
|
+ 1
|
|
|
+ ],
|
|
|
+ "navigateFirstPage": 1,
|
|
|
+ "navigateLastPage": 1,
|
|
|
+ "lastPage": 1,
|
|
|
+ "firstPage": 1
|
|
|
+ }
|
|
|
+ */
|
|
|
+```
|
|
|
+
|
|
|
+4. 获取用户已购买的课程列表 GET course/sid/{sid}
|
|
|
+
|
|
|
+```
|
|
|
+GET course/sid/2
|
|
|
+返回结果示例
|
|
|
+[
|
|
|
+ {
|
|
|
+ "id": 1,
|
|
|
+ "name": "软件工程与计算 I",
|
|
|
+ "type": "中级",
|
|
|
+ "intro": "通过Scheme、Python和Java语言,让你分别体会函数式编程范式、结构化编程范式和面向对象编程范式",
|
|
|
+ "picture": "course1.png",
|
|
|
+ "school": "南京大学",
|
|
|
+ "createTime": "2020-12-20T02:00:00.000+00:00",
|
|
|
+ "cost": 1,
|
|
|
+ "teacherId": 1,
|
|
|
+ "teacherName": "刘钦",
|
|
|
+ "bought": true,
|
|
|
+ "manageable": false
|
|
|
+ },
|
|
|
+ ...
|
|
|
+]
|
|
|
+```
|
|
|
+
|
|
|
+5. 获取教师可管理的课程列表 GET course/tid/{tid}
|
|
|
+
|
|
|
+```
|
|
|
+GET course/tid/1
|
|
|
+返回结果示例
|
|
|
+[
|
|
|
+ {
|
|
|
+ "id": 1,
|
|
|
+ "name": "软件工程与计算 I",
|
|
|
+ "type": "中级",
|
|
|
+ "intro": "通过Scheme、Python和Java语言,让你分别体会函数式编程范式、结构化编程范式和面向对象编程范式",
|
|
|
+ "picture": "course1.png",
|
|
|
+ "school": "南京大学",
|
|
|
+ "createTime": "2020-12-20T02:00:00.000+00:00",
|
|
|
+ "cost": 1,
|
|
|
+ "teacherId": 1,
|
|
|
+ "teacherName": "刘钦",
|
|
|
+ "bought": false,
|
|
|
+ "manageable": true
|
|
|
+ },
|
|
|
+ ...
|
|
|
+]
|
|
|
+```
|
|
|
+
|
|
|
+6. 创建一门课程 POST course/create
|
|
|
+
|
|
|
+```
|
|
|
+ /**
|
|
|
+ * @api {POST} /course/create createCourse
|
|
|
+ * @apiVersion 1.0.0
|
|
|
+ * @apiGroup CourseController
|
|
|
+ * @apiName createCourse
|
|
|
+ * @apiParam (请求体) {String} name
|
|
|
+ * @apiParam (请求体) {String} type
|
|
|
+ * @apiParam (请求体) {String} intro
|
|
|
+ * @apiParam (请求体) {String} picture
|
|
|
+ * @apiParam (请求体) {String} school
|
|
|
+ * @apiParam (请求体) {Number} cost
|
|
|
+ * @apiParam (请求体) {Number} teacherId
|
|
|
+ * @apiParam (请求体) {String} teacherName
|
|
|
+ * @apiParam (请求体) {Boolean} bought
|
|
|
+ * @apiParam (请求体) {Boolean} manageable
|
|
|
+ * @apiParamExample 请求体示例
|
|
|
+ * {
|
|
|
+ "name":"测试课程",
|
|
|
+ "type":"初级",
|
|
|
+ "intro":"介绍",
|
|
|
+ "picture":"1.png",
|
|
|
+ "school":"NJU",
|
|
|
+ "cost":10,
|
|
|
+ "teacherId":1,
|
|
|
+ "teacherName":"刘钦",
|
|
|
+ "bought":false,
|
|
|
+ "manageable":true
|
|
|
+ }
|
|
|
+ * @apiSuccess (响应结果) {Number} code
|
|
|
+ * @apiSuccess (响应结果) {String} msg
|
|
|
+ * @apiSuccess (响应结果) {Object} data
|
|
|
+ * @apiSuccess (响应结果) {Number} data.id
|
|
|
+ * @apiSuccess (响应结果) {String} data.name
|
|
|
+ * @apiSuccess (响应结果) {String} data.type
|
|
|
+ * @apiSuccess (响应结果) {String} data.intro
|
|
|
+ * @apiSuccess (响应结果) {String} data.picture
|
|
|
+ * @apiSuccess (响应结果) {String} data.school
|
|
|
+ * @apiSuccess (响应结果) {Number} data.createTime
|
|
|
+ * @apiSuccess (响应结果) {Number} data.cost
|
|
|
+ * @apiSuccess (响应结果) {Number} data.teacherId
|
|
|
+ * @apiSuccess (响应结果) {String} data.teacherName
|
|
|
+ * @apiSuccess (响应结果) {Boolean} data.bought
|
|
|
+ * @apiSuccess (响应结果) {Boolean} data.manageable
|
|
|
+ * @apiSuccessExample 响应结果示例
|
|
|
+ {
|
|
|
+ "code": 1,
|
|
|
+ "msg": "课程创建成功。",
|
|
|
+ "data": {
|
|
|
+ "id": 6,
|
|
|
+ "name": "测试课程",
|
|
|
+ "type": "初级",
|
|
|
+ "intro": "介绍",
|
|
|
+ "picture": "1.png",
|
|
|
+ "school": "NJU",
|
|
|
+ "createTime": "2021-03-13T02:23:30.817+00:00",
|
|
|
+ "cost": 10,
|
|
|
+ "teacherId": 1,
|
|
|
+ "teacherName": "刘钦",
|
|
|
+ "bought": false,
|
|
|
+ "manageable": true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ */
|
|
|
+```
|