| | |
| | | // 根据传入的userid创建查询条件 |
| | | LambdaQueryWrapper<CoursesDO> queryWrapper = new LambdaQueryWrapper<CoursesDO>() |
| | | .eq(CoursesDO::getCreator, Long.valueOf(userid)); |
| | | |
| | | |
| | | // 使用带有查询条件的分页查询 |
| | | PageResult<CoursesDO> pageResult = coursesMapper.selectPage(pageReqVO, queryWrapper); |
| | | |
| | |
| | | private void refreshCourseCache(String courseId) { |
| | | // 获取课程完整信息 |
| | | AppCoursesUpdateReqVO courseInfo = getCourses(Long.parseLong(courseId)); |
| | | |
| | | |
| | | if (courseInfo == null || CollectionUtil.isEmpty(courseInfo.getScenes())) { |
| | | log.error("课程信息不存在或场景为空,courseId: {}", courseId); |
| | | return; |
| | | } |
| | | |
| | | |
| | | // 构建场景缓存数据 |
| | | Map<String, Map<String, String>> scenesMap = new HashMap<>(); |
| | | courseInfo.getScenes().forEach(scene -> { |
| | |
| | | sceneData.put("background", scene.getBackground().getSrc()); |
| | | scenesMap.put(String.valueOf(scene.getOrderNo()), sceneData); |
| | | }); |
| | | |
| | | |
| | | // 序列化并存储场景数据 |
| | | String sceneRedisKey = COURSE_SCENE_TEXT_KEY + courseId; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |