RecordInfo.js 1.3 KB
const router = require('koa-router')()
var meetingContoller = require('../controller/recordInfoController')
var status = require('../util/resTemplate') 


router.prefix('/recordInfo');


router.put('/updaterecordInfo/:channel', async (ctx, next) => {
    try{
        var data = await meetingContoller.updaterecordInfo(ctx, next);
        status.successTemp(ctx,200,data);
      }catch(e){
          console.error(e)
        status.catchError(ctx,400,e.message);    
      } 
  })
  router.get('/getRecordInfo/:channel', async (ctx, next) => {
    try{
        var data = await meetingContoller.getRecordInfo(ctx, next);
        status.successTemp(ctx,200,data);
      }catch(e){
          console.error(e)
        status.catchError(ctx,400,e.message);    
      } 
  })

  router.post('/addRecordInfo', async (ctx, next) => {
    try{
        var data = await meetingContoller.addRecordInfo(ctx, next);
        status.successTemp(ctx,200,data);
      }catch(e){
          console.error(e)
        status.catchError(ctx,400,e.message);    
      } 
  })
  router.post('/stopRecording', async (ctx, next) => {
    try{
        var data = await meetingContoller.stopRecording(ctx, next);
        status.successTemp(ctx,200,data);
      }catch(e){
          console.error(e)
        status.catchError(ctx,400,e.message);    
      } 
  })

  module.exports = router