From 26780c533f2c2af6b9216306f649c1bcede94e4a Mon Sep 17 00:00:00 2001 From: yn147 <2270338776@qq.com> Date: 星期五, 24 十一月 2023 16:43:37 +0800 Subject: [PATCH] 学生、课程 --- src/main/java/com/qxueyou/scc/controller/ClsLectureController.java | 134 ++++++++++++++++++++++---------------------- 1 files changed, 66 insertions(+), 68 deletions(-) diff --git a/src/main/java/com/qxueyou/scc/controller/ClsLectureController.java b/src/main/java/com/qxueyou/scc/controller/ClsLectureController.java index 23e65a2..61c9a8f 100644 --- a/src/main/java/com/qxueyou/scc/controller/ClsLectureController.java +++ b/src/main/java/com/qxueyou/scc/controller/ClsLectureController.java @@ -6,10 +6,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.qxueyou.scc.admin.classes.model.ClsSubjectChapter; import com.qxueyou.scc.admin.classes.model.ClsSubjectLecture; @@ -29,8 +26,9 @@ import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; -@Api(tags = "课件管理-教师端") +@Api(tags = "璇句欢绠$悊-鏁欏笀绔�") @RestController +@CrossOrigin(origins="*",maxAge=3600) @RequestMapping(value = "teach/clsLecture") public class ClsLectureController { @Autowired @@ -42,22 +40,22 @@ @Autowired IResService resService; - /**-------------------------------------------------------------------app接口------------------------------------------------------------------------------------------**/ + /**-------------------------------------------------------------------app鎺ュ彛------------------------------------------------------------------------------------------**/ @SuppressWarnings("unchecked") - @ApiOperation(value = "获取课程下课件", notes = "") + @ApiOperation(value = "鑾峰彇璇剧▼涓嬭浠�", notes = "") @ApiImplicitParams({ - @ApiImplicitParam(name = "classId", value = "班级id", required = true, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "subjectId", value = "课程id", required = true, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "type", value = "课件类型", required = false, paramType="query", dataType = "String") + @ApiImplicitParam(name = "classId", value = "鐝骇id", required = true, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "subjectId", value = "璇剧▼id", required = true, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "type", value = "璇句欢绫诲瀷", required = false, paramType="query", dataType = "String") }) @GetMapping(value = "/app/coursewareList") public Result coursewareList(String classId,String subjectId, String type) { if(StringUtils.isEmpty(subjectId)) { - return new Result(false, "课程id不能为空"); + return new Result(false, "璇剧▼id涓嶈兘涓虹┖"); } - //公开课和管理员课程 + //鍏紑璇惧拰绠$悊鍛樿绋� if(StringUtils.isEmpty(classId)) { Object obj = this.classLectureService.coursewareChapterList(classId, subjectId, type).getData(); if(obj == null) { @@ -66,29 +64,29 @@ return new Result(true, "success", ((Map<String, Object>)obj).get("listData")); } - //查询课件 + //鏌ヨ璇句欢 List<Map<String, Object>> lectures = classLectureService.listLectureBySubject(subjectId, type, classId); - //查询章节 + //鏌ヨ绔犺妭 List<ClsSubjectChapter> chapterLst = classLectureService.getChapterLectures(classLectureService.getListChapter(classId, subjectId, null), lectures); return new Result(true, "success", QBeanUtils.listBean2ListMap(chapterLst, CollectionUtils.newStringMap("name", "name", "chapterId", "chapterId", "lectures", "lectures"))); } - /**-------------------------------------------------------------------后端接口------------------------------------------------------------------------------------------**/ + /**-------------------------------------------------------------------鍚庣鎺ュ彛------------------------------------------------------------------------------------------**/ /** - * 加载课件tree + * 鍔犺浇璇句欢tree * * @param parentId - * 父节点id + * 鐖惰妭鐐筰d */ - @ApiOperation(value = "获取课程下章节", notes = "") + @ApiOperation(value = "鑾峰彇璇剧▼涓嬬珷鑺�", notes = "") @ApiImplicitParams({ - @ApiImplicitParam(name = "classId", value = "班级id", required = false, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "subjectId", value = "课程id", required = false, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "parentId", value = "父节点id", required = false, paramType="query", dataType = "String") + @ApiImplicitParam(name = "classId", value = "鐝骇id", required = false, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "subjectId", value = "璇剧▼id", required = false, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "parentId", value = "鐖惰妭鐐筰d", required = false, paramType="query", dataType = "String") }) @GetMapping(value = "categoryTree") public Result categoryTree(String classId,String subjectId, String parentId) { @@ -100,25 +98,25 @@ } /** - * 获取课件列表 + * 鑾峰彇璇句欢鍒楄〃 * * @param chapterId - * 章节id + * 绔犺妭id * @param type - * 课件类型 + * 璇句欢绫诲瀷 * @param keyword - * 搜索关键字 + * 鎼滅储鍏抽敭瀛� * @param limit - * 每页显示几条 + * 姣忛〉鏄剧ず鍑犳潯 * @param pageNum - * 页码 - * @return 状态说明(0,视频。1,音频。2,文档。3,练习。) + * 椤电爜 + * @return 鐘舵�佽鏄�(0,瑙嗛銆�1,闊抽銆�2,鏂囨。銆�3,缁冧範銆�) */ - @ApiOperation(value = "获取课程下章节", notes = "") + @ApiOperation(value = "鑾峰彇璇剧▼涓嬬珷鑺�", notes = "") @ApiImplicitParams({ - @ApiImplicitParam(name = "classId", value = "班级id", required = false, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "chapterId", value = "章节id", required = false, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "type", value = "课件类型", required = false, paramType="query", dataType = "String") + @ApiImplicitParam(name = "classId", value = "鐝骇id", required = false, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "chapterId", value = "绔犺妭id", required = false, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "type", value = "璇句欢绫诲瀷", required = false, paramType="query", dataType = "String") }) @GetMapping(value = "coursewareList") public Result lectureList(String chapterId, String type, String keyword, Integer limit, Integer pageNum, @@ -139,17 +137,17 @@ } /** - * 查看课件 + * 鏌ョ湅璇句欢 * * @param id - * 课件id + * 璇句欢id * @param attribute - * 扩展属性 video:"mp4:HD","m3u8:SD" 可不用传 audio:可不用传 doc:可不用传 + * 鎵╁睍灞炴�� video:"mp4:HD","m3u8:SD" 鍙笉鐢ㄤ紶 audio:鍙笉鐢ㄤ紶 doc:鍙笉鐢ㄤ紶 */ - @ApiOperation(value = "查看课件", notes = "") + @ApiOperation(value = "鏌ョ湅璇句欢", notes = "") @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "课件id", required = false, paramType="query", dataType = "String"), - @ApiImplicitParam(name = "attribute", value = "扩展属性 video:\"mp4:HD\",\"m3u8:SD\" 可不用传 audio:可不用传 doc:可不用传", required = false, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "id", value = "璇句欢id", required = false, paramType="query", dataType = "String"), + @ApiImplicitParam(name = "attribute", value = "鎵╁睍灞炴�� video:\"mp4:HD\",\"m3u8:SD\" 鍙笉鐢ㄤ紶 audio:鍙笉鐢ㄤ紶 doc:鍙笉鐢ㄤ紶", required = false, paramType="query", dataType = "String"), }) @GetMapping(value = "showCourseware") public Result showLecture(String id, String attribute) { @@ -164,10 +162,10 @@ } /** - * 删除课件 + * 鍒犻櫎璇句欢 * * @param id - * 课件ids + * 璇句欢ids */ @GetMapping(value = "deleteCourseware") public Result deleteLecture(String id) { @@ -177,18 +175,18 @@ } /** - * 课件管理 新增下级,同级 + * 璇句欢绠$悊 鏂板涓嬬骇锛屽悓绾� * * @param type - * (add:新增,edit :编辑) + * (add:鏂板,edit :缂栬緫) * @param chapterId - * 章节id + * 绔犺妭id * @param classId - * 班级id + * 鐝骇id * @param name - * 名称 + * 鍚嶇О * @param childFlag - * 是否操作下级 + * 鏄惁鎿嶄綔涓嬬骇 * */ @PostMapping(value = "addOrUpdateChapter") @@ -204,10 +202,10 @@ } /** - * 课件管理 目录删除 + * 璇句欢绠$悊 鐩綍鍒犻櫎 * * @param chapterId - * 目录id + * 鐩綍id */ @GetMapping(value = "deleteChapter") public Result deleteChapter(String chapterId) { @@ -215,24 +213,24 @@ } /** - * 添加/更新(视频,讲义,音频) + * 娣诲姞/鏇存柊(瑙嗛锛岃涔夛紝闊抽) * * @param name - * 名称 + * 鍚嶇О * @param coverUrl - * 封面Url + * 灏侀潰Url * @param remark: * <p> - * 视频啊啊啊 + * 瑙嗛鍟婂晩鍟� * </p> - * 介绍 + * 浠嬬粛 * * @param id - * 课件id + * 璇句欢id * @param sectionId - * 小节Id + * 灏忚妭Id * @param type - * @return 状态说明(0,视频。1,音频。2,文档。3,练习。) + * @return 鐘舵�佽鏄�(0,瑙嗛銆�1,闊抽銆�2,鏂囨。銆�3,缁冧範銆�) */ @PostMapping(value = "addOrUpdate") public Result addOrUpdate(String id, String remark, String name, String coverUrl, String type, String fileId, @@ -253,10 +251,10 @@ } /** - * 编辑 获取内容 + * 缂栬緫 鑾峰彇鍐呭 * * @param id - * 课件id + * 璇句欢id */ @GetMapping(value = "getCoursewareDetail") public Result getLectureDetail(String id) { @@ -272,19 +270,19 @@ } /** - * 课件获取资源列表 + * 璇句欢鑾峰彇璧勬簮鍒楄〃 * * @param dirId - * 目录Id + * 鐩綍Id * @param limit - * 每页显示几条 + * 姣忛〉鏄剧ず鍑犳潯 * @param pageNum - * 页码 - * @return 状态说明(0,视频。1,音频。2,文档。3,练习。) + * 椤电爜 + * @return 鐘舵�佽鏄�(0,瑙嗛銆�1,闊抽銆�2,鏂囨。銆�3,缁冧範銆�) */ - @ApiOperation(value = "课件获取资源列表", notes = "") + @ApiOperation(value = "璇句欢鑾峰彇璧勬簮鍒楄〃", notes = "") @ApiImplicitParams({ - @ApiImplicitParam(name = "dirId", value = "目录Id", required = false, paramType="query", dataType = "String") + @ApiImplicitParam(name = "dirId", value = "鐩綍Id", required = false, paramType="query", dataType = "String") }) @GetMapping(value = "getResLst") public Result getResLst(String dirId, Integer limit, Integer pageNum, String keyword) { @@ -299,12 +297,12 @@ } /** - * 课件从资源选择后保存 + * 璇句欢浠庤祫婧愰�夋嫨鍚庝繚瀛� * * @param resId - * 资源文件id + * 璧勬簮鏂囦欢id * @param sectionId - * 小节id + * 灏忚妭id * */ @GetMapping(value = "saveCourseware4Res") -- Gitblit v1.8.0