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 a1146cc7..5144cac7 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 8715378b..06efa978 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 13ea4d40..067f90a7 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 1da4dfee..ff2003de 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 1a1e88b8..e82e7f9c 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 3178da35..f2651a61 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";