RecordInfo.js 2.1 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);    
      } 
  })

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

  module.exports = router