正在显示
2 个修改的文件
包含
39 行增加
和
35 行删除
1 | { | 1 | { |
2 | "GETCLASSURL":"http://139.196.126.156:8081/getLogs/recordClassList", | 2 | "GETCLASSURL":"http://139.196.126.156:8081/getLogs/recordClassList", |
3 | "GETCLASSURLPARAMETER":{ | 3 | "GETCLASSURLPARAMETER":{ |
4 | - "siteId":["beidatest"], | 4 | + "siteId":["beidatest","funexenglish"], |
5 | "key":"xdymp4record20191225", | 5 | "key":"xdymp4record20191225", |
6 | "page":1, | 6 | "page":1, |
7 | "maxMedia":1 | 7 | "maxMedia":1 |
@@ -30,7 +30,7 @@ class MediaCreat { | @@ -30,7 +30,7 @@ class MediaCreat { | ||
30 | // 取出所有数据 | 30 | // 取出所有数据 |
31 | async allData() { | 31 | async allData() { |
32 | const {startTime, endTime} = YesterdayTime() | 32 | const {startTime, endTime} = YesterdayTime() |
33 | - let fileConfig = await new MediaCreat().getConfigFileJson() | 33 | + let fileConfig = new MediaCreat().getConfigFileJson() |
34 | if (!fileConfig) return false | 34 | if (!fileConfig) return false |
35 | className = siteIds.shift() | 35 | className = siteIds.shift() |
36 | const {GETCLASSURL, GETCLASSURLPARAMETER} = JSON.parse(fileConfig) | 36 | const {GETCLASSURL, GETCLASSURLPARAMETER} = JSON.parse(fileConfig) |
@@ -264,39 +264,43 @@ class MediaCreat { | @@ -264,39 +264,43 @@ class MediaCreat { | ||
264 | } | 264 | } |
265 | 265 | ||
266 | 266 | ||
267 | -// router.get('/', async function (req, res, next) { | ||
268 | -// new MediaCreat().wrieLog("录制开始:------>") | ||
269 | -// let fileConfig = await new MediaCreat().getConfigFileJson() | ||
270 | -// if (!fileConfig) return false | ||
271 | -// | ||
272 | -// const {GETCLASSURLPARAMETER} = JSON.parse(fileConfig) | ||
273 | -// siteIds = GETCLASSURLPARAMETER.siteId | ||
274 | -// | ||
275 | -// let result = await new MediaCreat().allData() | ||
276 | -// if (result) { | ||
277 | -// // 去重 | ||
278 | -// classobj = {} | ||
279 | -// classid = classid.reduce(function (item, next) { | ||
280 | -// classobj[next.classId] ? '' : classobj[next.classId] = true && item.push(next); | ||
281 | -// return item; | ||
282 | -// }, []); | ||
283 | -// // 写入log | ||
284 | -// new MediaCreat().wrieLog("去重后的classid:------>" + JSON.stringify(classid)) | ||
285 | -// if (classid.length) { | ||
286 | -// for (let i = 0; i < GETCLASSURLPARAMETER.maxMedia; i++) { | ||
287 | -// let shiftData = classid.shift() | ||
288 | -// if (shiftData) { | ||
289 | -// // new MediaCreat().mediaCreat(shiftData['classId'], shiftData['siteId']) | ||
290 | -// } else { | ||
291 | -// return false | ||
292 | -// } | ||
293 | -// } | ||
294 | -// res.send({code: "0"}); | ||
295 | -// } else { | ||
296 | -// res.send({code: "1", message: "无录制数据"}); | ||
297 | -// } | ||
298 | -// } | ||
299 | -// }); | 267 | +router.get('/', async function (req, res, next) { |
268 | + if (classid.length > 0) { | ||
269 | + // 有正在录制中的课堂,禁止重复 | ||
270 | + res.send({code: "1", message: "有正在录制中的课堂", data: classid}); | ||
271 | + return | ||
272 | + } | ||
273 | + new MediaCreat().wrieLog("脚本录制开始:------>") | ||
274 | + let fileConfig = new MediaCreat().getConfigFileJson() | ||
275 | + if (!fileConfig) return false | ||
276 | + | ||
277 | + const {GETCLASSURLPARAMETER} = JSON.parse(fileConfig) | ||
278 | + siteIds = GETCLASSURLPARAMETER.siteId | ||
279 | + let result = await new MediaCreat().allData() | ||
280 | + if (result) { | ||
281 | + // 去重 | ||
282 | + classobj = {} | ||
283 | + classid = classid.reduce(function (item, next) { | ||
284 | + classobj[next.classId] ? '' : classobj[next.classId] = true && item.push(next); | ||
285 | + return item; | ||
286 | + }, []); | ||
287 | + // 写入log | ||
288 | + new MediaCreat().wrieLog("去重后的classid:------>" + JSON.stringify(classid)) | ||
289 | + if (classid.length) { | ||
290 | + for (let i = 0; i < GETCLASSURLPARAMETER.maxMedia; i++) { | ||
291 | + let shiftData = classid.shift() | ||
292 | + if (shiftData) { | ||
293 | + new MediaCreat().recordingCreat(shiftData['classId'], shiftData['siteId']) | ||
294 | + } else { | ||
295 | + return false | ||
296 | + } | ||
297 | + } | ||
298 | + res.send({code: "0"}); | ||
299 | + } else { | ||
300 | + res.send({code: "1", message: "无录制数据"}); | ||
301 | + } | ||
302 | + } | ||
303 | +}); | ||
300 | 304 | ||
301 | /** | 305 | /** |
302 | * { | 306 | * { |
-
请 注册 或 登录 后发表评论