Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
张艾宸
/
webScreen
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
张艾宸
2019-12-30 17:08:07 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5787f51c76953a3857f9aa359a82dbdd17523462
5787f51c
1 parent
213de441
一次性获取所有录制课堂的数据 1.1
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
16 行增加
和
23 行删除
config/config.js
routes/index.js
config/config.js
查看文件 @
5787f51
...
...
@@ -3,7 +3,7 @@ const GETCLASSURLPARAMETER = {
siteId
:[
"BuzzKID"
,
"kuaikuenglish"
],
key
:
"xdymp4record20191225"
,
page
:
1
,
maxMedia
:
1
,
maxMedia
:
3
,
}
const
PROJECTWINCATALOG
=
"E:/project/web_capture_release/win-x64"
...
...
routes/index.js
查看文件 @
5787f51
...
...
@@ -24,29 +24,27 @@ class MediaCreat {
constructor
()
{
}
// 取出所有数据
async
allData
()
{
let
page
=
1
className
=
siteIds
.
shift
()
let
page
=
1
if
(
className
)
{
let
result
=
await
getRequestClassIds
(
GETCLASSURL
,
className
,
GETCLASSURLPARAMETER
.
key
,
startTime
,
endTime
,
page
)
parentData
[
result
.
data
.
data
.
siteId
]
=
[]
parentData
[
result
.
data
.
data
.
siteId
]
=
new
Set
()
for
(
let
j
=
0
;
j
<
result
.
data
.
data
.
list
.
length
;
j
++
)
{
classid
.
push
(
result
.
data
.
data
.
list
[
j
])
parentData
[
result
.
data
.
data
.
siteId
].
add
(
result
.
data
.
data
.
list
[
j
][
'classId'
])
}
const
{
siteId
,
list
,
totalPage
}
=
result
.
data
.
data
for
(
let
i
=
page
+=
1
;
i
<=
totalPage
;
i
++
)
{
let
result
=
await
getRequestClassIds
(
GETCLASSURL
,
className
,
GETCLASSURLPARAMETER
.
key
,
startTime
,
endTime
,
i
)
for
(
let
j
=
0
;
j
<
result
.
data
.
data
.
list
.
length
;
j
++
)
{
classid
.
push
(
result
.
data
.
data
.
list
[
j
])
parentData
[
result
.
data
.
data
.
siteId
].
add
(
result
.
data
.
data
.
list
[
j
][
'classId'
])
}
}
parentData
[
result
.
data
.
data
.
siteId
]
=
Array
.
from
(
parentData
[
result
.
data
.
data
.
siteId
])
classid
=
classid
.
reduce
(
function
(
item
,
next
)
{
classobj
[
next
.
classId
]
?
''
:
classobj
[
next
.
classId
]
=
true
&&
item
.
push
(
next
);
return
item
;
},
[]);
for
(
let
i
=
0
;
i
<
classid
.
length
;
i
++
)
{
parentData
[
result
.
data
.
data
.
siteId
].
push
(
classid
[
i
].
classId
)
if
(
siteIds
.
length
)
{
return
await
new
MediaCreat
().
allData
()
}
return
true
}
else
{
...
...
@@ -93,15 +91,6 @@ class MediaCreat {
if
(
classid
.
length
)
{
let
shiftData
=
classid
.
shift
()
new
MediaCreat
().
mediaCreat
(
shiftData
[
'classId'
],
shiftData
[
'siteId'
])
}
else
{
if
(
siteIds
.
length
)
{
// 如果有多家需要录制,继续录制下一家
let
isAppend
=
await
new
MediaCreat
().
allData
()
if
(
isAppend
)
{
let
shiftData
=
classid
.
shift
()
new
MediaCreat
().
mediaCreat
(
shiftData
[
'classId'
],
shiftData
[
'siteId'
])
}
}
}
}
});
...
...
@@ -110,8 +99,13 @@ class MediaCreat {
router
.
get
(
'/'
,
async
function
(
req
,
res
,
next
)
{
let
isAppend
=
await
new
MediaCreat
().
allData
()
if
(
isAppend
)
{
let
result
=
await
new
MediaCreat
().
allData
()
if
(
result
)
{
// 去重
classid
=
classid
.
reduce
(
function
(
item
,
next
)
{
classobj
[
next
.
classId
]
?
''
:
classobj
[
next
.
classId
]
=
true
&&
item
.
push
(
next
);
return
item
;
},
[]);
if
(
classid
.
length
)
{
for
(
let
i
=
0
;
i
<
GETCLASSURLPARAMETER
.
maxMedia
;
i
++
)
{
let
shiftData
=
classid
.
shift
()
...
...
@@ -122,9 +116,8 @@ router.get('/', async function (req, res, next) {
}
}
}
res
.
send
({
code
:
"0"
});
}
res
.
render
(
'index'
,
{
title
:
'Express'
});
});
module
.
exports
=
router
;
...
...
请
注册
或
登录
后发表评论