feat: 🎸 查询章节详情 修改

This commit is contained in:
GoCo 2025-09-23 13:58:02 +08:00
parent ab75199f17
commit d7944a0c64
2 changed files with 28 additions and 3 deletions

View File

@ -27,11 +27,11 @@ public final class EntityLinkConst {
/** 内容类型 */
public static final class TargetType {
private TargetType() {}
// 资源对应资源表
// 资源对应资源表包括视频和文档
public static final String RESOURCE = "resource";
// 作业对应作业表
public static final String HOMEWORK = "homework";
// 考试对应考试表
// 考试对应考试表包括考试和练习
public static final String EXAM = "exam";
// 课程
public static final String COURSE = "course";

View File

@ -82,6 +82,12 @@ public class AiolCourseServiceImpl extends ServiceImpl<AiolCourseMapper, AiolCou
@Autowired
private AiolLearnProgressMapper learnProgressMapper;
@Autowired
private AiolExamMapper examMapper;
@Autowired
private AiolDiscussionMapper discussionMapper;
@Autowired
private RedisUtil redisUtil;
@ -135,6 +141,14 @@ public class AiolCourseServiceImpl extends ServiceImpl<AiolCourseMapper, AiolCou
// 作业章节
targetType = EntityLinkConst.TargetType.HOMEWORK;
break;
case 4:
// 练习章节
targetType = EntityLinkConst.TargetType.EXAM;
break;
case 5:
// 讨论章节
targetType = EntityLinkConst.TargetType.DISCUSSION;
break;
default:
break;
}
@ -157,12 +171,23 @@ public class AiolCourseServiceImpl extends ServiceImpl<AiolCourseMapper, AiolCou
result.add(clazz.cast(resourceMapper.selectById(targetId)));
break;
case 2:
// TODO 考试章节
// 考试章节
result.add(clazz.cast(examMapper.selectById(targetId)));
break;
case 3:
// 作业章节
result.add(clazz.cast(homeworkMapper.selectById(targetId)));
break;
case 4:
// 练习章节
result.add(clazz.cast(examMapper.selectById(targetId)));
break;
case 5:
// 讨论章节
result.add(clazz.cast(discussionMapper.selectById(targetId)));
break;
default:
break;
}
}