|
@@ -405,7 +405,16 @@ public class FsCourseWatchLogServiceImpl extends ServiceImpl<FsCourseWatchLogMap
|
|
|
public Long getFsUserVideoDuration(Long videoId){
|
|
|
//将视频时长也存到redis
|
|
|
String videoRedisKey = "h5wxuser:video:duration:" + videoId;
|
|
|
- Long videoDuration = redisCache.getCacheObject(videoRedisKey);
|
|
|
+ Long videoDuration=0L;
|
|
|
+ try {
|
|
|
+ videoDuration = redisCache.getCacheObject(videoRedisKey);
|
|
|
+ }catch (Exception e){
|
|
|
+ String string = redisCache.getCacheObject(videoRedisKey);
|
|
|
+ videoDuration=Long.parseLong(string);
|
|
|
+ log.error("key中id为S:{}", videoDuration);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
if (videoDuration==null){
|
|
|
FsUserCourseVideo video = courseVideoMapper.selectFsUserCourseVideoByVideoId(videoId);
|
|
|
videoDuration=video.getDuration();
|