meeting.js
1.2 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
const router = require('koa-router')()
var meetingContoller = require('../controller/meetingController')
var status = require('../util/resTemplate')
router.prefix('/meeting')
router.post('/createMeeting', async (ctx, next) => {
try{
var data = await meetingContoller.createMeeting(ctx, next);
status.successTemp(ctx,200,data);
}catch(e){
console.error(e)
status.catchError(ctx,400,e.message);
}
})
router.post('/getMeeting', async (ctx, next) => {
try{
var data = await meetingContoller.getMeeting(ctx, next);
status.successTemp(ctx,200,data);
}catch(e){
status.catchError(ctx,400,e.message);
}
});
router.delete('/delMeeting/:meetingId', async (ctx, next) => {
try{
var data = await meetingContoller.delMeeting(ctx, next);
status.successTemp(ctx,200,data);
}catch(e){
status.catchError(ctx,400,e.message);
}
})
router.put('/updateMeeting/:meetingId', async (ctx, next) => {
try{
var data = await meetingContoller.updateMeeting(ctx, next);
status.successTemp(ctx,200,data);
}catch(e){
status.catchError(ctx,400,e.message);
}
})
module.exports = router