| @@ -161,7 +161,7 @@ public class DatasetController { | |||||
| @GetMapping("/download/{dataset_version_id}") | @GetMapping("/download/{dataset_version_id}") | ||||
| @ApiOperation(value = "下载数据集", notes = "根据数据集版本表id下载数据集文件") | @ApiOperation(value = "下载数据集", notes = "根据数据集版本表id下载数据集文件") | ||||
| public ResponseEntity<InputStreamResource> downloadDataset(@PathVariable("dataset_version_id") Integer dataset_version_id) { | |||||
| public ResponseEntity<InputStreamResource> downloadDataset(@PathVariable("dataset_version_id") Integer dataset_version_id) throws Exception { | |||||
| return datasetService.downloadDataset(dataset_version_id); | return datasetService.downloadDataset(dataset_version_id); | ||||
| } | } | ||||
| @@ -161,13 +161,14 @@ public class ModelsController { | |||||
| * | * | ||||
| * | * | ||||
| * @param files 文件 | * @param files 文件 | ||||
| * @param modelsId 模型表主键 | |||||
| // * @param modelsId 模型表主键 | |||||
| * @return 上传结果 | * @return 上传结果 | ||||
| */ | */ | ||||
| @CrossOrigin(origins = "*", allowedHeaders = "*") | |||||
| @PostMapping("/upload") | @PostMapping("/upload") | ||||
| @ApiOperation(value = "上传模型", notes = "根据模型id上传模型文件,并将信息存入数据库。") | @ApiOperation(value = "上传模型", notes = "根据模型id上传模型文件,并将信息存入数据库。") | ||||
| public AjaxResult uploadModels(@RequestParam("file") MultipartFile[] files, @RequestParam("models_id") Integer modelsId) throws Exception { | |||||
| public AjaxResult uploadModels(@RequestParam("file") MultipartFile[] files) throws Exception { | |||||
| return AjaxResult.success(this.modelsService.uploadModels(files)); | return AjaxResult.success(this.modelsService.uploadModels(files)); | ||||
| } | } | ||||
| @@ -70,7 +70,7 @@ DatasetService { | |||||
| String removeById(Integer id); | String removeById(Integer id); | ||||
| ResponseEntity<InputStreamResource> downloadDataset(Integer id); | |||||
| ResponseEntity<InputStreamResource> downloadDataset(Integer id) throws Exception; | |||||
| List<Map<String, String>> uploadDataset(MultipartFile[] files) throws Exception; | List<Map<String, String>> uploadDataset(MultipartFile[] files) throws Exception; | ||||
| @@ -215,8 +215,6 @@ public class ModelsServiceImpl implements ModelsService { | |||||
| List<Map<String, String>> results = new ArrayList<>(); | List<Map<String, String>> results = new ArrayList<>(); | ||||
| for (MultipartFile file:files){ | for (MultipartFile file:files){ | ||||
| if (file.isEmpty()) { | if (file.isEmpty()) { | ||||
| throw new Exception("文件为空,无法上传"); | throw new Exception("文件为空,无法上传"); | ||||