|
|
@@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
@Api("h5课堂接口")
|
|
|
@RestController
|
|
|
@@ -56,8 +57,23 @@ public class CourseH5ScrmController extends AppBaseController {
|
|
|
@GetMapping("/getH5CourseByVideoId")
|
|
|
public R getCourseByVideoId(@RequestParam("videoId") Long videoId,HttpServletRequest request)
|
|
|
{
|
|
|
- FsUserCourseVideoH5VO course = courseService.selectFsUserCourseVideoH5VOByVideoId(videoId);
|
|
|
- return R.ok().put("data",course);
|
|
|
+ FsUserCourseVideoH5VO videoH5VO=null;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ videoH5VO=redisCache.getCacheObject("cache:video:"+videoId);
|
|
|
+ if(videoH5VO==null){
|
|
|
+ videoH5VO = courseService.selectFsUserCourseVideoH5VOByVideoId(videoId);
|
|
|
+ redisCache.setCacheObject("cache:video:"+videoId,videoH5VO, 10, TimeUnit.MINUTES);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception e){
|
|
|
+
|
|
|
+ }
|
|
|
+ if(videoH5VO==null){
|
|
|
+ videoH5VO = courseService.selectFsUserCourseVideoH5VOByVideoId(videoId);
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.ok().put("data",videoH5VO);
|
|
|
}
|
|
|
|
|
|
@ApiOperation("h5课程详情")
|