diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/pom.xml b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/pom.xml
index c85e37c7..07cb05af 100644
--- a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/pom.xml
+++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/pom.xml
@@ -32,5 +32,12 @@
org.jeecgframework.boot
jeecg-system-biz
+
+
+
+ ws.schild
+ jave-all-deps
+ 3.5.0
+
diff --git a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/constant/ResourceTypeConst.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/constant/ResourceTypeConst.java
new file mode 100644
index 00000000..59d6491d
--- /dev/null
+++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/constant/ResourceTypeConst.java
@@ -0,0 +1,7 @@
+package org.jeecg.modules.aiol.constant;
+
+public final class ResourceTypeConst {
+ 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/AiolClassController.java b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolClassController.java
index 84c14638..c442b5e6 100644
--- a/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolClassController.java
+++ b/jeecg-boot/jeecg-boot-module/jeecg-module-aiol/src/main/java/org/jeecg/modules/aiol/controller/AiolClassController.java
@@ -480,10 +480,10 @@ public class AiolClassController extends JeecgController> createStudentAndAddToClass(@RequestBody Map body,
HttpServletRequest request) {
@@ -524,17 +524,37 @@ public class AiolClassController extends JeecgController checkWrapper = new QueryWrapper<>();
- checkWrapper.eq("class_id", classId).eq("student_id", created.getId());
- AiolClassStudent exist = aiolClassStudentService.getOne(checkWrapper);
- if (exist == null) {
- AiolClassStudent relation = new AiolClassStudent();
- relation.setClassId(classId);
- relation.setStudentId(created.getId());
- relation.setCreateBy(sysUser.getUsername());
- relation.setCreateTime(new Date());
- aiolClassStudentService.save(relation);
+ // 支持多个班级ID,用逗号分割
+ String[] classIds = classId.split(",");
+ int successCount = 0;
+ int skipCount = 0;
+
+ for (String singleClassId : classIds) {
+ if (singleClassId == null || singleClassId.trim().isEmpty()) {
+ continue;
+ }
+ singleClassId = singleClassId.trim();
+
+ // 检查是否已存在关系,避免重复
+ QueryWrapper checkWrapper = new QueryWrapper<>();
+ checkWrapper.eq("class_id", singleClassId).eq("student_id", created.getId());
+ AiolClassStudent exist = aiolClassStudentService.getOne(checkWrapper);
+
+ if (exist == null) {
+ AiolClassStudent relation = new AiolClassStudent();
+ relation.setClassId(singleClassId);
+ relation.setStudentId(created.getId());
+ relation.setCreateBy(sysUser.getUsername());
+ relation.setCreateTime(new Date());
+ boolean saved = aiolClassStudentService.save(relation);
+ if (saved) {
+ successCount++;
+ log.info("成功将学生 {} 添加到班级 {}", created.getUsername(), singleClassId);
+ }
+ } else {
+ skipCount++;
+ log.info("学生 {} 已在班级 {} 中,跳过", created.getUsername(), singleClassId);
+ }
}
Map resp = new HashMap<>();
@@ -542,6 +562,9 @@ public class AiolClassController extends JeecgController> upload(@RequestParam("file") MultipartFile file, HttpServletRequest request) throws Exception {
- if (file == null || file.isEmpty()) return Result.error("没有找到上传的文件");
- Map qualityUrls = aiolResourceService.uploadHls(file, request);
- return Result.OK(qualityUrls);
+ @PostMapping("/video_upload")
+ @Operation(summary = "课程视频文件上传", description = "课程视频文件上传,创建资源记录并关联到课程")
+ public Result