付智勇

no message

@@ -90,4 +90,16 @@ recordInfoController.prototype.getRecordFileURL = async(ctx,next)=>{ @@ -90,4 +90,16 @@ recordInfoController.prototype.getRecordFileURL = async(ctx,next)=>{
90 } 90 }
91 91
92 } 92 }
  93 +recordInfoController.prototype.getOldRecordInfo = async(ctx,next)=>{
  94 + try {
  95 + const meetingNumber = ctx.request.body.meetingNumber;
  96 + let recordInfo = await recordInfoService.getOldRecordInfo(meetingNumber)
  97 + return recordInfo;
  98 + } catch (e) {
  99 + console.log(e)
  100 + throw e
  101 + }
  102 +
  103 +}
  104 +
93 module.exports = new recordInfoController() 105 module.exports = new recordInfoController()
@@ -53,6 +53,15 @@ router.post('/tencentRecordInfo', async (ctx, next) => { @@ -53,6 +53,15 @@ router.post('/tencentRecordInfo', async (ctx, next) => {
53 status.catchError(ctx,400,e.message); 53 status.catchError(ctx,400,e.message);
54 } 54 }
55 }) 55 })
  56 +router.post('/getOldRecordInfo', async (ctx, next) => {
  57 + try{
  58 + var data = await meetingContoller.getOldRecordInfo(ctx, next);
  59 + status.successTemp(ctx,200,data);
  60 + }catch(e){
  61 + console.error(e)
  62 + status.catchError(ctx,400,e.message);
  63 + }
  64 +})
56 router.post('/getRecordFileURL', async (ctx, next) => { 65 router.post('/getRecordFileURL', async (ctx, next) => {
57 try{ 66 try{
58 var data = await meetingContoller.getRecordFileURL(ctx, next); 67 var data = await meetingContoller.getRecordFileURL(ctx, next);
@@ -4,6 +4,7 @@ const callfile = require('child_process'); @@ -4,6 +4,7 @@ const callfile = require('child_process');
4 const fs = require('fs'); 4 const fs = require('fs');
5 const moment = require('moment') 5 const moment = require('moment')
6 const applacation = require('../applacation') 6 const applacation = require('../applacation')
  7 +const sequelize = require('../config');
7 8
8 9
9 function recordInfoService(){ 10 function recordInfoService(){
@@ -47,8 +48,8 @@ recordInfoService.prototype.tencentRecordInfo = async(channelId)=>{ @@ -47,8 +48,8 @@ recordInfoService.prototype.tencentRecordInfo = async(channelId)=>{
47 48
48 recordInfoService.prototype.getRecordFileURL = async(path,time)=>{ 49 recordInfoService.prototype.getRecordFileURL = async(path,time)=>{
49 try { 50 try {
50 - let onlinePath = '/netWorkSchool/Agora_Recording_SDK_for_Linux_FULL/samples/'  
51 - //let onlinePath = '/Users/fzy/Downloads/Agora_Recording_SDK_for_Linux_FULL/samples/' 51 + //let onlinePath = '/netWorkSchool/Agora_Recording_SDK_for_Linux_FULL/samples/'
  52 + let onlinePath = '/Users/fzy/Downloads/Agora_Recording_SDK_for_Linux_FULL/samples/'
52 var backFile=[]; 53 var backFile=[];
53 var fileU 54 var fileU
54 let addrecord = await recordInfo.findAll({where:{channel:path}}); 55 let addrecord = await recordInfo.findAll({where:{channel:path}});
@@ -127,4 +128,23 @@ recordInfoService.prototype.getRecordFileURL = async(path,time)=>{ @@ -127,4 +128,23 @@ recordInfoService.prototype.getRecordFileURL = async(path,time)=>{
127 128
128 } 129 }
129 130
  131 +
  132 +recordInfoService.prototype.getOldRecordInfo = async(meetingNumber) =>{
  133 + try {
  134 + let sql = `SELECT
  135 + *
  136 + FROM
  137 + 3m_meeting_current_info
  138 + WHERE
  139 + 3m_meeting_current_info.meeting_number = '`+meetingNumber+`'
  140 + ORDER BY
  141 + 3m_meeting_current_info.create_time DESC`
  142 + console.log(sql);
  143 + let OldRecordInfo = await sequelize.query(sql);
  144 + return OldRecordInfo[0][0];
  145 + } catch (error) {
  146 + throw error;
  147 + }
  148 +}
  149 +
130 module.exports = new recordInfoService(); 150 module.exports = new recordInfoService();