付智勇

no message

@@ -69,8 +69,8 @@ recordInfoController.prototype.stopRecording = async(ctx,next)=>{ @@ -69,8 +69,8 @@ recordInfoController.prototype.stopRecording = async(ctx,next)=>{
69 } 69 }
70 recordInfoController.prototype.tencentRecordInfo = async(ctx,next)=>{ 70 recordInfoController.prototype.tencentRecordInfo = async(ctx,next)=>{
71 try { 71 try {
72 - const streamId = ctx.request.body.streamId;  
73 - let recordInfo = await recordInfoService.tencentRecordInfo(streamId) 72 + const channelId = ctx.request.body.channelId;
  73 + let recordInfo = await recordInfoService.tencentRecordInfo(channelId)
74 return recordInfo; 74 return recordInfo;
75 } catch (error) { 75 } catch (error) {
76 console.error(error); 76 console.error(error);
@@ -12,15 +12,20 @@ var recordInfo = sequelize.define('3m_tencent_record_info', { @@ -12,15 +12,20 @@ var recordInfo = sequelize.define('3m_tencent_record_info', {
12 primaryKey: true, 12 primaryKey: true,
13 field: "id" 13 field: "id"
14 }, 14 },
15 - streamId: { 15 + channelId: {
16 allowNull: false, 16 allowNull: false,
17 type:Sequelize.STRING(50), 17 type:Sequelize.STRING(50),
18 - field: "stream_id" 18 + field: "channel_id"
19 }, 19 },
20 recordInfo: { 20 recordInfo: {
21 allowNull: false, 21 allowNull: false,
22 - type:Sequelize.STRING(50), 22 + type:Sequelize.STRING(1024),
23 field: "record_info" 23 field: "record_info"
  24 + },
  25 + createTime: {
  26 + allowNull: false,
  27 + type:Sequelize.STRING(50),
  28 + field: "create_time"
24 } 29 }
25 30
26 }, { 31 }, {
@@ -49,8 +49,9 @@ router.post('/tgpCallback', async (ctx, next) => { @@ -49,8 +49,9 @@ router.post('/tgpCallback', async (ctx, next) => {
49 49
50 let info = { 50 let info = {
51 id:id, 51 id:id,
52 - streamId:stream[0]+'_'+stream[1],  
53 - recordInfo:JSON.stringify(body) 52 + channelId:stream[0]+'_'+stream[1],
  53 + recordInfo:JSON.stringify(body),
  54 + createTime:JSON.stringify( new Date())
54 } 55 }
55 let tencentRecordInfo = await tencentRecordInfoModel.create(info) 56 let tencentRecordInfo = await tencentRecordInfoModel.create(info)
56 ctx.response.status= 200; 57 ctx.response.status= 200;
@@ -32,9 +32,9 @@ recordInfoService.prototype.getRecordInfo = async(channel) =>{ @@ -32,9 +32,9 @@ recordInfoService.prototype.getRecordInfo = async(channel) =>{
32 throw error; 32 throw error;
33 } 33 }
34 } 34 }
35 -recordInfoService.prototype.tencentRecordInfo = async(streamId)=>{ 35 +recordInfoService.prototype.tencentRecordInfo = async(channelId)=>{
36 try { 36 try {
37 - let tencentRecordInfo = await tencentRecordInfoModel.findAll({where:{streamId:streamId}}) 37 + let tencentRecordInfo = await tencentRecordInfoModel.findAll({where:{channelId:channelId}})
38 return tencentRecordInfo 38 return tencentRecordInfo
39 } catch (error) { 39 } catch (error) {
40 throw error; 40 throw error;