studentMeeting.js
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const router = require('koa-router')()
var studentMeetingController = require('../controller/studentMeetingController')
var status = require('../util/resTemplate')
router.prefix('/studentMeeting');
/**
* 添加预约课程
*/
router.post('/addStudentMeeting',async (ctx, next) => {
try{
var data = await studentMeetingController.addStudentMeeting(ctx, next);
status.successTemp(ctx,200,data);
}catch(e){
console.log(e)
status.catchError(ctx,400,e.message);
}
})
/**
* 查询课堂预约人数
*/
router.get('/getStudentMeetingCount/:meetingId',async (ctx, next) => {
try{
var data = await studentMeetingController.getStudentMeetingCount(ctx, next);
status.successTemp(ctx,200,data);
}catch(e){
console.log(e)
status.catchError(ctx,400,e.message);
}
})
router.get('/delStudentMeeting/:studentMeetingId',async (ctx, next) => {
try{
var data = await studentMeetingController.delStudentMeeting(ctx, next);
status.successTemp(ctx,200,data);
}catch(e){
console.log(e)
status.catchError(ctx,400,e.message);
}
})
router.get('/queryStudentMeeting/:teacherName',async (ctx, next) => {
try{
var data = await studentMeetingController.queryStudentMeeting(ctx, next);
status.successTemp(ctx,200,data);
}catch(e){
console.log(e)
status.catchError(ctx,400,e.message);
}
})
module.exports = router;