Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
liyaoting
/
update-video
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 64b1b463
authored
2023-07-27 11:16:52 +0800
by
liyaoting
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
补充注释
1 parent
6a52265b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
src/main/java/cn/bxe/updatevideo/UpdateVideoApplication.java
src/main/java/cn/bxe/updatevideo/UpdateVideoApplication.java
View file @
64b1b46
...
...
@@ -49,9 +49,9 @@ import static cn.bxe.updatevideo.util.VersionUtil.*;
* 用于更新知识点精讲视频(其实是新增 一般不修改旧的)
* 1.一般来说操作流程是: 获取新书籍->获取新章节->获取新模块->获取新视频->下载视频封面->更新数据库视频封面链接
* 2.如果只是某本版本更新了内容,并没有新增书籍,也可以单独更新章节/模块/视频
* 3.他们存储有几个域名,其中有一个oss.5rs.com
得
域名,这个域名下的视频封面不可以直接访问的,所以需要特殊处理来下载
* 更新完视频后检查下有无此域名的,如果有需要使用功能6单独下载
* 4.视频可能没有时长,使用功能8
单独获取
* 3.他们存储有几个域名,其中有一个oss.5rs.com
的
域名,这个域名下的视频封面不可以直接访问的,所以需要特殊处理来下载
*
3.1
更新完视频后检查下有无此域名的,如果有需要使用功能6单独下载
* 4.视频可能没有时长,使用功能8
补充
*
*/
@SpringBootApplication
...
...
@@ -165,6 +165,12 @@ public class UpdateVideoApplication {
List
<
Textbook
>
textbooks
=
JSONArray
.
parseArray
(
data
,
Textbook
.
class
);
List
<
TbxXrBook
>
tbxXrBookList
=
new
ArrayList
<>();
for
(
Textbook
original
:
textbooks
)
{
String
textBookVersion
=
VERSION_MAP
.
get
(
original
.
getTextbookVersion
());
if
(
textBookVersion
==
null
)
{
logger
.
warn
(
"版本未登记,将不会新增: {}"
,
original
.
getTextbookVersion
());
logger
.
warn
(
JsonUtil
.
tranObjectToJsonStr
(
original
));
continue
;
}
TbxXrBook
pojo
=
new
TbxXrBook
();
pojo
.
setBookName
(
original
.
getSubjectName
()
+
original
.
getTextbookVersionName
()
+
original
.
getGradeName
()
+
original
.
getSchoolYearName
());
pojo
.
setTextbookId
(
Math
.
toIntExact
(
original
.
getId
()));
...
...
@@ -172,11 +178,6 @@ public class UpdateVideoApplication {
pojo
.
setGradeCode
(
GRADE_MAP
.
get
(
original
.
getGrade
()));
pojo
.
setTerm
(
SCHOOL_YEAR_MAP
.
get
(
original
.
getSchoolYear
()));
pojo
.
setStatus
(
10
);
String
textBookVersion
=
VERSION_MAP
.
get
(
original
.
getTextbookVersion
());
if
(
textBookVersion
==
null
)
{
logger
.
warn
(
"版本未登记: {} {}"
,
original
.
getTextbookVersion
(),
pojo
.
getBookName
());
logger
.
warn
(
JsonUtil
.
tranObjectToJsonStr
(
original
));
}
pojo
.
setTextbookVersion
(
textBookVersion
);
pojo
.
setCreateTime
(
System
.
currentTimeMillis
());
tbxXrBookList
.
add
(
pojo
);
...
...
@@ -622,6 +623,12 @@ public class UpdateVideoApplication {
logger
.
info
(
"更新视频时长完成"
);
}
/**
* 补充封面字段 cover_url
* 如果确定所有封面图片下载成功 也可以直接用以下sql
* update tbx_xr_video set cover_url = concat('https://pics-cos.banxiaoer.net/tbx/xrv/covers_images/xrv_',video_id,'.jpg') where cover_url is null;
* @throws InterruptedException
*/
private
static
void
updateDbVideoCoverUrl
()
throws
InterruptedException
{
LambdaQueryWrapper
<
TbxXrVideo
>
qw
=
new
LambdaQueryWrapper
<>();
qw
.
select
(
TbxXrVideo:
:
getVideoId
,
TbxXrVideo:
:
getId
);
...
...
@@ -648,6 +655,9 @@ public class UpdateVideoApplication {
}
}
/**
* 计算视频数量
*/
private
static
void
countSubjectVideo
()
{
SUBJECT_MAP
.
forEach
((
k
,
v
)
->
{
LambdaQueryWrapper
<
TbxXrBook
>
qw
=
new
LambdaQueryWrapper
<>();
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment