From 42c48ce1d64e941d28c7bfe4093f9659e77bd523 Mon Sep 17 00:00:00 2001 From: yn147 <2270338776@qq.com> Date: 星期四, 23 十一月 2023 20:23:37 +0800 Subject: [PATCH] 学籍,毕业,档案,考勤 --- src/main/java/com/qxueyou/scc/controller/ResController.java | 107 ++++++++++++++++++++++++++--------------------------- 1 files changed, 53 insertions(+), 54 deletions(-) diff --git a/src/main/java/com/qxueyou/scc/controller/ResController.java b/src/main/java/com/qxueyou/scc/controller/ResController.java index ea597bb..4f3d8b6 100644 --- a/src/main/java/com/qxueyou/scc/controller/ResController.java +++ b/src/main/java/com/qxueyou/scc/controller/ResController.java @@ -14,16 +14,18 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; import java.util.Map; /** - * 资源管理控制器 + * 璧勬簮绠$悊鎺у埗鍣� * * @author chenjunliang */ -@Api(tags = "资源管理接口") +@Api(tags = "璧勬簮绠$悊鎺ュ彛") +@CrossOrigin @RestController @RequestMapping(value = "/teach/res") public class ResController { @@ -32,7 +34,7 @@ IResService resService; /** - * 资源库层级管理Tree + * 璧勬簮搴撳眰绾х鐞員ree */ @GetMapping(value = "categoryLevel") public Result categoryLevel(String parentId) { @@ -45,12 +47,12 @@ } /** - * 资源库根节点 + * 璧勬簮搴撴牴鑺傜偣 * - * @param type 资源库类型 - * user,个人资源库 - * class,班级资源库 - * @param ownerId 资源库所属主体id,个人资源库传userId,班级资源库传classId + * @param type 璧勬簮搴撶被鍨� + * user,涓汉璧勬簮搴� + * class,鐝骇璧勬簮搴� + * @param ownerId 璧勬簮搴撴墍灞炰富浣搃d,涓汉璧勬簮搴撲紶userId,鐝骇璧勬簮搴撲紶classId */ @GetMapping(value = "rootDir") public Result getRoot(String type, String ownerId) { @@ -66,14 +68,14 @@ } /** - * 资源管理获取 资源列表 + * 璧勬簮绠$悊鑾峰彇 璧勬簮鍒楄〃 * - * @param dirId 目录id - * @param keyword 搜索关键字 - * @param limit 每页显示几条 - * @param pageNum 页码 - * @param type 类型(0,视频。1,音频。2,文档。3,练习。) - * @return 资源列表数据 + * @param dirId 鐩綍id + * @param keyword 鎼滅储鍏抽敭瀛� + * @param limit 姣忛〉鏄剧ず鍑犳潯 + * @param pageNum 椤电爜 + * @param type 绫诲瀷(0,瑙嗛銆�1,闊抽銆�2,鏂囨。銆�3,缁冧範銆�) + * @return 璧勬簮鍒楄〃鏁版嵁 */ @GetMapping(value = "lstRes") public Result lstRes(String dirId, String keyword, Integer limit, Integer pageNum, String type) { @@ -90,9 +92,9 @@ } /** - * 资源管理删除 资源 + * 璧勬簮绠$悊鍒犻櫎 璧勬簮 * - * @param id 资源id,英文逗号区分,可传多个 + * @param id 璧勬簮id,鑻辨枃閫楀彿鍖哄垎,鍙紶澶氫釜 */ @GetMapping(value = "deleteFile") public Result deleteRes(String fileId) { @@ -100,11 +102,11 @@ } /** - * 资源管理 复制资源 + * 璧勬簮绠$悊 澶嶅埗璧勬簮 * - * @param resId 资源id - * @param dirId 目录id - * @param type 类型 + * @param resId 璧勬簮id + * @param dirId 鐩綍id + * @param type 绫诲瀷 */ @GetMapping(value = "copyRes") public Result copyRes(String resId, String dirId, String type) { @@ -112,11 +114,11 @@ } /** - * 资源管理 资源的移动 + * 璧勬簮绠$悊 璧勬簮鐨勭Щ鍔� * - * @param resId 要移动的资源 - * @param type 目录类型 - * @param dirId 目录id + * @param resId 瑕佺Щ鍔ㄧ殑璧勬簮 + * @param type 鐩綍绫诲瀷 + * @param dirId 鐩綍id */ @GetMapping(value = "moveRes") public Result moveRes(String resId, String type, String dirId) { @@ -124,12 +126,12 @@ } /** - * 资源管理新增or编辑目录 + * 璧勬簮绠$悊鏂板or缂栬緫鐩綍 * - * @param dirId 目录id - * @param name 目录名 - * @param type (add新增 and edit修改) - * @param childFlag 是否操作下级 + * @param dirId 鐩綍id + * @param name 鐩綍鍚� + * @param type (add鏂板 and edit淇敼) + * @param childFlag 鏄惁鎿嶄綔涓嬬骇 */ @GetMapping(value = "addOrUpdateDir") public Result addOrUpdateDir(String type, String name, String dirId, boolean childFlag) { @@ -145,9 +147,9 @@ } /** - * 资源管理 删除目录 + * 璧勬簮绠$悊 鍒犻櫎鐩綍 * - * @param dirId 目录id + * @param dirId 鐩綍id */ @GetMapping(value = "deleteDir") public Result deleteDir(String dirId) { @@ -155,19 +157,19 @@ } /** - * 添加/更新(视频,讲义,音频) + * 娣诲姞/鏇存柊(瑙嗛锛岃涔夛紝闊抽) * - * @param dirId 资源夹id - * @param name 名称 - * @param coverUrl 封面Url + * @param dirId 璧勬簮澶筰d + * @param name 鍚嶇О + * @param coverUrl 灏侀潰Url * @param remark: <p> - * 视频啊啊啊 + * 瑙嗛鍟婂晩鍟� * </p> - * 介绍 - * @param fileId 资源id - * @param id 资源id + * 浠嬬粛 + * @param fileId 璧勬簮id + * @param id 璧勬簮id * @param type - * @return 状态说明(0, 视频 。 1, 音频 。 2, 文档 。 3, 练习 。) + * @return 鐘舵�佽鏄�(0, 瑙嗛 銆� 1, 闊抽 銆� 2, 鏂囨。 銆� 3, 缁冧範 銆�) */ @PostMapping(value = "addOrUpdateRes") public Result addOrUpdateRes(String dirId, String id, String remark, String name, String coverUrl, String type, @@ -181,16 +183,16 @@ } /** - * 批量添加资源 + * 鎵归噺娣诲姞璧勬簮 * - * @param dirId 节点id - * @param fileId 文件id - * @param fileName 文件名称 - * @param fileType 资源类型 + * @param dirId 鑺傜偣id + * @param fileId 鏂囦欢id + * @param fileName 鏂囦欢鍚嶇О + * @param fileType 璧勬簮绫诲瀷 */ @PostMapping(value = "addOfBatch") public Result addOfBatch(String dirId, String type, @RequestParam(value = "datas") String datas) { - // 转换json到对象 + // 杞崲json鍒板璞� ObjectMapper mapper = new ObjectMapper(); try { ResDatas resDatas = mapper.readValue(datas, ResDatas.class); @@ -202,19 +204,16 @@ } /** - * 编辑 获取内容 + * 缂栬緫 鑾峰彇鍐呭 * - * @param id 资源id + * @param id 璧勬簮id */ @GetMapping(value = "getResDetail") - public Result getResDetail(String id) { - + public Result getResDetail(String id,HttpServletResponse response) { Res res = resService.read(id); Result pathResult = resService.readAccessPath(id, null); - return new Result(true, "success", CollectionUtils.newObjectMap("type", res.getType(), "name", res.getName(), "coverUrl", res.getCoverPageUrl(), "remark", res.getRemark(), "fullPath", pathResult.getDataT("path"))); } - -} +} \ No newline at end of file -- Gitblit v1.8.0