添加视频暂存点

This commit is contained in:
zhaolongfei
2024-06-19 13:55:54 +08:00
parent 8567fa9ecc
commit c6a785bb4f
2 changed files with 8 additions and 3 deletions

View File

@@ -144,6 +144,7 @@ public class CourseContentServiceImpl implements ICourseContentService {
}
@Override
@Transactional
public void updateProcessVideo(String id, String courseId, Float progressVideo) {
// 处理 processVideo 为 null 的情况
if (progressVideo == null) {

View File

@@ -529,7 +529,7 @@ public class StudyCourseApi extends ApiBaseController{
* @return
*/
@PostMapping("/study-video-time")
public JsonResponse<Boolean> study(String itemId,Integer videoTime,String contentId , String courseId,Float processVideo){
public JsonResponse<Boolean> study(String itemId,Integer videoTime,String contentId , String courseId,Float progressVideo){
if(StringUtils.isBlank(itemId)){
return error("参数错误");
@@ -537,11 +537,15 @@ public class StudyCourseApi extends ApiBaseController{
if(videoTime==null){
return error("无时间点");
}
if (progressVideo == null){
return error("无暂存时间点");
}
//检查是否已存在
try {
studyService.updateLastTime(itemId,videoTime,getCurrent().getAccountId());
studyService.updateLastTime(itemId,videoTime, getCurrent().getAccountId());
if (contentId != null && courseId != null){
contentService.updateProcessVideo(contentId, courseId, processVideo);
contentService.updateProcessVideo(contentId, courseId, progressVideo);
}
return success(true);
}catch(Exception e) {