zx 1 hete
szülő
commit
361ec6db43

+ 1 - 1
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -536,7 +536,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
                 if (log==null){
                     createWatchLog(param);
                 }
-                return R.error(567,"群聊通用链接").put("qwExternalId", matchedContact.getId());
+                return R.error(567,"群聊通用链接").put("qwExternalId", contact.getId());
             }
         }
         //一个都找不到

+ 1 - 1
fs-service/src/main/resources/application-common.yml

@@ -36,7 +36,7 @@ server:
 # 日志配置
 logging:
   level:
-    com.fs: debug
+    com.fs: info
     org.springframework: warn
 
 express:

+ 18 - 2
fs-user-app/src/main/java/com/fs/app/controller/course/CourseFsUserController.java

@@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.Valid;
+import java.util.concurrent.TimeUnit;
 
 @Api("会员-看课接口")
 @RestController
@@ -67,8 +68,23 @@ public class CourseFsUserController extends AppBaseController {
     @GetMapping("/getH5CourseByVideoId")
     public R getCourseByVideoId(@RequestParam("videoId") Long videoId)
     {
-        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);
     }
 
     @Login

+ 18 - 2
fs-user-app/src/main/java/com/fs/app/controller/course/CourseQwController.java

@@ -35,6 +35,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("企微看课接口")
 @RestController
@@ -96,8 +97,23 @@ public class CourseQwController 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);
     }
 
     @Login

+ 18 - 2
fs-user-app/src/main/java/com/fs/app/controller/store/CourseH5ScrmController.java

@@ -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课程详情")

+ 18 - 2
fs-user-app/src/main/java/com/fs/app/controller/store/CourseScrmController.java

@@ -36,6 +36,7 @@ import springfox.documentation.spring.web.readers.operation.CachingOperationName
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.*;
+import java.util.concurrent.TimeUnit;
 
 @Api("课堂接口")
 @RestController
@@ -340,8 +341,23 @@ public class CourseScrmController 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);
     }
 
     @Login