Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
roncoo
roncoo-education
提交
86432513
R
roncoo-education
项目概览
roncoo
/
roncoo-education
大约 1 年 前同步成功
通知
146
Star
5
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roncoo-education
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
86432513
编写于
4月 04, 2019
作者:
F
fengyongwei
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://github.com/roncoo/roncoo-education.git
上级
a3752c08
4370d967
变更
29
隐藏空白更改
内联
并排
Showing
29 changed file
with
155 addition
and
53 deletion
+155
-53
pom.xml
pom.xml
+1
-1
roncoo-education-course/pom.xml
roncoo-education-course/pom.xml
+1
-1
roncoo-education-course/roncoo-education-course-common/pom.xml
...o-education-course/roncoo-education-course-common/pom.xml
+1
-1
roncoo-education-course/roncoo-education-course-feign/pom.xml
...oo-education-course/roncoo-education-course-feign/pom.xml
+1
-1
roncoo-education-course/roncoo-education-course-service/pom.xml
...-education-course/roncoo-education-course-service/pom.xml
+1
-1
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/biz/ApiUploadBiz.java
...com/roncoo/education/course/service/biz/ApiUploadBiz.java
+41
-10
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/controller/biz/BossCourseVideoBiz.java
...ion/course/service/controller/biz/BossCourseVideoBiz.java
+25
-3
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/CourseChapterPeriodAuditDao.java
...ation/course/service/dao/CourseChapterPeriodAuditDao.java
+8
-0
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/CourseChapterPeriodDao.java
.../education/course/service/dao/CourseChapterPeriodDao.java
+13
-6
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/impl/CourseChapterPeriodAuditDaoImpl.java
...rse/service/dao/impl/CourseChapterPeriodAuditDaoImpl.java
+12
-2
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/impl/CourseChapterPeriodDaoImpl.java
...n/course/service/dao/impl/CourseChapterPeriodDaoImpl.java
+10
-1
roncoo-education-crontab-plan/pom.xml
roncoo-education-crontab-plan/pom.xml
+1
-1
roncoo-education-crontab-plan/src/main/java/com/roncoo/education/crontab/VideoCrontab.java
.../main/java/com/roncoo/education/crontab/VideoCrontab.java
+1
-0
roncoo-education-gateway-api/pom.xml
roncoo-education-gateway-api/pom.xml
+1
-1
roncoo-education-server-admin/pom.xml
roncoo-education-server-admin/pom.xml
+1
-1
roncoo-education-server-config/pom.xml
roncoo-education-server-config/pom.xml
+1
-1
roncoo-education-server-eureka/pom.xml
roncoo-education-server-eureka/pom.xml
+1
-1
roncoo-education-server-zipkin/pom.xml
roncoo-education-server-zipkin/pom.xml
+1
-1
roncoo-education-system/pom.xml
roncoo-education-system/pom.xml
+1
-1
roncoo-education-system/roncoo-education-system-common/pom.xml
...o-education-system/roncoo-education-system-common/pom.xml
+1
-1
roncoo-education-system/roncoo-education-system-feign/pom.xml
...oo-education-system/roncoo-education-system-feign/pom.xml
+1
-1
roncoo-education-system/roncoo-education-system-service/pom.xml
...-education-system/roncoo-education-system-service/pom.xml
+1
-1
roncoo-education-user/pom.xml
roncoo-education-user/pom.xml
+1
-1
roncoo-education-user/roncoo-education-user-common/pom.xml
roncoo-education-user/roncoo-education-user-common/pom.xml
+1
-1
roncoo-education-user/roncoo-education-user-feign/pom.xml
roncoo-education-user/roncoo-education-user-feign/pom.xml
+1
-1
roncoo-education-user/roncoo-education-user-service/pom.xml
roncoo-education-user/roncoo-education-user-service/pom.xml
+1
-1
roncoo-education-util/pom.xml
roncoo-education-util/pom.xml
+1
-1
roncoo-education-util/src/main/java/com/roncoo/education/util/polyv/PolyvUtil.java
.../main/java/com/roncoo/education/util/polyv/PolyvUtil.java
+24
-10
roncoo-education-web-boss/pom.xml
roncoo-education-web-boss/pom.xml
+1
-1
未找到文件。
pom.xml
浏览文件 @
86432513
...
...
@@ -5,7 +5,7 @@
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
<packaging>
pom
</packaging>
<name>
roncoo-education
</name>
...
...
roncoo-education-course/pom.xml
浏览文件 @
86432513
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-course
</artifactId>
...
...
roncoo-education-course/roncoo-education-course-common/pom.xml
浏览文件 @
86432513
...
...
@@ -6,7 +6,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education-course
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-course-common
</artifactId>
...
...
roncoo-education-course/roncoo-education-course-feign/pom.xml
浏览文件 @
86432513
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education-course
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-course-feign
</artifactId>
...
...
roncoo-education-course/roncoo-education-course-service/pom.xml
浏览文件 @
86432513
...
...
@@ -6,7 +6,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education-course
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-course-service
</artifactId>
...
...
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/biz/ApiUploadBiz.java
浏览文件 @
86432513
...
...
@@ -11,8 +11,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.roncoo.education.course.service.dao.CourseChapterPeriodAuditDao
;
import
com.roncoo.education.course.service.dao.CourseChapterPeriodDao
;
import
com.roncoo.education.course.service.dao.CourseVideoDao
;
import
com.roncoo.education.course.service.dao.FileStorageDao
;
import
com.roncoo.education.course.service.dao.impl.mapper.entity.CourseChapterPeriod
;
import
com.roncoo.education.course.service.dao.impl.mapper.entity.CourseChapterPeriodAudit
;
import
com.roncoo.education.course.service.dao.impl.mapper.entity.CourseVideo
;
import
com.roncoo.education.course.service.dao.impl.mapper.entity.FileStorage
;
import
com.roncoo.education.system.common.bean.vo.SysVO
;
...
...
@@ -43,12 +47,16 @@ import com.xiaoleilu.hutool.util.ObjectUtil;
public
class
ApiUploadBiz
extends
BaseBiz
{
@Autowired
private
CourseVideoDao
courseVideoDao
;
private
IBossSys
bossSys
;
@Autowired
private
FileStorageDao
fileStorageDao
;
private
CourseChapterPeriodAuditDao
courseChapterPeriodAuditDao
;
@Autowired
private
CourseChapterPeriodDao
courseChapterPeriodDao
;
@Autowired
private
IBossSys
bossSys
;
private
CourseVideoDao
courseVideoDao
;
@Autowired
private
FileStorageDao
fileStorageDao
;
/**
* 上传视频接口
...
...
@@ -64,7 +72,8 @@ public class ApiUploadBiz extends BaseBiz {
// 获取上传文件的原名
String
fileName
=
videoFile
.
getOriginalFilename
();
boolean
fileStatus
=
true
;
List
<
String
>
fileTypes
=
Arrays
.
asList
(
"avi"
,
"mp4"
,
"flv"
,
"mpg"
,
"mov"
,
"asf"
,
"3gp"
,
"f4v"
,
"wmv"
,
"x-ms-wmv\n"
);
List
<
String
>
fileTypes
=
Arrays
.
asList
(
"avi"
,
"mp4"
,
"flv"
,
"mpg"
,
"mov"
,
"asf"
,
"3gp"
,
"f4v"
,
"wmv"
,
"x-ms-wmv\n"
);
for
(
String
filetype
:
fileTypes
)
{
// 上传文件的原名+小写+后缀
if
(
fileName
.
toLowerCase
().
endsWith
(
filetype
))
{
...
...
@@ -79,7 +88,8 @@ public class ApiUploadBiz extends BaseBiz {
Long
videoNo
=
IdWorker
.
getId
();
// 当作存储到本地的文件名,方便定时任务的处理
// 1、上传到本地
File
targetFile
=
new
File
(
SystemUtil
.
PERIOD_VIDEO_PATH
+
videoNo
.
toString
()
+
"."
+
StrUtil
.
getSuffix
(
fileName
));
File
targetFile
=
new
File
(
SystemUtil
.
PERIOD_VIDEO_PATH
+
videoNo
.
toString
()
+
"."
+
StrUtil
.
getSuffix
(
fileName
));
targetFile
.
setLastModified
(
System
.
currentTimeMillis
());
// 设置最后修改时间
// 判断文件目录是否存在,不存在就创建文件目录
if
(!
targetFile
.
getParentFile
().
exists
())
{
...
...
@@ -127,7 +137,8 @@ public class ApiUploadBiz extends BaseBiz {
courseVideoDao
.
updateById
(
courseVideo
);
// 3、异步上传到阿里云
String
videoOasId
=
AliyunUtil
.
uploadDoc
(
PlatformEnum
.
COURSE
,
targetFile
,
BeanUtil
.
copyProperties
(
sys
,
Aliyun
.
class
));
String
videoOasId
=
AliyunUtil
.
uploadDoc
(
PlatformEnum
.
COURSE
,
targetFile
,
BeanUtil
.
copyProperties
(
sys
,
Aliyun
.
class
));
courseVideo
.
setVideoOasId
(
videoOasId
);
courseVideoDao
.
updateById
(
courseVideo
);
...
...
@@ -144,6 +155,22 @@ public class ApiUploadBiz extends BaseBiz {
courseVideoDao
.
updateById
(
video
);
}
// 更新课时审核表视频信息
List
<
CourseChapterPeriodAudit
>
periodAuditList
=
courseChapterPeriodAuditDao
.
listByVideoNo
(
videoNo
);
for
(
CourseChapterPeriodAudit
periodAudit
:
periodAuditList
)
{
periodAudit
.
setVideoName
(
courseVideo
.
getVideoName
());
periodAudit
.
setVideoLength
(
courseVideo
.
getVideoLength
());
periodAudit
.
setVideoVid
(
courseVideo
.
getVideoVid
());
courseChapterPeriodAuditDao
.
updateById
(
periodAudit
);
}
// 更新课时视频信息
List
<
CourseChapterPeriod
>
periodList
=
courseChapterPeriodDao
.
listByVideoNo
(
videoNo
);
for
(
CourseChapterPeriod
period
:
periodList
)
{
period
.
setVideoName
(
courseVideo
.
getVideoName
());
period
.
setVideoLength
(
courseVideo
.
getVideoLength
());
period
.
setVideoVid
(
courseVideo
.
getVideoVid
());
courseChapterPeriodDao
.
updateById
(
period
);
}
// 4、成功删除本地文件
if
(
targetFile
.
isFile
()
&&
targetFile
.
exists
())
{
targetFile
.
delete
();
...
...
@@ -171,7 +198,8 @@ public class ApiUploadBiz extends BaseBiz {
Long
fileNo
=
IdWorker
.
getId
();
// 1、上传到本地
if
(
sys
.
getFileType
().
equals
(
FileTypeEnum
.
LOCAL
.
getCode
()))
{
File
pic
=
new
File
(
SystemUtil
.
PIC_STORAGE_PATH
+
fileNo
.
toString
()
+
"."
+
StrUtil
.
getSuffix
(
picFile
.
getOriginalFilename
()));
File
pic
=
new
File
(
SystemUtil
.
PIC_STORAGE_PATH
+
fileNo
.
toString
()
+
"."
+
StrUtil
.
getSuffix
(
picFile
.
getOriginalFilename
()));
try
{
// 判断文件目录是否存在,不存在就创建文件目录
if
(!
pic
.
getParentFile
().
exists
())
{
...
...
@@ -191,7 +219,8 @@ public class ApiUploadBiz extends BaseBiz {
return
Result
.
error
(
"上传文件出错,请重新上传"
);
}
}
return
Result
.
success
(
AliyunUtil
.
uploadPic
(
PlatformEnum
.
COURSE
,
picFile
,
BeanUtil
.
copyProperties
(
bossSys
.
getSys
(),
Aliyun
.
class
)));
return
Result
.
success
(
AliyunUtil
.
uploadPic
(
PlatformEnum
.
COURSE
,
picFile
,
BeanUtil
.
copyProperties
(
bossSys
.
getSys
(),
Aliyun
.
class
)));
}
return
Result
.
error
(
"请选择上传的图片"
);
}
...
...
@@ -211,7 +240,8 @@ public class ApiUploadBiz extends BaseBiz {
Long
fileNo
=
IdWorker
.
getId
();
// 1、上传到本地
if
(
sys
.
getFileType
().
equals
(
FileTypeEnum
.
LOCAL
.
getCode
()))
{
File
pic
=
new
File
(
SystemUtil
.
DOC_STORAGE_PATH
+
fileNo
.
toString
()
+
"."
+
StrUtil
.
getSuffix
(
docFile
.
getOriginalFilename
()));
File
pic
=
new
File
(
SystemUtil
.
DOC_STORAGE_PATH
+
fileNo
.
toString
()
+
"."
+
StrUtil
.
getSuffix
(
docFile
.
getOriginalFilename
()));
try
{
// 判断文件目录是否存在,不存在就创建文件目录
if
(!
pic
.
getParentFile
().
exists
())
{
...
...
@@ -231,7 +261,8 @@ public class ApiUploadBiz extends BaseBiz {
return
Result
.
error
(
"上传文件出错,请重新上传"
);
}
}
return
Result
.
success
(
AliyunUtil
.
uploadDoc
(
PlatformEnum
.
COURSE
,
docFile
,
BeanUtil
.
copyProperties
(
bossSys
.
getSys
(),
Aliyun
.
class
)));
return
Result
.
success
(
AliyunUtil
.
uploadDoc
(
PlatformEnum
.
COURSE
,
docFile
,
BeanUtil
.
copyProperties
(
bossSys
.
getSys
(),
Aliyun
.
class
)));
}
return
Result
.
error
(
"请选择上传的文件"
);
...
...
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/controller/biz/BossCourseVideoBiz.java
浏览文件 @
86432513
...
...
@@ -10,7 +10,11 @@ import org.springframework.util.StringUtils;
import
com.roncoo.education.course.common.bean.qo.CourseVideoQO
;
import
com.roncoo.education.course.common.bean.vo.CourseVideoVO
;
import
com.roncoo.education.course.service.dao.CourseChapterPeriodAuditDao
;
import
com.roncoo.education.course.service.dao.CourseChapterPeriodDao
;
import
com.roncoo.education.course.service.dao.CourseVideoDao
;
import
com.roncoo.education.course.service.dao.impl.mapper.entity.CourseChapterPeriod
;
import
com.roncoo.education.course.service.dao.impl.mapper.entity.CourseChapterPeriodAudit
;
import
com.roncoo.education.course.service.dao.impl.mapper.entity.CourseVideo
;
import
com.roncoo.education.course.service.dao.impl.mapper.entity.CourseVideoExample
;
import
com.roncoo.education.system.common.bean.vo.SysVO
;
...
...
@@ -34,12 +38,14 @@ import com.xiaoleilu.hutool.util.ObjectUtil;
*/
@Component
public
class
BossCourseVideoBiz
{
@Autowired
private
IBossSys
bossSys
;
@Autowired
private
CourseVideoDao
dao
;
@Autowired
private
IBossSys
bossSys
;
private
CourseChapterPeriodAuditDao
courseChapterPeriodAuditDao
;
@Autowired
private
CourseChapterPeriodDao
courseChapterPeriodDao
;
public
Page
<
CourseVideoVO
>
listForPage
(
CourseVideoQO
qo
)
{
CourseVideoExample
example
=
new
CourseVideoExample
();
...
...
@@ -117,6 +123,22 @@ public class BossCourseVideoBiz {
dao
.
updateById
(
info
);
}
}
// 更新课时审核表视频信息
List
<
CourseChapterPeriodAudit
>
periodAuditList
=
courseChapterPeriodAuditDao
.
listByVideoNo
(
videoNo
);
for
(
CourseChapterPeriodAudit
periodAudit
:
periodAuditList
)
{
periodAudit
.
setVideoLength
(
result
.
getDuration
());
periodAudit
.
setVideoVid
(
result
.
getVid
());
courseChapterPeriodAuditDao
.
updateById
(
periodAudit
);
}
// 更新课时视频信息
List
<
CourseChapterPeriod
>
periodList
=
courseChapterPeriodDao
.
listByVideoNo
(
videoNo
);
for
(
CourseChapterPeriod
period
:
periodList
)
{
period
.
setVideoLength
(
result
.
getDuration
());
period
.
setVideoVid
(
result
.
getVid
());
courseChapterPeriodDao
.
updateById
(
period
);
}
}
// 成功删除本地文件
targetFile
.
delete
();
...
...
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/CourseChapterPeriodAuditDao.java
浏览文件 @
86432513
...
...
@@ -73,4 +73,12 @@ public interface CourseChapterPeriodAuditDao {
* @author wuyun
*/
List
<
CourseChapterPeriodAudit
>
listByChapterIdAndStatusId
(
Long
chapterId
,
Integer
statusId
);
/**
* 根据视频编号获取课时信息
*
* @param videoNo
* @author kyh
*/
List
<
CourseChapterPeriodAudit
>
listByVideoNo
(
Long
videoNo
);
}
\ No newline at end of file
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/CourseChapterPeriodDao.java
浏览文件 @
86432513
...
...
@@ -7,19 +7,18 @@ import com.roncoo.education.course.service.dao.impl.mapper.entity.CourseChapterP
import
com.roncoo.education.util.base.Page
;
public
interface
CourseChapterPeriodDao
{
int
save
(
CourseChapterPeriod
record
);
int
save
(
CourseChapterPeriod
record
);
int
deleteById
(
Long
id
);
int
deleteById
(
Long
id
);
int
updateById
(
CourseChapterPeriod
record
);
int
updateById
(
CourseChapterPeriod
record
);
CourseChapterPeriod
getById
(
Long
id
);
CourseChapterPeriod
getById
(
Long
id
);
Page
<
CourseChapterPeriod
>
listForPage
(
int
pageCurrent
,
int
pageSize
,
CourseChapterPeriodExample
example
);
Page
<
CourseChapterPeriod
>
listForPage
(
int
pageCurrent
,
int
pageSize
,
CourseChapterPeriodExample
example
);
List
<
CourseChapterPeriod
>
listByChapterId
(
Long
chapterId
);
/**
* 根据章节编号和状态查找可用的课时信息集合
*
...
...
@@ -38,4 +37,12 @@ public interface CourseChapterPeriodDao {
*/
CourseChapterPeriod
getByVideoNo
(
Long
videoNo
);
/**
* 根据视频编号查找课时信息
*
* @param videoNo
* @return
*/
List
<
CourseChapterPeriod
>
listByVideoNo
(
Long
videoNo
);
}
\ No newline at end of file
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/impl/CourseChapterPeriodAuditDaoImpl.java
浏览文件 @
86432513
...
...
@@ -38,14 +38,16 @@ public class CourseChapterPeriodAuditDaoImpl implements CourseChapterPeriodAudit
return
this
.
courseChapterPeriodAuditMapper
.
selectByPrimaryKey
(
id
);
}
public
Page
<
CourseChapterPeriodAudit
>
listForPage
(
int
pageCurrent
,
int
pageSize
,
CourseChapterPeriodAuditExample
example
)
{
public
Page
<
CourseChapterPeriodAudit
>
listForPage
(
int
pageCurrent
,
int
pageSize
,
CourseChapterPeriodAuditExample
example
)
{
int
count
=
this
.
courseChapterPeriodAuditMapper
.
countByExample
(
example
);
pageSize
=
PageUtil
.
checkPageSize
(
pageSize
);
pageCurrent
=
PageUtil
.
checkPageCurrent
(
count
,
pageSize
,
pageCurrent
);
int
totalPage
=
PageUtil
.
countTotalPage
(
count
,
pageSize
);
example
.
setLimitStart
(
PageUtil
.
countOffset
(
pageCurrent
,
pageSize
));
example
.
setPageSize
(
pageSize
);
return
new
Page
<
CourseChapterPeriodAudit
>(
count
,
totalPage
,
pageCurrent
,
pageSize
,
this
.
courseChapterPeriodAuditMapper
.
selectByExample
(
example
));
return
new
Page
<
CourseChapterPeriodAudit
>(
count
,
totalPage
,
pageCurrent
,
pageSize
,
this
.
courseChapterPeriodAuditMapper
.
selectByExample
(
example
));
}
@Override
...
...
@@ -120,4 +122,12 @@ public class CourseChapterPeriodAuditDaoImpl implements CourseChapterPeriodAudit
example
.
setOrderByClause
(
"sort asc, id asc"
);
return
this
.
courseChapterPeriodAuditMapper
.
selectByExample
(
example
);
}
@Override
public
List
<
CourseChapterPeriodAudit
>
listByVideoNo
(
Long
videoNo
)
{
CourseChapterPeriodAuditExample
example
=
new
CourseChapterPeriodAuditExample
();
Criteria
c
=
example
.
createCriteria
();
c
.
andVideoNoEqualTo
(
videoNo
);
return
this
.
courseChapterPeriodAuditMapper
.
selectByExample
(
example
);
}
}
\ No newline at end of file
roncoo-education-course/roncoo-education-course-service/src/main/java/com/roncoo/education/course/service/dao/impl/CourseChapterPeriodDaoImpl.java
浏览文件 @
86432513
...
...
@@ -48,7 +48,8 @@ public class CourseChapterPeriodDaoImpl implements CourseChapterPeriodDao {
int
totalPage
=
PageUtil
.
countTotalPage
(
count
,
pageSize
);
example
.
setLimitStart
(
PageUtil
.
countOffset
(
pageCurrent
,
pageSize
));
example
.
setPageSize
(
pageSize
);
return
new
Page
<
CourseChapterPeriod
>(
count
,
totalPage
,
pageCurrent
,
pageSize
,
this
.
courseChapterPeriodMapper
.
selectByExample
(
example
));
return
new
Page
<
CourseChapterPeriod
>(
count
,
totalPage
,
pageCurrent
,
pageSize
,
this
.
courseChapterPeriodMapper
.
selectByExample
(
example
));
}
@Override
...
...
@@ -80,4 +81,12 @@ public class CourseChapterPeriodDaoImpl implements CourseChapterPeriodDao {
}
return
list
.
get
(
0
);
}
@Override
public
List
<
CourseChapterPeriod
>
listByVideoNo
(
Long
videoNo
)
{
CourseChapterPeriodExample
example
=
new
CourseChapterPeriodExample
();
Criteria
c
=
example
.
createCriteria
();
c
.
andVideoNoEqualTo
(
videoNo
);
return
this
.
courseChapterPeriodMapper
.
selectByExample
(
example
);
}
}
\ No newline at end of file
roncoo-education-crontab-plan/pom.xml
浏览文件 @
86432513
...
...
@@ -6,7 +6,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-crontab-plan
</artifactId>
...
...
roncoo-education-crontab-plan/src/main/java/com/roncoo/education/crontab/VideoCrontab.java
浏览文件 @
86432513
...
...
@@ -45,6 +45,7 @@ public class VideoCrontab extends BaseController {
if
(
file
.
isDirectory
())
{
// isDirectory是否文件夹
File
[]
files
=
file
.
listFiles
();
// listFiles是获取该目录下所有文件和目录的绝对路径
for
(
File
targetFile
:
files
)
{
if
(
targetFile
.
isFile
()
&&
targetFile
.
exists
())
{
if
(
FileUtil
.
newerThan
(
targetFile
,
(
System
.
currentTimeMillis
()
-
7200000
)))
{
// 上传两个小时内
...
...
roncoo-education-gateway-api/pom.xml
浏览文件 @
86432513
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-gateway-api
</artifactId>
...
...
roncoo-education-server-admin/pom.xml
浏览文件 @
86432513
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-server-admin
</artifactId>
...
...
roncoo-education-server-config/pom.xml
浏览文件 @
86432513
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-server-config
</artifactId>
...
...
roncoo-education-server-eureka/pom.xml
浏览文件 @
86432513
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-server-eureka
</artifactId>
...
...
roncoo-education-server-zipkin/pom.xml
浏览文件 @
86432513
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-server-zipkin
</artifactId>
...
...
roncoo-education-system/pom.xml
浏览文件 @
86432513
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-system
</artifactId>
...
...
roncoo-education-system/roncoo-education-system-common/pom.xml
浏览文件 @
86432513
...
...
@@ -6,7 +6,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education-system
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-system-common
</artifactId>
...
...
roncoo-education-system/roncoo-education-system-feign/pom.xml
浏览文件 @
86432513
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education-system
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-system-feign
</artifactId>
...
...
roncoo-education-system/roncoo-education-system-service/pom.xml
浏览文件 @
86432513
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education-system
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-system-service
</artifactId>
...
...
roncoo-education-user/pom.xml
浏览文件 @
86432513
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-user
</artifactId>
...
...
roncoo-education-user/roncoo-education-user-common/pom.xml
浏览文件 @
86432513
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education-user
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-user-common
</artifactId>
...
...
roncoo-education-user/roncoo-education-user-feign/pom.xml
浏览文件 @
86432513
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education-user
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-user-feign
</artifactId>
...
...
roncoo-education-user/roncoo-education-user-service/pom.xml
浏览文件 @
86432513
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education-user
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-user-service
</artifactId>
...
...
roncoo-education-util/pom.xml
浏览文件 @
86432513
...
...
@@ -6,7 +6,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-util
</artifactId>
...
...
roncoo-education-util/src/main/java/com/roncoo/education/util/polyv/PolyvUtil.java
浏览文件 @
86432513
...
...
@@ -32,6 +32,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.util.StringUtils
;
import
com.aliyun.oas.utils.StringUtil
;
import
com.ning.http.util.Base64
;
import
com.roncoo.education.util.config.SystemUtil
;
import
com.roncoo.education.util.tools.JSONUtil
;
...
...
@@ -66,7 +67,9 @@ public final class PolyvUtil {
*/
public
static
String
getPolyvCode
(
PolyvCode
polyvCode
)
{
try
{
return
HttpUtil
.
encode
(
Base64
.
encode
(
SecureUtil
.
des
(
Base64
.
decode
(
KEY
)).
encrypt
(
JSONUtil
.
toJSONString
(
polyvCode
))),
CHARSET_UTF_8
);
return
HttpUtil
.
encode
(
Base64
.
encode
(
SecureUtil
.
des
(
Base64
.
decode
(
KEY
)).
encrypt
(
JSONUtil
.
toJSONString
(
polyvCode
))),
CHARSET_UTF_8
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"保利威视,加密出错"
,
e
);
return
""
;
...
...
@@ -81,7 +84,9 @@ public final class PolyvUtil {
*/
public
static
PolyvCode
decode
(
String
code
)
{
try
{
return
JSONUtil
.
parseObject
(
new
String
(
SecureUtil
.
des
(
Base64
.
decode
(
KEY
)).
decrypt
(
Base64
.
decode
(
HttpUtil
.
decode
(
code
,
CHARSET_UTF_8
)))),
PolyvCode
.
class
);
return
JSONUtil
.
parseObject
(
new
String
(
SecureUtil
.
des
(
Base64
.
decode
(
KEY
)).
decrypt
(
Base64
.
decode
(
HttpUtil
.
decode
(
code
,
CHARSET_UTF_8
)))),
PolyvCode
.
class
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"保利威视,解密出错"
,
e
);
return
null
;
...
...
@@ -102,7 +107,9 @@ public final class PolyvUtil {
map
.
put
(
"viewerName"
,
bo
.
getUserNo
());
map
.
put
(
"extraParams"
,
"HTML5"
);
map
.
put
(
"viewerId"
,
bo
.
getUserNo
());
String
concated
=
"extraParams"
+
map
.
get
(
"extraParams"
)
+
"ts"
+
map
.
get
(
"ts"
)
+
"userId"
+
map
.
get
(
"userId"
)
+
"videoId"
+
map
.
get
(
"videoId"
)
+
"viewerId"
+
map
.
get
(
"viewerId"
)
+
"viewerIp"
+
map
.
get
(
"viewerIp"
)
+
"viewerName"
+
map
.
get
(
"viewerName"
);
String
concated
=
"extraParams"
+
map
.
get
(
"extraParams"
)
+
"ts"
+
map
.
get
(
"ts"
)
+
"userId"
+
map
.
get
(
"userId"
)
+
"videoId"
+
map
.
get
(
"videoId"
)
+
"viewerId"
+
map
.
get
(
"viewerId"
)
+
"viewerIp"
+
map
.
get
(
"viewerIp"
)
+
"viewerName"
+
map
.
get
(
"viewerName"
);
map
.
put
(
"sign"
,
MD5Util
.
MD5
(
secretkey
+
concated
+
secretkey
).
toUpperCase
());
String
result
=
post
(
SystemUtil
.
POLYV_GETTOKEN
,
map
);
logger
.
info
(
"保利威视,获取token接口:result={}"
,
result
);
...
...
@@ -158,9 +165,12 @@ public final class PolyvUtil {
public
static
UploadFileResult
uploadFile
(
File
file
,
UploadFile
uploadFile
,
String
writetoken
)
{
Map
<
String
,
Object
>
param
=
new
HashMap
<
String
,
Object
>();
param
.
put
(
"writetoken"
,
writetoken
);
param
.
put
(
"JSONRPC"
,
"{\"title\": \""
+
uploadFile
.
getTitle
()
+
"\", \"tag\": \""
+
uploadFile
.
getTag
()
+
"\", \"desc\": \""
+
uploadFile
.
getDesc
()
+
"\"}"
);
param
.
put
(
"JSONRPC"
,
"{\"title\": \""
+
uploadFile
.
getTitle
()
+
"\", \"tag\": \""
+
uploadFile
.
getTag
()
+
"\", \"desc\": \""
+
uploadFile
.
getDesc
()
+
"\"}"
);
param
.
put
(
"cataid"
,
uploadFile
.
getCataid
());
param
.
put
(
"watermark"
,
uploadFile
.
getWatermark
());
if
(
StringUtil
.
isNotBlank
(
uploadFile
.
getWatermark
()))
{
param
.
put
(
"watermark"
,
uploadFile
.
getWatermark
());
}
String
result
=
postFile
(
SystemUtil
.
POLYV_UPLOADVIDEO
,
param
,
file
);
try
{
JSONObject
json
=
JSONObject
.
fromObject
(
result
);
...
...
@@ -192,7 +202,8 @@ public final class PolyvUtil {
paramMap
.
put
(
"sign"
,
sign
);
String
url
=
SystemUtil
.
POLYV_DELETEVIDEO
.
replace
(
"{userid}"
,
useid
);
HttpPost
httpPost
=
new
HttpPost
(
url
.
trim
());
RequestConfig
requestConfig
=
RequestConfig
.
custom
().
setConnectTimeout
(
10000
).
setConnectionRequestTimeout
(
3600000
).
setSocketTimeout
(
3600000
).
build
();
RequestConfig
requestConfig
=
RequestConfig
.
custom
().
setConnectTimeout
(
10000
)
.
setConnectionRequestTimeout
(
3600000
).
setSocketTimeout
(
3600000
).
build
();
httpPost
.
setConfig
(
requestConfig
);
List
<
BasicNameValuePair
>
nvps
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
String
,
String
>
entry
:
paramMap
.
entrySet
())
{
...
...
@@ -217,7 +228,8 @@ public final class PolyvUtil {
try
{
String
url
=
SystemUtil
.
POLYV_QUESTION
;
HttpPost
httpPost
=
new
HttpPost
(
url
.
trim
());
RequestConfig
requestConfig
=
RequestConfig
.
custom
().
setConnectTimeout
(
10000
).
setConnectionRequestTimeout
(
3600000
).
setSocketTimeout
(
3600000
).
build
();
RequestConfig
requestConfig
=
RequestConfig
.
custom
().
setConnectTimeout
(
10000
)
.
setConnectionRequestTimeout
(
3600000
).
setSocketTimeout
(
3600000
).
build
();
httpPost
.
setConfig
(
requestConfig
);
JSONArray
choices
=
new
JSONArray
();
for
(
String
value
:
question
.
getAnswerList
())
{
...
...
@@ -284,7 +296,8 @@ public final class PolyvUtil {
CloseableHttpClient
closeableHttpClient
=
HttpClientBuilder
.
create
().
build
();
try
{
HttpPost
httpPost
=
new
HttpPost
(
url
.
trim
());
RequestConfig
requestConfig
=
RequestConfig
.
custom
().
setConnectTimeout
(
10000
).
setConnectionRequestTimeout
(
3600000
).
setSocketTimeout
(
3600000
).
build
();
RequestConfig
requestConfig
=
RequestConfig
.
custom
().
setConnectTimeout
(
10000
)
.
setConnectionRequestTimeout
(
3600000
).
setSocketTimeout
(
3600000
).
build
();
httpPost
.
setConfig
(
requestConfig
);
List
<
NameValuePair
>
list
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
String
,
Object
>
m
:
param
.
entrySet
())
{
...
...
@@ -308,7 +321,8 @@ public final class PolyvUtil {
CloseableHttpClient
closeableHttpClient
=
HttpClientBuilder
.
create
().
build
();
try
{
HttpPost
httpPost
=
new
HttpPost
(
url
.
trim
());
httpPost
.
setConfig
(
RequestConfig
.
custom
().
setConnectTimeout
(
10000
).
setConnectionRequestTimeout
(
3600000
).
setSocketTimeout
(
3600000
).
build
());
httpPost
.
setConfig
(
RequestConfig
.
custom
().
setConnectTimeout
(
10000
).
setConnectionRequestTimeout
(
3600000
)
.
setSocketTimeout
(
3600000
).
build
());
MultipartEntityBuilder
entity
=
MultipartEntityBuilder
.
create
();
entity
.
addPart
(
"Filedata"
,
new
FileBody
(
file
));
ContentType
contentType
=
ContentType
.
create
(
"text/plain"
,
Charset
.
forName
(
CHARSET_UTF_8
));
...
...
@@ -318,7 +332,7 @@ public final class PolyvUtil {
httpPost
.
setEntity
(
entity
.
build
());
return
EntityUtils
.
toString
(
closeableHttpClient
.
execute
(
httpPost
).
getEntity
(),
CHARSET_UTF_8
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
logger
.
error
(
"上传到保利威视失败,url={},param={}"
,
url
,
param
,
e
);
}
finally
{
try
{
closeableHttpClient
.
close
();
...
...
roncoo-education-web-boss/pom.xml
浏览文件 @
86432513
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.roncoo
</groupId>
<artifactId>
roncoo-education
</artifactId>
<version>
2.0.0-RELEASE
</version>
<version>
3.0.0-SNAPSHOT
</version>
</parent>
<artifactId>
roncoo-education-web-boss
</artifactId>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录