正在显示
10 个修改的文件
包含
62 行增加
和
277 行删除
| @@ -67,4 +67,13 @@ recordInfoController.prototype.stopRecording = async(ctx,next)=>{ | @@ -67,4 +67,13 @@ recordInfoController.prototype.stopRecording = async(ctx,next)=>{ | ||
| 67 | throw error; | 67 | throw error; |
| 68 | } | 68 | } |
| 69 | } | 69 | } |
| 70 | +recordInfoController.prototype.tencentRecordInfo = async(ctx,next)=>{ | ||
| 71 | + try { | ||
| 72 | + const channel = ctx.request.body.streamId; | ||
| 73 | + let recordInfo = await recordInfoService.tencentRecordInfo(streamId) | ||
| 74 | + } catch (error) { | ||
| 75 | + console.error(error); | ||
| 76 | + throw error; | ||
| 77 | + } | ||
| 78 | +} | ||
| 70 | module.exports = new recordInfoController() | 79 | module.exports = new recordInfoController() |
model.1/RecordInfoModel.js
已删除
100644 → 0
| 1 | -var sequelize = require('../config'); | ||
| 2 | -var Sequelize = require('sequelize'); | ||
| 3 | -var uuid = require('../util/UuidUtil') | ||
| 4 | - | ||
| 5 | - | ||
| 6 | -var recordInfo = sequelize.define('3m_record_info', { | ||
| 7 | - id: { | ||
| 8 | - type: Sequelize.STRING(32), | ||
| 9 | - defaultValue:uuid.db32(), | ||
| 10 | - allowNull: false, | ||
| 11 | - unique: true, | ||
| 12 | - primaryKey: true, | ||
| 13 | - field: "id" | ||
| 14 | - }, | ||
| 15 | - appId: { | ||
| 16 | - allowNull: false, | ||
| 17 | - type:Sequelize.STRING(50), | ||
| 18 | - field: "app_id" | ||
| 19 | - }, | ||
| 20 | - channel: { | ||
| 21 | - allowNull: false, | ||
| 22 | - type:Sequelize.STRING(50), | ||
| 23 | - field: "channel" | ||
| 24 | - }, | ||
| 25 | - channelKey:{ | ||
| 26 | - type:Sequelize.STRING(50), | ||
| 27 | - field: "channel_key" | ||
| 28 | - }, | ||
| 29 | - uid:{ | ||
| 30 | - type:Sequelize.STRING(50), | ||
| 31 | - field: "uid" | ||
| 32 | - }, | ||
| 33 | - userId:{ | ||
| 34 | - type:Sequelize.STRING(50), | ||
| 35 | - field: "user_id" | ||
| 36 | - }, | ||
| 37 | - userRole:{ | ||
| 38 | - type:Sequelize.STRING(50), | ||
| 39 | - field: "user_role" | ||
| 40 | - }, | ||
| 41 | - userName:{ | ||
| 42 | - type:Sequelize.STRING(50), | ||
| 43 | - field: "user_name" | ||
| 44 | - }, | ||
| 45 | - timestamp:{ | ||
| 46 | - type:Sequelize.STRING(50), | ||
| 47 | - field: "timestamp" | ||
| 48 | - }, | ||
| 49 | - recordTimestamp:{ | ||
| 50 | - type:Sequelize.STRING(50), | ||
| 51 | - field: "recordTimestamp" | ||
| 52 | - }, | ||
| 53 | - createTime:{ | ||
| 54 | - type:Sequelize.STRING(50), | ||
| 55 | - field: "create_time" | ||
| 56 | - }, | ||
| 57 | - status:{ | ||
| 58 | - type:Sequelize.INTEGER(1), | ||
| 59 | - field:'status', | ||
| 60 | - }, | ||
| 61 | - type:{ | ||
| 62 | - type:Sequelize.INTEGER(1), | ||
| 63 | - field:'type', | ||
| 64 | - } | ||
| 65 | - | ||
| 66 | - | ||
| 67 | -}, { | ||
| 68 | - timestamps: false, | ||
| 69 | - freezeTableName: true | ||
| 70 | - }); | ||
| 71 | - | ||
| 72 | -module.exports = recordInfo; |
model.1/siteModel.js
已删除
100644 → 0
| 1 | -var sequelize = require('../config'); | ||
| 2 | -var Sequelize = require('sequelize'); | ||
| 3 | -const uuid = require('../util/UuidUtil') | ||
| 4 | - | ||
| 5 | - | ||
| 6 | -var site = sequelize.define('3m_site', { | ||
| 7 | - id: { | ||
| 8 | - type: Sequelize.STRING(32), | ||
| 9 | - defaultValue:uuid.db32(), | ||
| 10 | - allowNull: false, | ||
| 11 | - unique: true, | ||
| 12 | - primaryKey: true, | ||
| 13 | - field: "id" | ||
| 14 | - }, | ||
| 15 | - siteId: { | ||
| 16 | - type:Sequelize.STRING(32), | ||
| 17 | - field: "siteid" | ||
| 18 | - }, | ||
| 19 | - siteKey: { | ||
| 20 | - type:Sequelize.STRING(128), | ||
| 21 | - field: "site_key" | ||
| 22 | - }, | ||
| 23 | - startDate:{ | ||
| 24 | - type:Sequelize.TEXT(0), | ||
| 25 | - field: "startdate" | ||
| 26 | - }, | ||
| 27 | - endDate:{ | ||
| 28 | - type:Sequelize.STRING(1024), | ||
| 29 | - field: "enddate" | ||
| 30 | - }, | ||
| 31 | - aseKey:{ | ||
| 32 | - type:Sequelize.STRING(128), | ||
| 33 | - field: "ase_key" | ||
| 34 | - }, | ||
| 35 | - mcuList:{ | ||
| 36 | - type:Sequelize.INTEGER(1), | ||
| 37 | - field: "mcu_list" | ||
| 38 | - }, | ||
| 39 | - msList:{ | ||
| 40 | - type:Sequelize.INTEGER(1), | ||
| 41 | - field: "ms_list" | ||
| 42 | - }, | ||
| 43 | - rsList:{ | ||
| 44 | - type:Sequelize.INTEGER(1), | ||
| 45 | - field: "rs_list" | ||
| 46 | - }, | ||
| 47 | - docList:{ | ||
| 48 | - type:Sequelize.STRING(32), | ||
| 49 | - field: "doc_list" | ||
| 50 | - } | ||
| 51 | -}, { | ||
| 52 | - timestamps: false, | ||
| 53 | - freezeTableName: true | ||
| 54 | - }); | ||
| 55 | - | ||
| 56 | -module.exports = site; |
model.1/studentMeetingModel.js
已删除
100644 → 0
| 1 | -var sequelize = require('../config'); | ||
| 2 | -var Sequelize = require('sequelize'); | ||
| 3 | -const uuid = require('../util/UuidUtil') | ||
| 4 | - | ||
| 5 | -var studentMeeting = sequelize.define('3m_student_meeting', { | ||
| 6 | - id: { | ||
| 7 | - type: Sequelize.STRING(32), | ||
| 8 | - defaultValue:uuid.db32(), | ||
| 9 | - allowNull: false, | ||
| 10 | - unique: true, | ||
| 11 | - primaryKey: true, | ||
| 12 | - field: "id" | ||
| 13 | - }, | ||
| 14 | - studentId: { | ||
| 15 | - allowNull: false, | ||
| 16 | - type:Sequelize.STRING(32), | ||
| 17 | - field: "student_id" | ||
| 18 | - }, | ||
| 19 | - meetingId: { | ||
| 20 | - allowNull: false, | ||
| 21 | - type:Sequelize.STRING(32), | ||
| 22 | - field: "meeting_id" | ||
| 23 | - }, | ||
| 24 | - siteId: { | ||
| 25 | - allowNull: false, | ||
| 26 | - type:Sequelize.STRING(32), | ||
| 27 | - field: "site_id" | ||
| 28 | - }, | ||
| 29 | - status: { | ||
| 30 | - allowNull: false, | ||
| 31 | - type:Sequelize.STRING(32), | ||
| 32 | - field: "status" | ||
| 33 | - }, | ||
| 34 | - createTime: { | ||
| 35 | - allowNull: false, | ||
| 36 | - type:Sequelize.STRING(32), | ||
| 37 | - field: "create_time" | ||
| 38 | - } | ||
| 39 | -},{ | ||
| 40 | - timestamps: false, | ||
| 41 | - freezeTableName: true | ||
| 42 | -}); | ||
| 43 | -module.exports = studentMeeting; |
model.1/userModel.js
已删除
100644 → 0
| 1 | -var sequelize = require('../config'); | ||
| 2 | -var Sequelize = require('sequelize'); | ||
| 3 | -var uuid = require('../util/UuidUtil') | ||
| 4 | - | ||
| 5 | - | ||
| 6 | -var user = sequelize.define('3m_user', { | ||
| 7 | - id: { | ||
| 8 | - type: Sequelize.STRING(32), | ||
| 9 | - defaultValue:uuid.db32(), | ||
| 10 | - allowNull: false, | ||
| 11 | - unique: true, | ||
| 12 | - primaryKey: true, | ||
| 13 | - field: "id" | ||
| 14 | - }, | ||
| 15 | - loginName: { | ||
| 16 | - allowNull: false, | ||
| 17 | - type:Sequelize.STRING(100), | ||
| 18 | - field: "login_name" | ||
| 19 | - }, | ||
| 20 | - // IDcard: { | ||
| 21 | - // allowNull: false, | ||
| 22 | - // type:Sequelize.STRING(50), | ||
| 23 | - // field: "IDcard" | ||
| 24 | - // }, | ||
| 25 | - password: { | ||
| 26 | - allowNull: false, | ||
| 27 | - type:Sequelize.STRING(100), | ||
| 28 | - field: "password" | ||
| 29 | - }, | ||
| 30 | - // salt:{ | ||
| 31 | - // type:Sequelize.INTEGER(2), | ||
| 32 | - // field: "salt" | ||
| 33 | - // }, | ||
| 34 | - companyName:{ | ||
| 35 | - type:Sequelize.STRING(1024), | ||
| 36 | - field: "company_name" | ||
| 37 | - }, | ||
| 38 | - userName:{ | ||
| 39 | - type:Sequelize.STRING(64), | ||
| 40 | - field: "user_name" | ||
| 41 | - }, | ||
| 42 | - userType:{ | ||
| 43 | - type:Sequelize.INTEGER(1), | ||
| 44 | - field: "user_type" | ||
| 45 | - }, | ||
| 46 | - userRole:{ | ||
| 47 | - type:Sequelize.INTEGER(1), | ||
| 48 | - field: "user_role" | ||
| 49 | - }, | ||
| 50 | - userEmail:{ | ||
| 51 | - type:Sequelize.INTEGER(1), | ||
| 52 | - field: "user_email" | ||
| 53 | - }, | ||
| 54 | - userMobile:{ | ||
| 55 | - type:Sequelize.STRING(32), | ||
| 56 | - field: "user_mobile" | ||
| 57 | - }, | ||
| 58 | - createTime:{ | ||
| 59 | - type:Sequelize.DATE, | ||
| 60 | - defaultValue:Sequelize.NOW, | ||
| 61 | - field: "create_time" | ||
| 62 | - }, | ||
| 63 | - endTime:{ | ||
| 64 | - type:Sequelize.DATE, | ||
| 65 | - field: "end_time" | ||
| 66 | - }, | ||
| 67 | - content:{ | ||
| 68 | - type:Sequelize.TEXT(1024), | ||
| 69 | - field: "content" | ||
| 70 | - }, | ||
| 71 | - serialNo:{ | ||
| 72 | - type:Sequelize.INTEGER(11), | ||
| 73 | - field: "serial_no" | ||
| 74 | - }, | ||
| 75 | - siteId:{ | ||
| 76 | - type:Sequelize.STRING(32), | ||
| 77 | - field: "site_id" | ||
| 78 | - }, | ||
| 79 | - userStatus:{ | ||
| 80 | - type:Sequelize.INTEGER(11), | ||
| 81 | - field: "user_status" | ||
| 82 | - }, | ||
| 83 | - groupId:{ | ||
| 84 | - type:Sequelize.STRING(128), | ||
| 85 | - field: "group_id" | ||
| 86 | - }, | ||
| 87 | -}, { | ||
| 88 | - timestamps: false, | ||
| 89 | - freezeTableName: true | ||
| 90 | - }); | ||
| 91 | - | ||
| 92 | -module.exports = user; |
| @@ -3,26 +3,29 @@ var Sequelize = require('sequelize'); | @@ -3,26 +3,29 @@ var Sequelize = require('sequelize'); | ||
| 3 | var uuid = require('../util/UuidUtil') | 3 | var uuid = require('../util/UuidUtil') |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | -var recordStatus = sequelize.define('3m_record_status', { | 6 | +var recordInfo = sequelize.define('3m_tencent_record_info', { |
| 7 | id: { | 7 | id: { |
| 8 | type: Sequelize.STRING(32), | 8 | type: Sequelize.STRING(32), |
| 9 | - defaultValue:uuid.db32(), | 9 | + defaultValue:uuid.db32(), |
| 10 | allowNull: false, | 10 | allowNull: false, |
| 11 | unique: true, | 11 | unique: true, |
| 12 | primaryKey: true, | 12 | primaryKey: true, |
| 13 | field: "id" | 13 | field: "id" |
| 14 | }, | 14 | }, |
| 15 | - channel:{ | 15 | + streamId: { |
| 16 | + allowNull: false, | ||
| 16 | type:Sequelize.STRING(50), | 17 | type:Sequelize.STRING(50), |
| 17 | - field: "channel" | ||
| 18 | - }, | ||
| 19 | - status:{ | ||
| 20 | - type:Sequelize.INTEGER(1), | ||
| 21 | - field:'status', | 18 | + field: "stream_id" |
| 22 | }, | 19 | }, |
| 20 | + recordInfo: { | ||
| 21 | + allowNull: false, | ||
| 22 | + type:Sequelize.STRING(50), | ||
| 23 | + field: "record_info" | ||
| 24 | + } | ||
| 25 | + | ||
| 23 | }, { | 26 | }, { |
| 24 | - timestamps: false, | ||
| 25 | - freezeTableName: true | ||
| 26 | -}); | 27 | + timestamps: false, |
| 28 | + freezeTableName: true | ||
| 29 | + }); | ||
| 27 | 30 | ||
| 28 | -module.exports = recordStatus; | ||
| 31 | +module.exports = recordInfo; |
| @@ -44,4 +44,14 @@ router.put('/updaterecordInfo/:channel', async (ctx, next) => { | @@ -44,4 +44,14 @@ router.put('/updaterecordInfo/:channel', async (ctx, next) => { | ||
| 44 | } | 44 | } |
| 45 | }) | 45 | }) |
| 46 | 46 | ||
| 47 | + router.post('/tencentRecordInfo', async (ctx, next) => { | ||
| 48 | + try{ | ||
| 49 | + var data = await meetingContoller.tencentRecordInfo(ctx, next); | ||
| 50 | + status.successTemp(ctx,200,data); | ||
| 51 | + }catch(e){ | ||
| 52 | + console.error(e) | ||
| 53 | + status.catchError(ctx,400,e.message); | ||
| 54 | + } | ||
| 55 | + }) | ||
| 56 | + | ||
| 47 | module.exports = router | 57 | module.exports = router |
| @@ -9,9 +9,13 @@ const multer = require('koa-multer'); | @@ -9,9 +9,13 @@ const multer = require('koa-multer'); | ||
| 9 | const moment = require('moment') | 9 | const moment = require('moment') |
| 10 | var body = require('koa-better-body') | 10 | var body = require('koa-better-body') |
| 11 | var formParse = require('co-busboy') | 11 | var formParse = require('co-busboy') |
| 12 | +const uuid = require('../util/UuidUtil'); | ||
| 13 | + | ||
| 12 | 14 | ||
| 13 | const applacation = require('../applacation'); | 15 | const applacation = require('../applacation'); |
| 14 | 16 | ||
| 17 | +const tencentRecordInfoModel =require( '../model/tencentRecordInfoModel') | ||
| 18 | + | ||
| 15 | 19 | ||
| 16 | 20 | ||
| 17 | 21 | ||
| @@ -37,10 +41,22 @@ router.post('/tgpCallback', async (ctx, next) => { | @@ -37,10 +41,22 @@ router.post('/tgpCallback', async (ctx, next) => { | ||
| 37 | //let s = await uploaddemo(ctx.req,ctx.res,next) | 41 | //let s = await uploaddemo(ctx.req,ctx.res,next) |
| 38 | //let w = await fs.rename('/Users/fzy/project/koa2_Sequelize_project/uploads/'+'19543f72d9682d0bedf67fc98da4597b','/Users/fzy/project/koa2_Sequelize_project/uploads/'+'www.jpg') | 42 | //let w = await fs.rename('/Users/fzy/project/koa2_Sequelize_project/uploads/'+'19543f72d9682d0bedf67fc98da4597b','/Users/fzy/project/koa2_Sequelize_project/uploads/'+'www.jpg') |
| 39 | try { | 43 | try { |
| 40 | - let f = await fs.appendFileSync(path.join(__dirname, 'tgp.txt'),JSON.stringify(ctx.request.body)+'/n') | 44 | + //let f = await fs.appendFileSync(path.join(__dirname, 'tgp.txt'),JSON.stringify(ctx.request.body)+'/n') |
| 45 | + var body = ctx.request.body | ||
| 46 | + let id = uuid.db32() | ||
| 47 | + let stream = body.stream_id.split('_'); | ||
| 48 | + | ||
| 49 | + | ||
| 50 | + let info = { | ||
| 51 | + id:id, | ||
| 52 | + streamId:stream[0]+'_'+stream[1], | ||
| 53 | + recordInfo:JSON.stringify(body) | ||
| 54 | + } | ||
| 55 | + let tencentRecordInfo = await tencentRecordInfoModel.create(info) | ||
| 41 | ctx.response.status= 200; | 56 | ctx.response.status= 200; |
| 42 | ctx.body = { "code":0 } | 57 | ctx.body = { "code":0 } |
| 43 | } catch (error) { | 58 | } catch (error) { |
| 59 | + console.log(error) | ||
| 44 | ctx.response.status= 400; | 60 | ctx.response.status= 400; |
| 45 | ctx.body = {} | 61 | ctx.body = {} |
| 46 | 62 |
| @@ -160,7 +160,7 @@ meetingService.prototype.getAllMeetingBySiteID = async(params,page = 1,pageno =1 | @@ -160,7 +160,7 @@ meetingService.prototype.getAllMeetingBySiteID = async(params,page = 1,pageno =1 | ||
| 160 | return new Date(m2.beginTime).getTime() - new Date(m1.beginTime).getTime(); | 160 | return new Date(m2.beginTime).getTime() - new Date(m1.beginTime).getTime(); |
| 161 | }); | 161 | }); |
| 162 | console.log((page-1)*pageno,(page-1)*pageno+10) | 162 | console.log((page-1)*pageno,(page-1)*pageno+10) |
| 163 | - return {meeting:meetingdata.slice((page-1)*pageno,(page-1)*pageno+pageno)} | 163 | + return {meeting:meetingdata.slice((page-1)*pageno,100)} |
| 164 | } catch (error) { | 164 | } catch (error) { |
| 165 | throw error | 165 | throw error |
| 166 | } | 166 | } |
| 1 | const recordInfo =require( '../model/RecordInfoModel') | 1 | const recordInfo =require( '../model/RecordInfoModel') |
| 2 | +const tencentRecordInfoModel =require( '../model/tencentRecordInfoModel') | ||
| 3 | + | ||
| 2 | 4 | ||
| 3 | function recordInfoService(){ | 5 | function recordInfoService(){ |
| 4 | 6 | ||
| @@ -30,4 +32,12 @@ recordInfoService.prototype.getRecordInfo = async(channel) =>{ | @@ -30,4 +32,12 @@ recordInfoService.prototype.getRecordInfo = async(channel) =>{ | ||
| 30 | throw error; | 32 | throw error; |
| 31 | } | 33 | } |
| 32 | } | 34 | } |
| 35 | +recordInfoService.prototype.tencentRecordInfo = async(streamId)=>{ | ||
| 36 | + try { | ||
| 37 | + let tencentRecordInfo = await tencentRecordInfoModel.findAll({where:{streamId:streamId}}) | ||
| 38 | + return tencentRecordInfo | ||
| 39 | + } catch (error) { | ||
| 40 | + throw error; | ||
| 41 | + } | ||
| 42 | +} | ||
| 33 | module.exports = new recordInfoService(); | 43 | module.exports = new recordInfoService(); |
-
请 注册 或 登录 后发表评论