|
|
@@ -362,13 +362,26 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- String videoRedisKey1 = "h5user:video:duration:" + fsUserCourseVideo.getVideoId();
|
|
|
- redisCache.setCacheObject(videoRedisKey1, fsUserCourseVideo.getDuration());
|
|
|
- String videoRedisKey2 = "h5wxuser:video:duration:" + fsUserCourseVideo.getVideoId();
|
|
|
- redisCache.setCacheObject(videoRedisKey2, fsUserCourseVideo.getDuration());
|
|
|
+ syncVideoDurationCache(fsUserCourseVideo.getVideoId(), fsUserCourseVideo.getDuration());
|
|
|
return fsUserCourseVideoMapper.updateFsUserCourseVideo(fsUserCourseVideo);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void syncVideoDurationCache(Long videoId, Long duration) {
|
|
|
+ if (videoId == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String videoRedisKey1 = "h5user:video:duration:" + videoId;
|
|
|
+ String videoRedisKey2 = "h5wxuser:video:duration:" + videoId;
|
|
|
+ if (duration == null) {
|
|
|
+ redisCache.deleteObject(videoRedisKey1);
|
|
|
+ redisCache.deleteObject(videoRedisKey2);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ redisCache.setCacheObject(videoRedisKey1, duration);
|
|
|
+ redisCache.setCacheObject(videoRedisKey2, duration);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public int updateFsUserCourseRedPage(FsUserCourseRedPageParam userCourseRedPageParam) {
|
|
|
|
|
|
@@ -3942,6 +3955,12 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
|
|
|
}
|
|
|
List<Long> idList = videoList.stream().map(FsUserCourseVideo::getVideoId).collect(Collectors.toList());
|
|
|
fsUserCourseVideoMapper.updateVideoByVideoUrl(videoUrl, thumbnail, idList, fileName, duration, lineOne, lineTwo);
|
|
|
+ if (duration != null) {
|
|
|
+ Long durationValue = duration.longValue();
|
|
|
+ for (Long videoId : idList) {
|
|
|
+ syncVideoDurationCache(videoId, durationValue);
|
|
|
+ }
|
|
|
+ }
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
@Override
|