Browse Source

feat(course): 新增企微用户绑定课程查询接口

- 添加 qwcourseList 接口用于查询课程列表- 根据配置决定是否按用户ID查询课程
- 添加 qwvideoList 接口用于查询视频列表- 支持企微用户绑定课程功能的数据获取
xw 1 week ago
parent
commit
1ee8d22c88

+ 27 - 0
fs-company/src/main/java/com/fs/company/controller/course/FsCourseRedPacketLogController.java

@@ -252,4 +252,31 @@ public class FsCourseRedPacketLogController extends BaseController
         List<OptionsVO> optionsVOS = fsUserCourseVideoMapper.selectVideoListByPeriodId(id);
         return R.ok().put("list", optionsVOS);
     }
+
+    /**
+     * 查询课程列表(企微用户绑定课程)
+     */
+    @GetMapping("/qwcourseList")
+    public R qwcourseList()
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long userId = loginUser.getUser().getUserId();
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+        List<OptionsVO> optionsVOS;
+        if (ObjectUtil.isNotEmpty(config.getIsBound())&&config.getIsBound()){
+            optionsVOS = fsUserCourseMapper.selectFsUserCourseAllListByUserId(userId);
+        }else{
+            optionsVOS = fsUserCourseMapper.selectFsUserCourseAllList();
+        }
+        return R.ok().put("list", optionsVOS);
+    }
+
+
+    @GetMapping(value = "/qwvideoList/{id}")
+    public R qwvideoList(@PathVariable("id") Long id)
+    {
+        List<OptionsVO> optionsVOS = fsUserCourseVideoMapper.selectFsUserCourseVodeAllList(id);
+        return R.ok().put("list", optionsVOS);
+    }
 }