diff --git a/docs/文档说明.md b/docs/文档说明.md
new file mode 100644
index 0000000..876e53d
--- /dev/null
+++ b/docs/文档说明.md
@@ -0,0 +1,36 @@
+## 文档说明
+
+##### 资源接口
+
+ resourcesController 资源上传 uploadFile / 下载 deleteResource / 预览 readFile
+
+用minio 作为资源管理
+
+minio 网址:http://39.106.16.162:9001/
+用户名:minioadmin
+密码:minioadmin
+
+以日期分类 文件类型 文件名前10个(超出10)+yyyymmddhhmmss
+
+yml 配置
+
+```java
+minio:
+ endpoint: http://39.106.16.162:9090 #MinIO服务所在地址
+ bucketName: teaching # 存储桶名称
+ accessKey: minioadmin # 访问的key
+ secretKey: minioadmin # 访问的秘钥
+```
+
+minioutils 工具类
+
+> 逻辑就是,文件上传之后,存入图数据库,返回节点信息 , 删除文件 也得删除文件在图数据库的节点
+
+##### 图数据库
+
+http://39.106.16.162:7474/
+
+用户名 neo4j
+
+密码123456
+
diff --git a/pom.xml b/pom.xml
index 4e9e452..f3f4d71 100644
--- a/pom.xml
+++ b/pom.xml
@@ -227,8 +227,6 @@
commons-lang
2.6
-
-
commons-fileupload
diff --git a/src/main/java/com/teaching/backend/controller/Know/KnowController.java b/src/main/java/com/teaching/backend/controller/Know/KnowController.java
index ee8b95d..9e3bc6f 100644
--- a/src/main/java/com/teaching/backend/controller/Know/KnowController.java
+++ b/src/main/java/com/teaching/backend/controller/Know/KnowController.java
@@ -28,6 +28,20 @@ public class KnowController {
@Autowired
private KnowService knowService;
+ // 添加全部知识点
+ @PostMapping("/addAllKnow")
+ BaseResponse addAllKnow(@RequestParam String courseId){
+ return knowService.addAllKnow(courseId);
+ }
+
+ // 添加知识点与资源的关系
+ @PostMapping("/addRelationship/Withresources")
+ BaseResponse addRelationshipWithresources(@RequestParam Long id,@RequestParam Long resourceId){
+ return knowService.addRelationshipWithresources(id,resourceId);
+ }
+
+ //===================
+
// 添加知识点
@PostMapping("/addKnow")
BaseResponse addKnow(@RequestBody KnowRequest knowRequest){
@@ -110,20 +124,9 @@ public class KnowController {
//获取课程下的所有知识点
@GetMapping("/getAllKnowByCourseId")
- BaseKnowReturn getAllKnowByCourseId(@RequestParam String id){
+ BaseResponse getAllKnowByCourseId(@RequestParam String id){
return knowService.getAllKnowByCourseId(id);
}
- //获取课程下的所有资源
- @GetMapping("/getAllResourcesByCourseId")
- BaseResponse> getAllResourcesByCourseId(@RequestParam String id){
- return knowService.getAllResourcesByCourseId(id);
- }
-
- //获取知识点下二级的所有资源
- @GetMapping("/getSecondResources")
- Set getSecondResources(@RequestParam Long id){
- return knowService.getSecondResources(id);
- }
}
diff --git a/src/main/java/com/teaching/backend/controller/Knowtmp/KnowtmpController.java b/src/main/java/com/teaching/backend/controller/Knowtmp/KnowtmpController.java
index dbb122a..85ab55d 100644
--- a/src/main/java/com/teaching/backend/controller/Knowtmp/KnowtmpController.java
+++ b/src/main/java/com/teaching/backend/controller/Knowtmp/KnowtmpController.java
@@ -50,7 +50,7 @@ public class KnowtmpController {
}
//查询通过chapterId List
@GetMapping("/queryKnow")
- BaseResponse> queryByChapterId(Long chapterId){
+ List queryByChapterId(Long chapterId){
return knowtmpService.queryByChapterId(chapterId);
}
}
diff --git a/src/main/java/com/teaching/backend/controller/courses/CoursesController.java b/src/main/java/com/teaching/backend/controller/courses/CoursesController.java
index 7e14395..adba450 100644
--- a/src/main/java/com/teaching/backend/controller/courses/CoursesController.java
+++ b/src/main/java/com/teaching/backend/controller/courses/CoursesController.java
@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.LinkedHashSet;
+import java.util.List;
import java.util.Map;
/**
@@ -132,8 +133,8 @@ public class CoursesController {
@ApiOperation("查询学生列表")
@PostMapping("/studentList")
- public CommonResult> getStudentList(@RequestParam String userId){
- LinkedHashSet umsStudentList = coursesService.queryStudentList(userId);
+ public CommonResult> getStudentList(@RequestParam String userId){
+ List umsStudentList = coursesService.queryStudentList(userId);
return CommonResult.success(umsStudentList);
}
diff --git a/src/main/java/com/teaching/backend/controller/records/Bf.java b/src/main/java/com/teaching/backend/controller/records/Bf.java
index f0a8d95..ab83b32 100644
--- a/src/main/java/com/teaching/backend/controller/records/Bf.java
+++ b/src/main/java/com/teaching/backend/controller/records/Bf.java
@@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.io.FileInputStream;
import java.io.OutputStream;
-
+import java.util.AbstractCollection;
@RestController
@RequestMapping("/api/bf")
public class Bf {
diff --git a/src/main/java/com/teaching/backend/controller/records/CourseLearningRecordController.java b/src/main/java/com/teaching/backend/controller/records/CourseLearningRecordController.java
index ed7b1b3..32be4d1 100644
--- a/src/main/java/com/teaching/backend/controller/records/CourseLearningRecordController.java
+++ b/src/main/java/com/teaching/backend/controller/records/CourseLearningRecordController.java
@@ -70,4 +70,19 @@ public class CourseLearningRecordController {
}
return CommonResult.success(coursesVOList);
}
+
+ /**
+ * 推荐课程
+ * @return
+ */
+ @ApiOperation("推荐课程")
+ @PostMapping("/recommendCourses")
+ public CommonResult> recommendCourses(@RequestParam String userId) {
+ List coursesVOList = courseLearningRecordService.queryrecommendCourses(userId);
+ if (coursesVOList == null){
+ CommonResult.failed("用户或角色错误");
+ }
+ return CommonResult.success(coursesVOList);
+ }
+
}
diff --git a/src/main/java/com/teaching/backend/controller/records/ResourceLearningRecordController.java b/src/main/java/com/teaching/backend/controller/records/ResourceLearningRecordController.java
index 29a3aca..29b19b9 100644
--- a/src/main/java/com/teaching/backend/controller/records/ResourceLearningRecordController.java
+++ b/src/main/java/com/teaching/backend/controller/records/ResourceLearningRecordController.java
@@ -1,102 +1,103 @@
-//package com.teaching.backend.controller.records;
-//
-//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-//import com.teaching.backend.common.BaseResponse;
-//import com.teaching.backend.common.ResultUtils;
-//import com.teaching.backend.filter.ValidateParams;
-//import com.teaching.backend.mapper.records.ResourceLearningRecordMapper;
-//import com.teaching.backend.model.entity.records.KnowledgeLearningRecord;
-//import com.teaching.backend.model.entity.records.ResourceLearningRecord;
-//import com.teaching.backend.service.impl.records.KnowledgeLearningRecordServiceImpl;
-//import com.teaching.backend.service.impl.records.ResourceLearningRecordServiceImpl;
-//import com.teaching.backend.utils.UploadUtils;
-//import io.swagger.annotations.ApiOperation;
-//import org.springframework.http.MediaType;
-//import org.springframework.web.bind.annotation.*;
-//import org.springframework.web.multipart.MultipartFile;
-//
-//import javax.annotation.Resource;
-//import javax.servlet.http.HttpServletRequest;
-//import javax.servlet.http.HttpServletResponse;
-//import java.io.File;
-//import java.io.IOException;
-//import java.util.List;
-//
-//@RestController
-//@RequestMapping("/api/resourcelearningrecords")
-//public class ResourceLearningRecordController {
-// @Resource
-// private ResourceLearningRecordServiceImpl resourceLearningRecordService;
-// @Resource
-// private ResourceLearningRecordMapper resourceLearningRecordMapper;
-//
-//
-//
-// @ApiOperation("添加资源学习记录")
-//// @ValidateParams({"userId","type","coursesId"})
-// @PostMapping("/saverecords")
-// public BaseResponse saveResourceRecords(@RequestBody ResourceLearningRecord resourceLearningRecord) {
-// return resourceLearningRecordService.saveCoursesRecords(resourceLearningRecord);
-// }
-//
-// /**
-// * 获取当前登录用户的学习资源记录
-// * @param pagenum
-// * @param pagesize
-// * @return
-// */
-// @ApiOperation("根据用户id查询学习记录")
-// @ValidateParams({"userId"})
-// @GetMapping("/page")
-// public BaseResponse getAll(@RequestParam(value = "pagenum", defaultValue = "1") int pagenum,
-// @RequestParam(value = "pagesize", defaultValue = "10") int pagesize,
-// @RequestParam String userId,
-// @RequestParam String courseId,
-// @RequestParam String knowledgeId){
-// return resourceLearningRecordService.getPage(pagenum, pagesize, userId, knowledgeId,courseId);
-//
-// }
-// /**
-// * 根据ids删除
-// * @param ids
-// * @return
-// */
-// @ApiOperation("学习记录删除")
-// @DeleteMapping("/delete")
-// public BaseResponse deleteRecords(@RequestParam List ids){
-// return resourceLearningRecordService.removeResourceRecord(ids);
-// }
-//
-// /**
-// * 统计单个学生学习资源数量
-// * @param userId
-// * @return
-// */
-// @ApiOperation("统计单个学生学习资源数量")
-// @GetMapping("/countresourcenumber")
-// public BaseResponse countResourceNumber(@RequestParam String userId) {
-// return ResultUtils.success(resourceLearningRecordMapper.selectDistinctResourceIdsByUser(userId).size());
-// }
-//
-//
-// @ApiOperation("上传图片")
-// @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
-// public BaseResponse upload(@RequestPart("filedata") MultipartFile filedata) throws IOException {
-// //调用ser
-// System.out.println(filedata.getResource());
-// System.out.println(UploadUtils.saveFileByDirectory(filedata));
-//// File file = filedata.getResource().getFile();
-//// UploadUtils.Chunk(file);
-//// UploadUtils.Merge(file);
-// //源文件
-//// File sourseFile = (File) file;
-// return ResultUtils.success("hello");
-// };
-//
-// @GetMapping("/bf")
-// public BaseResponse bf(@RequestParam String path, File file,HttpServletRequest request, HttpServletResponse response){
-// File sourseFile = new File(path);
-// return ResultUtils.success(path);
-// };
-//
-//}
+package com.teaching.backend.controller.records;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.teaching.backend.common.BaseResponse;
+import com.teaching.backend.common.ResultUtils;
+import com.teaching.backend.filter.ValidateParams;
+import com.teaching.backend.mapper.records.ResourceLearningRecordMapper;
+import com.teaching.backend.model.entity.records.KnowledgeLearningRecord;
+import com.teaching.backend.model.entity.records.ResourceLearningRecord;
+import com.teaching.backend.service.impl.records.KnowledgeLearningRecordServiceImpl;
+import com.teaching.backend.service.impl.records.ResourceLearningRecordServiceImpl;
+import com.teaching.backend.utils.UploadUtils;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+@RestController
+@RequestMapping("/api/resourcelearningrecords")
+public class ResourceLearningRecordController {
+
+ @Resource
+ private ResourceLearningRecordServiceImpl resourceLearningRecordService;
+ @Resource
+ private ResourceLearningRecordMapper resourceLearningRecordMapper;
+
+
+
+ @ApiOperation("添加资源学习记录")
+// @ValidateParams({"userId","type","coursesId"})
+ @PostMapping("/saverecords")
+ public BaseResponse saveResourceRecords(@RequestBody ResourceLearningRecord resourceLearningRecord) {
+ return resourceLearningRecordService.saveCoursesRecords(resourceLearningRecord);
+ }
+
+ /**
+ * 获取当前登录用户的学习资源记录
+ * @param pagenum
+ * @param pagesize
+ * @return
+ */
+ @ApiOperation("根据用户id查询学习记录")
+ @ValidateParams({"userId"})
+ @GetMapping("/page")
+ public BaseResponse getAll(@RequestParam(value = "pagenum", defaultValue = "1") int pagenum,
+ @RequestParam(value = "pagesize", defaultValue = "10") int pagesize,
+ @RequestParam String userId,
+ @RequestParam String courseId,
+ @RequestParam String knowledgeId){
+ return resourceLearningRecordService.getPage(pagenum, pagesize, userId, knowledgeId,courseId);
+
+ }
+ /**
+ * 根据ids删除
+ * @param ids
+ * @return
+ */
+ @ApiOperation("学习记录删除")
+ @DeleteMapping("/delete")
+ public BaseResponse deleteRecords(@RequestParam List ids){
+ return resourceLearningRecordService.removeResourceRecord(ids);
+ }
+
+ /**
+ * 统计单个学生学习资源数量
+ * @param userId
+ * @return
+ */
+ @ApiOperation("统计单个学生学习资源数量")
+ @GetMapping("/countresourcenumber")
+ public BaseResponse countResourceNumber(@RequestParam String userId) {
+ return ResultUtils.success(resourceLearningRecordMapper.selectDistinctResourceIdsByUser(userId).size());
+ }
+
+
+ @ApiOperation("上传图片")
+ @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+ public BaseResponse upload(@RequestPart("filedata") MultipartFile filedata) throws IOException {
+ //调用ser
+ System.out.println(filedata.getResource());
+ System.out.println(UploadUtils.saveFileByDirectory(filedata));
+// File file = filedata.getResource().getFile();
+// UploadUtils.Chunk(file);
+// UploadUtils.Merge(file);
+ //源文件
+// File sourseFile = (File) file;
+ return ResultUtils.success("hello");
+ };
+
+ @GetMapping("/bf")
+ public BaseResponse bf(@RequestParam String path, File file,HttpServletRequest request, HttpServletResponse response){
+ File sourseFile = new File(path);
+ return ResultUtils.success(path);
+ };
+
+}
diff --git a/src/main/java/com/teaching/backend/controller/resource/ResourceController.java b/src/main/java/com/teaching/backend/controller/resource/ResourceController.java
index 71b0884..1dc7cc1 100644
--- a/src/main/java/com/teaching/backend/controller/resource/ResourceController.java
+++ b/src/main/java/com/teaching/backend/controller/resource/ResourceController.java
@@ -32,7 +32,7 @@ public class ResourceController {
//添加知识点
@PostMapping("/upload")
@ResponseBody
- public BaseResponse uploadFile(@RequestPart("file") MultipartFile file) {
+ public BaseResponse uploadFile(@RequestPart("file") MultipartFile file) {
return resourceService.upload(file);
}
@@ -62,19 +62,19 @@ public class ResourceController {
//查询课程下资源
@GetMapping("/queryByCourseId")
- Set queryResourcesByCourseId(String courseId){
+ BaseResponse> queryResourcesByCourseId(@RequestParam String courseId){
return resourceService.queryResourcesByCourseId(courseId);
}
//查询章节下资源
@GetMapping("/queryByChapterId")
- Set queryResourcesByChapterId(Long chapterId){
+ BaseResponse> queryResourcesByChapterId(@RequestParam Long chapterId){
return resourceService.queryResourcesByChapterId(chapterId);
}
//查询二级节点下资源
@GetMapping("/queryBesidesKnow")
- Set queryBesidesKnowToResources(Long KnowId){
+ BaseResponse> queryBesidesKnowToResources(@RequestParam Long KnowId){
return resourceService.queryBesidesKnowToResources(KnowId);
}
diff --git a/src/main/java/com/teaching/backend/controller/umsAdmin/UmsStudentManageController.java b/src/main/java/com/teaching/backend/controller/umsAdmin/UmsStudentManageController.java
new file mode 100644
index 0000000..6dbf21c
--- /dev/null
+++ b/src/main/java/com/teaching/backend/controller/umsAdmin/UmsStudentManageController.java
@@ -0,0 +1,72 @@
+package com.teaching.backend.controller.umsAdmin;
+
+import com.teaching.backend.common.CommonResult;
+import com.teaching.backend.model.dto.umsAdmin.UmsStudentPageQueryDTO;
+import com.teaching.backend.model.entity.umsAdmin.UmsStudentManage;
+import com.teaching.backend.service.umsAdmin.UmsStudentManageService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import java.util.Map;
+
+@RestController
+@Api(tags = "学生管理")
+@RequestMapping("/api/studentManage")
+@Slf4j
+public class UmsStudentManageController {
+
+ @Autowired
+ private UmsStudentManageService umsStudentManageService;
+
+ /**
+ * 学生管理分页查询
+ * @param umsStudentPageQueryDTO
+ * @return
+ */
+ @GetMapping("/page")
+ @ApiOperation("学生管理分页查询")
+ public CommonResult