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 6a52265b
authored
2023-07-04 20:33:25 +0800
by
liyaoting
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加版本
1 parent
15ede663
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
8 deletions
src/main/java/cn/bxe/updatevideo/UpdateVideoApplication.java
src/main/java/cn/bxe/updatevideo/util/VersionUtil.java
src/main/java/cn/bxe/updatevideo/UpdateVideoApplication.java
View file @
6a52265
...
...
@@ -46,7 +46,7 @@ import java.util.stream.Collectors;
import
static
cn
.
bxe
.
updatevideo
.
util
.
VersionUtil
.*;
/**
*
@deprecated
用于更新知识点精讲视频(其实是新增 一般不修改旧的)
* 用于更新知识点精讲视频(其实是新增 一般不修改旧的)
* 1.一般来说操作流程是: 获取新书籍->获取新章节->获取新模块->获取新视频->下载视频封面->更新数据库视频封面链接
* 2.如果只是某本版本更新了内容,并没有新增书籍,也可以单独更新章节/模块/视频
* 3.他们存储有几个域名,其中有一个oss.5rs.com得域名,这个域名下的视频封面不可以直接访问的,所以需要特殊处理来下载
...
...
@@ -633,6 +633,12 @@ public class UpdateVideoApplication {
AtomicInteger
counter
=
new
AtomicInteger
();
for
(
TbxXrVideo
video
:
list
)
{
pool
.
execute
(()
->
{
//检测封面是否存在本地
String
fileName
=
"xrv_"
+
video
.
getVideoId
()
+
".jpg"
;
String
filePath
=
"D:\\video\\"
+
fileName
;
if
(!
new
File
(
filePath
).
exists
())
{
return
;
}
video
.
setCoverUrl
(
"https://pics-cos.banxiaoer.net/tbx/xrv/covers_images/xrv_"
+
video
.
getVideoId
()
+
".jpg"
);
video
.
updateById
();
int
count
=
counter
.
addAndGet
(
1
);
...
...
@@ -654,9 +660,7 @@ public class UpdateVideoApplication {
List
<
TbxXrModule
>
list1
=
moduleService
.
list
(
moduleQW
);
LambdaQueryWrapper
<
TbxXrVideo
>
videoQW
=
new
LambdaQueryWrapper
<>();
list1
.
forEach
(
obj
->
{
videoQW
.
or
().
eq
(
TbxXrVideo:
:
getChapterId
,
obj
.
getChapterId
()).
eq
(
TbxXrVideo:
:
getModuleId
,
obj
.
getModuleId
());
});
list1
.
forEach
(
obj
->
videoQW
.
or
().
eq
(
TbxXrVideo:
:
getChapterId
,
obj
.
getChapterId
()).
eq
(
TbxXrVideo:
:
getModuleId
,
obj
.
getModuleId
()));
List
<
TbxXrVideo
>
list2
=
videoService
.
list
(
videoQW
);
System
.
out
.
println
(
v
+
","
+
list2
.
size
());
}
...
...
@@ -666,10 +670,8 @@ public class UpdateVideoApplication {
/**
* 获取oss.5rs.me的视频封面
*
* @throws IOException
* @throws InterruptedException
*/
private
static
void
getOss5rsmeCover
()
throws
IOException
,
InterruptedException
{
private
static
void
getOss5rsmeCover
()
throws
IOException
{
LambdaQueryWrapper
<
TbxXrVideo
>
qw
=
new
LambdaQueryWrapper
<>();
qw
.
like
(
TbxXrVideo:
:
getUrl
,
"https://oss.5rs.me"
);
qw
.
isNull
(
TbxXrVideo:
:
getCoverUrl
);
...
...
src/main/java/cn/bxe/updatevideo/util/VersionUtil.java
View file @
6a52265
...
...
@@ -33,8 +33,26 @@ public class VersionUtil {
GRADE_MAP
.
put
(
"GRADE_ONE"
,
"7"
);
GRADE_MAP
.
put
(
"GRADE_TWO"
,
"8"
);
GRADE_MAP
.
put
(
"GRADE_THREE"
,
"9"
);
GRADE_MAP
.
put
(
"SENIOR_ONE"
,
"10"
);
//必修 一般高一
GRADE_MAP
.
put
(
"REQUIRED_ONE"
,
"10"
);
GRADE_MAP
.
put
(
"REQUIRED_TWO"
,
"10"
);
GRADE_MAP
.
put
(
"REQUIRED_THREE"
,
"10"
);
//选修
GRADE_MAP
.
put
(
"TAKE_ONE"
,
"11"
);
//选择性必修 一般高二
//选择性必修1
GRADE_MAP
.
put
(
"TAKE_REQUIRED_ONE"
,
"11"
);
//选择性必修二
GRADE_MAP
.
put
(
"TAKE_REQUIRED_TWO"
,
"11"
);
//选择性必修三
GRADE_MAP
.
put
(
"TAKE_REQUIRED_THREE"
,
"11"
);
//书籍版本
VERSION_MAP
.
put
(
"CHINA"
,
"zhongtu"
);
VERSION_MAP
.
put
(
"LUKE"
,
"luke"
);
...
...
@@ -61,9 +79,12 @@ public class VersionUtil {
VERSION_MAP
.
put
(
"PEP_B"
,
"pep_b"
);
VERSION_MAP
.
put
(
"QINGDAO"
,
"QINGDAO"
);
//学年
//学期
//全一册
SCHOOL_YEAR_MAP
.
put
(
"ALL_BOOKS"
,
5
);
//上学期
SCHOOL_YEAR_MAP
.
put
(
"LAST_SEMESTER"
,
1
);
//下学期
SCHOOL_YEAR_MAP
.
put
(
"NEXT_SEMESTER"
,
2
);
}
}
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