From 93d9ef8c932dca0b2968aac024e0ef310dab0815 Mon Sep 17 00:00:00 2001 From: chenzhihang <709011834@qq.com> Date: Thu, 19 Sep 2024 09:22:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=87=E4=BB=B6=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/dataset/NewDatasetFromGitController.java | 4 ++-- .../controller/model/NewModelFromGitController.java | 4 ++-- .../java/com/ruoyi/platform/service/ModelsService.java | 2 +- .../com/ruoyi/platform/service/NewDatasetService.java | 2 +- .../ruoyi/platform/service/impl/ModelsServiceImpl.java | 4 ++-- .../platform/service/impl/NewDatasetServiceImpl.java | 8 ++------ 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/dataset/NewDatasetFromGitController.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/dataset/NewDatasetFromGitController.java index a1146cc..5144cac 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/dataset/NewDatasetFromGitController.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/dataset/NewDatasetFromGitController.java @@ -132,8 +132,8 @@ public class NewDatasetFromGitController { */ @GetMapping("/downloadAllFiles") @ApiOperation(value = "下载同一版本下所有数据集,并打包") - public ResponseEntity downloadAllDatasetFiles(@RequestParam("name") String name, @RequestParam("id") Integer id, @RequestParam("version") String version) throws Exception { - return newDatasetService.downloadAllDatasetFilesNew(name, id, version); + public ResponseEntity downloadAllDatasetFiles(@RequestParam("name") String name, @RequestParam("identifier") String identifier, @RequestParam("id") Integer id, @RequestParam("version") String version) throws Exception { + return newDatasetService.downloadAllDatasetFilesNew(name, identifier, id, version); } /** diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/model/NewModelFromGitController.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/model/NewModelFromGitController.java index 8715378..06efa97 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/model/NewModelFromGitController.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/model/NewModelFromGitController.java @@ -50,8 +50,8 @@ public class NewModelFromGitController { @GetMapping("/downloadAllFiles") @ApiOperation(value = "下载同一版本下所有模型,并打包") - public ResponseEntity downloadAllDatasetFiles(@RequestParam("name") String name, @RequestParam("id") Integer id, @RequestParam("version") String version) throws Exception { - return modelsService.downloadAllModelFilesNew(name, id, version); + public ResponseEntity downloadAllDatasetFiles(@RequestParam("name") String name, @RequestParam("identifier") String identifier, @RequestParam("id") Integer id, @RequestParam("version") String version) throws Exception { + return modelsService.downloadAllModelFilesNew(name, identifier, id, version); } @GetMapping("/downloadSingleFile") diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ModelsService.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ModelsService.java index 13ea4d4..067f90a 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ModelsService.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ModelsService.java @@ -93,7 +93,7 @@ public interface ModelsService { List> uploadModelLocal(MultipartFile[] files, String uuid) throws Exception; - ResponseEntity downloadAllModelFilesNew(String identifier, Integer id, String version) throws IOException, Exception; + ResponseEntity downloadAllModelFilesNew(String name, String identifier, Integer id, String version) throws IOException, Exception; Page newPubilcQueryByPage(ModelsVo modelsVo, PageRequest pageRequest) throws Exception; diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/NewDatasetService.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/NewDatasetService.java index 1da4dfe..ff2003d 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/NewDatasetService.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/NewDatasetService.java @@ -19,7 +19,7 @@ public interface NewDatasetService { String newCreateVersion(NewDatasetVo datasetVo) throws Exception; List> uploadDatasetlocal(MultipartFile[] files, String uuid) throws Exception; ResponseEntity downloadDatasetlocal(String filePath) throws Exception; - ResponseEntity downloadAllDatasetFilesNew(String name,Integer id, String version) throws IOException, Exception; + ResponseEntity downloadAllDatasetFilesNew(String name, String identifier, Integer id, String version) throws IOException, Exception; Page newPersonalQueryByPage(Dataset dataset, PageRequest pageRequest) throws Exception; Page newPubilcQueryByPage(Dataset dataset, PageRequest pageRequest) throws Exception; diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java index 1a1e88b..e82e7f9 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java @@ -789,7 +789,7 @@ public class ModelsServiceImpl implements ModelsService { } @Override - public ResponseEntity downloadAllModelFilesNew(String identifier, Integer id, String version) throws Exception { + public ResponseEntity downloadAllModelFilesNew(String name, String identifier, Integer id, String version) throws Exception { // 命令行操作 git clone 项目地址 LoginUser loginUser = SecurityUtils.getLoginUser(); String ci4sUsername = loginUser.getUsername(); @@ -820,7 +820,7 @@ public class ModelsServiceImpl implements ModelsService { InputStreamResource resource = new InputStreamResource(new FileInputStream(zipFile)); return ResponseEntity.ok() - .header(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + identifier + "_" + version + "_model.zip") + .header(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + name + "_" + version + "_model.zip") .contentType(MediaType.APPLICATION_OCTET_STREAM) .contentLength(zipFile.length()) .body(resource); diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java index 3178da3..f2651a6 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/NewDatasetServiceImpl.java @@ -394,14 +394,10 @@ public class NewDatasetServiceImpl implements NewDatasetService { } @Override - public ResponseEntity downloadAllDatasetFilesNew(String name, Integer id, String version) throws Exception { + public ResponseEntity downloadAllDatasetFilesNew(String name, String identifier, Integer id, String version) throws Exception { // 命令行操作 git clone 项目地址 LoginUser loginUser = SecurityUtils.getLoginUser(); - String ci4sUsername = loginUser.getUsername(); - Jedis jedis = new Jedis(redisHost, redisPort); - String userReq = jedis.get(ci4sUsername + "_gitUserInfo"); - Map userInfo = JsonUtils.jsonToMap(userReq); - String localPath = localPathlocal + loginUser.getUsername() + "/datasets/" + id + "/" + name; + String localPath = localPathlocal + loginUser.getUsername() + "/datasets/" + id + "/" + identifier; // 打包 data 文件夹 String dataFolderPath = localPath + "/data";