|
|
@@ -10,6 +10,7 @@ import com.fs.common.core.controller.BaseController;
|
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
|
import com.fs.common.core.domain.model.LoginUser;
|
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
|
+import com.fs.common.core.redis.RedisCache;
|
|
|
import com.fs.common.enums.BusinessType;
|
|
|
import com.fs.common.utils.ServletUtils;
|
|
|
import com.fs.course.config.CourseConfig;
|
|
|
@@ -43,9 +44,10 @@ public class FsVideoResourceController extends BaseController {
|
|
|
|
|
|
private final IFsVideoResourceService fsVideoResourceService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ RedisCache redisCache;
|
|
|
@Autowired
|
|
|
private TokenService tokenService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private ISysConfigService configService;
|
|
|
@Autowired
|
|
|
@@ -53,6 +55,8 @@ public class FsVideoResourceController extends BaseController {
|
|
|
@Autowired
|
|
|
private IFsUserCourseVideoService fsUserCourseVideoService;
|
|
|
|
|
|
+ private final String COURSE_VIDEO_KEY = "h5wxuser:video:duration:";
|
|
|
+
|
|
|
/**
|
|
|
* 查询视频素材库列表
|
|
|
*/
|
|
|
@@ -152,6 +156,12 @@ public class FsVideoResourceController extends BaseController {
|
|
|
c.setThumbnail(fsVideoResource.getThumbnail());//视频课节封面
|
|
|
c.setDuration(fsVideoResource.getDuration().longValue());//视频时长
|
|
|
fsUserCourseVideoService.updateFsUserCourseVideo(c);//更新数据
|
|
|
+
|
|
|
+ //更新缓存视频时长
|
|
|
+ String key = COURSE_VIDEO_KEY + c.getVideoId();
|
|
|
+ if(redisCache.hasKey(key)){
|
|
|
+ redisCache.setCacheObject(key, c.getDuration());
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
}
|