diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/pom.xml b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/pom.xml
new file mode 100644
index 00000000..c85e37c7
--- /dev/null
+++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/pom.xml
@@ -0,0 +1,36 @@
+
+ 4.0.0
+
+ org.jeecgframework.boot
+ jeecg-boot-module
+ 3.8.2
+
+
+ jeecg-module-aiol
+ jar
+
+ jeecg-module-aiol
+ http://maven.apache.org
+
+
+ UTF-8
+
+
+
+
+ org.jeecgframework.boot
+ jeecg-boot-base-core
+
+
+
+ org.jeecgframework.boot
+ jeecg-system-local-api
+
+
+
+ org.jeecgframework.boot
+ jeecg-system-biz
+
+
+
diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/constant/EntityLinkConst.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/constant/EntityLinkConst.java
new file mode 100644
index 00000000..14b7205f
--- /dev/null
+++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/constant/EntityLinkConst.java
@@ -0,0 +1,51 @@
+package org.jeecg.modules.aiol.constant;
+
+/**
+ * entity_link 表类型常量定义
+ * source_type:主体类型
+ * target_type:内容类型
+ */
+public final class EntityLinkConst {
+
+ private EntityLinkConst() {}
+
+ /** 主体类型 */
+ public static final class SourceType {
+ private SourceType() {}
+ // 课程
+ public static final String COURSE = "course";
+ // 课程分类
+ public static final String COURSE_CATEGORY = "course_category";
+ // 课程章节
+ public static final String COURSE_SECTION = "course_section";
+ // 专题(字典/专题)
+ public static final String SUBJECT = "subject";
+ // 活动
+ public static final String ACTIVITY = "activity";
+ }
+
+ /** 内容类型 */
+ 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";
+ // 题库
+ public static final String REPO = "repo";
+ }
+
+ /** 资源类型 0:视频,1:图片,2:文档 */
+ public static final class ResourceType {
+ private ResourceType() {}
+ public static final int VIDEO = 0;
+ public static final int IMAGE = 1;
+ public static final int DOCUMENT = 2;
+ }
+}
+
+
diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolCommentController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolCommentController.java
new file mode 100644
index 00000000..983cdc37
--- /dev/null
+++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolCommentController.java
@@ -0,0 +1,182 @@
+package org.jeecg.modules.aiol.controller;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.query.QueryRuleEnum;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.aiol.entity.AiolComment;
+import org.jeecg.modules.aiol.service.IAiolCommentService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+ /**
+ * @Description: 评论
+ * @Author: jeecg-boot
+ * @Date: 2025-08-31
+ * @Version: V1.0
+ */
+@Tag(name="评论")
+@RestController
+@RequestMapping("/aiol/aiolComment")
+@Slf4j
+public class AiolCommentController extends JeecgController {
+ @Autowired
+ private IAiolCommentService aiolCommentService;
+
+ /**
+ * 分页列表查询
+ *
+ * @param aiolComment
+ * @param pageNo
+ * @param pageSize
+ * @param req
+ * @return
+ */
+ //@AutoLog(value = "评论-分页列表查询")
+ @Operation(summary="评论-分页列表查询")
+ @GetMapping(value = "/list")
+ public Result> queryPageList(AiolComment aiolComment,
+ @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+ @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+ HttpServletRequest req) {
+
+
+ QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(aiolComment, req.getParameterMap());
+ Page page = new Page(pageNo, pageSize);
+ IPage pageList = aiolCommentService.page(page, queryWrapper);
+ return Result.OK(pageList);
+ }
+
+ /**
+ * 添加
+ *
+ * @param aiolComment
+ * @return
+ */
+ @AutoLog(value = "评论-添加")
+ @Operation(summary="评论-添加")
+ @RequiresPermissions("aiol:aiol_comment:add")
+ @PostMapping(value = "/add")
+ public Result add(@RequestBody AiolComment aiolComment) {
+ aiolCommentService.save(aiolComment);
+
+ return Result.OK("添加成功!");
+ }
+
+ /**
+ * 编辑
+ *
+ * @param aiolComment
+ * @return
+ */
+ @AutoLog(value = "评论-编辑")
+ @Operation(summary="评论-编辑")
+ @RequiresPermissions("aiol:aiol_comment:edit")
+ @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+ public Result edit(@RequestBody AiolComment aiolComment) {
+ aiolCommentService.updateById(aiolComment);
+ return Result.OK("编辑成功!");
+ }
+
+ /**
+ * 通过id删除
+ *
+ * @param id
+ * @return
+ */
+ @AutoLog(value = "评论-通过id删除")
+ @Operation(summary="评论-通过id删除")
+ @RequiresPermissions("aiol:aiol_comment:delete")
+ @DeleteMapping(value = "/delete")
+ public Result delete(@RequestParam(name="id",required=true) String id) {
+ aiolCommentService.removeById(id);
+ return Result.OK("删除成功!");
+ }
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return
+ */
+ @AutoLog(value = "评论-批量删除")
+ @Operation(summary="评论-批量删除")
+ @RequiresPermissions("aiol:aiol_comment:deleteBatch")
+ @DeleteMapping(value = "/deleteBatch")
+ public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+ this.aiolCommentService.removeByIds(Arrays.asList(ids.split(",")));
+ return Result.OK("批量删除成功!");
+ }
+
+ /**
+ * 通过id查询
+ *
+ * @param id
+ * @return
+ */
+ //@AutoLog(value = "评论-通过id查询")
+ @Operation(summary="评论-通过id查询")
+ @GetMapping(value = "/queryById")
+ public Result queryById(@RequestParam(name="id",required=true) String id) {
+ AiolComment aiolComment = aiolCommentService.getById(id);
+ if(aiolComment==null) {
+ return Result.error("未找到对应数据");
+ }
+ return Result.OK(aiolComment);
+ }
+
+ /**
+ * 导出excel
+ *
+ * @param request
+ * @param aiolComment
+ */
+ @RequiresPermissions("aiol:aiol_comment:exportXls")
+ @RequestMapping(value = "/exportXls")
+ public ModelAndView exportXls(HttpServletRequest request, AiolComment aiolComment) {
+ return super.exportXls(request, aiolComment, AiolComment.class, "评论");
+ }
+
+ /**
+ * 通过excel导入数据
+ *
+ * @param request
+ * @param response
+ * @return
+ */
+ @RequiresPermissions("aiol:aiol_comment:importExcel")
+ @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+ public Result> importExcel(HttpServletRequest request, HttpServletResponse response) {
+ return super.importExcel(request, response, AiolComment.class);
+ }
+
+}
diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolCourseCategoryController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolCourseCategoryController.java
new file mode 100644
index 00000000..1ff03d62
--- /dev/null
+++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolCourseCategoryController.java
@@ -0,0 +1,182 @@
+package org.jeecg.modules.aiol.controller;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.query.QueryRuleEnum;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.aiol.entity.AiolCourseCategory;
+import org.jeecg.modules.aiol.service.IAiolCourseCategoryService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+ /**
+ * @Description: 课程分类
+ * @Author: jeecg-boot
+ * @Date: 2025-08-31
+ * @Version: V1.0
+ */
+@Tag(name="课程分类")
+@RestController
+@RequestMapping("/aiol/aiolCourseCategory")
+@Slf4j
+public class AiolCourseCategoryController extends JeecgController {
+ @Autowired
+ private IAiolCourseCategoryService aiolCourseCategoryService;
+
+ /**
+ * 分页列表查询
+ *
+ * @param aiolCourseCategory
+ * @param pageNo
+ * @param pageSize
+ * @param req
+ * @return
+ */
+ //@AutoLog(value = "课程分类-分页列表查询")
+ @Operation(summary="课程分类-分页列表查询")
+ @GetMapping(value = "/list")
+ public Result> queryPageList(AiolCourseCategory aiolCourseCategory,
+ @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+ @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+ HttpServletRequest req) {
+
+
+ QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(aiolCourseCategory, req.getParameterMap());
+ Page page = new Page(pageNo, pageSize);
+ IPage pageList = aiolCourseCategoryService.page(page, queryWrapper);
+ return Result.OK(pageList);
+ }
+
+ /**
+ * 添加
+ *
+ * @param aiolCourseCategory
+ * @return
+ */
+ @AutoLog(value = "课程分类-添加")
+ @Operation(summary="课程分类-添加")
+ @RequiresPermissions("aiol:aiol_course_category:add")
+ @PostMapping(value = "/add")
+ public Result add(@RequestBody AiolCourseCategory aiolCourseCategory) {
+ aiolCourseCategoryService.save(aiolCourseCategory);
+
+ return Result.OK("添加成功!");
+ }
+
+ /**
+ * 编辑
+ *
+ * @param aiolCourseCategory
+ * @return
+ */
+ @AutoLog(value = "课程分类-编辑")
+ @Operation(summary="课程分类-编辑")
+ @RequiresPermissions("aiol:aiol_course_category:edit")
+ @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+ public Result edit(@RequestBody AiolCourseCategory aiolCourseCategory) {
+ aiolCourseCategoryService.updateById(aiolCourseCategory);
+ return Result.OK("编辑成功!");
+ }
+
+ /**
+ * 通过id删除
+ *
+ * @param id
+ * @return
+ */
+ @AutoLog(value = "课程分类-通过id删除")
+ @Operation(summary="课程分类-通过id删除")
+ @RequiresPermissions("aiol:aiol_course_category:delete")
+ @DeleteMapping(value = "/delete")
+ public Result delete(@RequestParam(name="id",required=true) String id) {
+ aiolCourseCategoryService.removeById(id);
+ return Result.OK("删除成功!");
+ }
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return
+ */
+ @AutoLog(value = "课程分类-批量删除")
+ @Operation(summary="课程分类-批量删除")
+ @RequiresPermissions("aiol:aiol_course_category:deleteBatch")
+ @DeleteMapping(value = "/deleteBatch")
+ public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+ this.aiolCourseCategoryService.removeByIds(Arrays.asList(ids.split(",")));
+ return Result.OK("批量删除成功!");
+ }
+
+ /**
+ * 通过id查询
+ *
+ * @param id
+ * @return
+ */
+ //@AutoLog(value = "课程分类-通过id查询")
+ @Operation(summary="课程分类-通过id查询")
+ @GetMapping(value = "/queryById")
+ public Result queryById(@RequestParam(name="id",required=true) String id) {
+ AiolCourseCategory aiolCourseCategory = aiolCourseCategoryService.getById(id);
+ if(aiolCourseCategory==null) {
+ return Result.error("未找到对应数据");
+ }
+ return Result.OK(aiolCourseCategory);
+ }
+
+ /**
+ * 导出excel
+ *
+ * @param request
+ * @param aiolCourseCategory
+ */
+ @RequiresPermissions("aiol:aiol_course_category:exportXls")
+ @RequestMapping(value = "/exportXls")
+ public ModelAndView exportXls(HttpServletRequest request, AiolCourseCategory aiolCourseCategory) {
+ return super.exportXls(request, aiolCourseCategory, AiolCourseCategory.class, "课程分类");
+ }
+
+ /**
+ * 通过excel导入数据
+ *
+ * @param request
+ * @param response
+ * @return
+ */
+ @RequiresPermissions("aiol:aiol_course_category:importExcel")
+ @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+ public Result> importExcel(HttpServletRequest request, HttpServletResponse response) {
+ return super.importExcel(request, response, AiolCourseCategory.class);
+ }
+
+}
diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolCourseController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolCourseController.java
new file mode 100644
index 00000000..ed2fd762
--- /dev/null
+++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolCourseController.java
@@ -0,0 +1,412 @@
+package org.jeecg.modules.aiol.controller;
+
+import java.util.*;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.system.api.ISysBaseAPI;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.query.QueryRuleEnum;
+import org.jeecg.common.system.util.JwtUtil;
+import org.jeecg.common.system.vo.DictModel;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.config.shiro.IgnoreAuth;
+import org.jeecg.modules.aiol.dto.CourseWithTeacherInfo;
+import org.jeecg.modules.aiol.dto.TeacherInfo;
+import org.jeecg.modules.aiol.entity.*;
+import org.jeecg.modules.aiol.service.IAiolCourseService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+
+/**
+ * @Description: 课程
+ * @Author: jeecg-boot
+ * @Date: 2025-08-31
+ * @Version: V1.0
+ */
+@Tag(name = "课程")
+@RestController
+@RequestMapping("/aiol/aiolCourse")
+@Slf4j
+public class AiolCourseController extends JeecgController {
+ @Autowired
+ private IAiolCourseService aiolCourseService;
+
+ /**
+ * 分页列表查询
+ *
+ * @param aiolCourse
+ * @param pageNo
+ * @param pageSize
+ * @param req
+ * @return
+ */
+ //@AutoLog(value = "课程-分页列表查询")
+ @Operation(summary = "课程-分页列表查询")
+ @GetMapping(value = "/list")
+ public Result> queryPageList(AiolCourse aiolCourse,
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+ HttpServletRequest req) {
+
+
+ QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(aiolCourse, req.getParameterMap());
+ Page page = new Page(pageNo, pageSize);
+ IPage pageList = aiolCourseService.page(page, queryWrapper);
+ return Result.OK(pageList);
+ }
+
+ /**
+ * 添加
+ *
+ * @param aiolCourse
+ * @return
+ */
+ @AutoLog(value = "课程-添加")
+ @Operation(summary = "课程-添加")
+ @RequiresPermissions("aiol:aiol_course:add")
+ @PostMapping(value = "/add")
+ public Result add(@RequestBody AiolCourse aiolCourse) {
+ aiolCourseService.save(aiolCourse);
+
+ return Result.OK("添加成功!");
+ }
+
+ /**
+ * 编辑
+ *
+ * @param aiolCourse
+ * @return
+ */
+ @AutoLog(value = "课程-编辑")
+ @Operation(summary = "课程-编辑")
+ @RequiresPermissions("aiol:aiol_course:edit")
+ @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
+ public Result edit(@RequestBody AiolCourse aiolCourse) {
+ aiolCourseService.updateById(aiolCourse);
+ return Result.OK("编辑成功!");
+ }
+
+ /**
+ * 通过id删除
+ *
+ * @param id
+ * @return
+ */
+ @AutoLog(value = "课程-通过id删除")
+ @Operation(summary = "课程-通过id删除")
+ @RequiresPermissions("aiol:aiol_course:delete")
+ @DeleteMapping(value = "/delete")
+ public Result delete(@RequestParam(name = "id", required = true) String id) {
+ aiolCourseService.removeById(id);
+ return Result.OK("删除成功!");
+ }
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return
+ */
+ @AutoLog(value = "课程-批量删除")
+ @Operation(summary = "课程-批量删除")
+ @RequiresPermissions("aiol:aiol_course:deleteBatch")
+ @DeleteMapping(value = "/deleteBatch")
+ public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+ this.aiolCourseService.removeByIds(Arrays.asList(ids.split(",")));
+ return Result.OK("批量删除成功!");
+ }
+
+ /**
+ * 通过id查询
+ *
+ * @param id
+ * @return
+ */
+ //@AutoLog(value = "课程-通过id查询")
+ @Operation(summary = "课程-通过id查询")
+ @GetMapping(value = "/queryById")
+ public Result queryById(@RequestParam(name = "id", required = true) String id) {
+ AiolCourse aiolCourse = aiolCourseService.getById(id);
+ if (aiolCourse == null) {
+ return Result.error("未找到对应数据");
+ }
+ return Result.OK(aiolCourse);
+ }
+
+ /**
+ * 导出excel
+ *
+ * @param request
+ * @param aiolCourse
+ */
+ @RequiresPermissions("aiol:aiol_course:exportXls")
+ @RequestMapping(value = "/exportXls")
+ public ModelAndView exportXls(HttpServletRequest request, AiolCourse aiolCourse) {
+ return super.exportXls(request, aiolCourse, AiolCourse.class, "课程");
+ }
+
+ /**
+ * 通过excel导入数据
+ *
+ * @param request
+ * @param response
+ * @return
+ */
+ @RequiresPermissions("aiol:aiol_course:importExcel")
+ @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+ public Result> importExcel(HttpServletRequest request, HttpServletResponse response) {
+ return super.importExcel(request, response, AiolCourse.class);
+ }
+
+ @Autowired
+ private ISysBaseAPI sysBaseApi;
+
+ @GetMapping("/query_list")
+ @Operation(summary = "学员端-查询课程列表", description = "可根据分类、难度、专题进行检索,三个参数可任意传递其中之一、之二或全部,每个参数可传递多个值,用英文逗号分割,不传参或传递all则查询所有课程,携带讲师信息")
+ @IgnoreAuth
+ public Result> queryCourseList(
+ @RequestParam(value = "categoryId", required = false) String categoryId,
+ @RequestParam(value = "difficulty", required = false) String difficulty,
+ @RequestParam(value = "subject", required = false) String topic,
+ @RequestParam(value = "sort", required = false) String sort) {
+ List list = aiolCourseService.getCourseList(categoryId, difficulty, topic);
+ if (sort != null) {
+ switch (sort) {
+ case "hottest":
+ list = list.stream()
+ .sorted(Comparator.comparing(AiolCourse::getEnrollCount, Comparator.nullsLast(Integer::compareTo)).reversed())
+ .collect(Collectors.toList());
+ break;
+ case "latest":
+ list = list.stream()
+ .sorted(Comparator.comparing(AiolCourse::getCreateTime, Comparator.nullsLast(java.util.Date::compareTo)).reversed())
+ .collect(Collectors.toList());
+ break;
+ case "recommend":
+ default:
+ // 不处理,直接返回
+ break;
+ }
+ }
+ return Result.OK(list);
+ }
+
+ @GetMapping("/detail")
+ @Operation(summary = "查询课程详情", description = "根据课程ID查询课程详情")
+ @IgnoreAuth
+ public Result queryCourseDetail(@RequestParam(value = "id") String id) {
+ AiolCourse course = aiolCourseService.getById(id);
+ return Result.OK(course);
+ }
+
+ @GetMapping("/subject/list")
+ @Operation(summary = "查询课程专题列表", description = "返回字典值")
+ @IgnoreAuth
+ public Result> querySubjectList() {
+ List list = sysBaseApi.getDictItems("course_subject");
+ List simple = list.stream()
+ .map(d -> new LabelValue(d.getValue(), d.getLabel() != null ? d.getLabel() : d.getText()))
+ .collect(Collectors.toList());
+ return Result.OK(simple);
+ }
+
+ /**
+ * 仅返回 value、label 的简单对象
+ */
+ private static record LabelValue(String value, String label) {
+ }
+
+ @GetMapping("/difficulty/list")
+ @Operation(summary = "查询课程难度列表", description = "返回字典值")
+ @IgnoreAuth
+ public Result> queryDifficultyList() {
+ List list = sysBaseApi.getDictItems("course_difficulty");
+ List simple = list.stream()
+ .map(d -> new LabelValue(d.getValue(), d.getLabel() != null ? d.getLabel() : d.getText()))
+ .collect(Collectors.toList());
+ return Result.OK(simple);
+ }
+
+ @GetMapping("/category/list")
+ @Operation(summary = "查询课程分类列表", description = "根据sortOrder降序排序")
+ @IgnoreAuth
+ public Result> queryCategoryList() {
+ List list = aiolCourseService.getCourseCategoryList();
+ return Result.OK(list);
+ }
+
+ @GetMapping("/{courseId}/section")
+ @Operation(summary = "查询课程章节列表", description = "根据课程id查询章节列表,type表示章节类型:0=视频、1=资料、2=考试、3=作业;level表示章节层级,0=一级章节、1=二级章节,通过parentId记录父子关系,前端需自行组织树形结构;当前层级的顺序通过sortOrder排序")
+ @IgnoreAuth
+ public Result> querySectionList(@PathVariable(value = "courseId") String courseId) {
+ List list = aiolCourseService.getCourseSectionList(courseId);
+ return Result.OK(list);
+ }
+
+ @GetMapping("/{courseId}/section_video/{sectionId}")
+ @Operation(summary = "查询视频章节详情", description = "该接口需要携带用户登录token。根据章节id查询章节详情,不同类型的章节,返回的内容不同")
+ public Result> querySectionDetail(@PathVariable(value = "courseId") String courseId, @PathVariable(value = "sectionId") String sectionId) {
+ // TODO GC 获取用户id,根据courseId判断当前用户是否报名课程,只有已报名的课程才能查看章节详情
+
+ List list = aiolCourseService.getCourseSectionDetail(0, sectionId, AiolResource.class);
+ return Result.OK(list);
+ }
+
+ @GetMapping("/{courseId}/section_document/{sectionId}")
+ @Operation(summary = "查询文档章节详情", description = "该接口需要携带用户登录token。根据章节id查询章节详情,不同类型的章节,返回的内容不同")
+ public Result> querySectionDocumentDetail(@PathVariable(value = "courseId") String courseId, @PathVariable(value = "sectionId") String sectionId) {
+ // TODO GC 获取用户id,根据courseId判断当前用户是否报名课程,只有已报名的课程才能查看章节详情
+
+ List list = aiolCourseService.getCourseSectionDetail(1, sectionId, AiolResource.class);
+ return Result.OK(list);
+ }
+
+ @GetMapping("/{courseId}/section_homework/{sectionId}")
+ @Operation(summary = "查询作业章节详情", description = "该接口需要携带用户登录token。根据章节id查询章节详情,不同类型的章节,返回的内容不同")
+ public Result> querySectionHomeworkDetail(@PathVariable(value = "courseId") String courseId, @PathVariable(value = "sectionId") String sectionId) {
+ // TODO GC 获取用户id,根据courseId判断当前用户是否报名课程,只有已报名的课程才能查看章节详情
+
+ List list = aiolCourseService.getCourseSectionDetail(3, sectionId, AiolHomework.class);
+ return Result.OK(list);
+ }
+
+ @GetMapping("/{courseId}/teachers")
+ @Operation(summary = "查询课程的授课教师")
+ @IgnoreAuth
+ public Result> queryTeacherList(@PathVariable(value = "courseId") String courseId) {
+ List list = aiolCourseService.getCourseTeacherList(courseId);
+ return Result.OK(list);
+ }
+
+ @PostMapping("/{courseId}/enroll")
+ @Operation(summary = "报名课程", description = "该接口需要携带用户登录token。根据课程id报名课程。返回值为报名结果,报名成功返回success")
+ public Result enrollCourse(@PathVariable(value = "courseId") String courseId, HttpServletRequest request, HttpServletResponse response) {
+ String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN);
+ String username = JwtUtil.getUsername(token);
+ LoginUser sysUser = sysBaseApi.getUserByName(username);
+ String result = aiolCourseService.enrollCourse(courseId, sysUser.getId());
+ return Result.OK(result);
+ }
+
+ @GetMapping("/{courseId}/is_enrolled")
+ @Operation(summary = "查询课程是否已报名", description = "该接口需要携带用户登录token。根据课程id查询课程是否已报名。判断返回值的result是否为true")
+ public Result isEnrolled(@PathVariable(value = "courseId") String courseId, HttpServletRequest request, HttpServletResponse response) {
+ String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN);
+ String username = JwtUtil.getUsername(token);
+ LoginUser sysUser = sysBaseApi.getUserByName(username);
+
+ boolean isEnrolled = aiolCourseService.isEnrolled(courseId, sysUser.getId());
+ return Result.OK(isEnrolled);
+ }
+
+ @GetMapping("/teacher_list")
+ @Operation(summary = "查询当前教师创建的课程")
+ public Result> queryTeacherCourseList(
+ @RequestParam(value = "keyword", required = false) String keyword,
+ @RequestParam(value = "status", required = false) Integer status,
+ HttpServletRequest request, HttpServletResponse response) {
+ String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN);
+ String username = JwtUtil.getUsername(token);
+ LoginUser sysUser = sysBaseApi.getUserByName(username);
+
+ QueryWrapper wrapper = new QueryWrapper().eq("create_by", sysUser.getUsername());
+
+ // 课程名关键词检索
+ if (keyword != null && !keyword.trim().isEmpty()) {
+ wrapper.like("name", keyword.trim());
+ }
+
+ // 状态检索:0 未开始;1进行中;2已结束
+ if (status != null) {
+ wrapper.eq("status", status);
+ }
+
+ List list = aiolCourseService.list(wrapper);
+ return Result.OK(list);
+ }
+
+ @PostMapping("/{courseId}/add_students")
+ @Operation(summary = "批量导入学生", description = "请求体为JSON格式,包含ids字段,ids为逗号分隔的学生ID字符串")
+ public Result