付智勇

no message

... ... @@ -69,8 +69,8 @@ recordInfoController.prototype.stopRecording = async(ctx,next)=>{
}
recordInfoController.prototype.tencentRecordInfo = async(ctx,next)=>{
try {
const streamId = ctx.request.body.streamId;
let recordInfo = await recordInfoService.tencentRecordInfo(streamId)
const channelId = ctx.request.body.channelId;
let recordInfo = await recordInfoService.tencentRecordInfo(channelId)
return recordInfo;
} catch (error) {
console.error(error);
... ...
... ... @@ -12,15 +12,20 @@ var recordInfo = sequelize.define('3m_tencent_record_info', {
primaryKey: true,
field: "id"
},
streamId: {
channelId: {
allowNull: false,
type:Sequelize.STRING(50),
field: "stream_id"
field: "channel_id"
},
recordInfo: {
allowNull: false,
type:Sequelize.STRING(50),
type:Sequelize.STRING(1024),
field: "record_info"
},
createTime: {
allowNull: false,
type:Sequelize.STRING(50),
field: "create_time"
}
}, {
... ...
... ... @@ -49,8 +49,9 @@ router.post('/tgpCallback', async (ctx, next) => {
let info = {
id:id,
streamId:stream[0]+'_'+stream[1],
recordInfo:JSON.stringify(body)
channelId:stream[0]+'_'+stream[1],
recordInfo:JSON.stringify(body),
createTime:JSON.stringify( new Date())
}
let tencentRecordInfo = await tencentRecordInfoModel.create(info)
ctx.response.status= 200;
... ...
... ... @@ -32,9 +32,9 @@ recordInfoService.prototype.getRecordInfo = async(channel) =>{
throw error;
}
}
recordInfoService.prototype.tencentRecordInfo = async(streamId)=>{
recordInfoService.prototype.tencentRecordInfo = async(channelId)=>{
try {
let tencentRecordInfo = await tencentRecordInfoModel.findAll({where:{streamId:streamId}})
let tencentRecordInfo = await tencentRecordInfoModel.findAll({where:{channelId:channelId}})
return tencentRecordInfo
} catch (error) {
throw error;
... ...