| @@ -1,18 +1,15 @@ | |||||
| package com.ruoyi.platform.controller.component; | package com.ruoyi.platform.controller.component; | ||||
| import com.ruoyi.platform.domain.*; | |||||
| import com.ruoyi.platform.service.*; | |||||
| import com.ruoyi.common.core.web.domain.AjaxResult; | |||||
| import com.ruoyi.platform.domain.Component; | |||||
| import com.ruoyi.platform.service.ComponentService; | |||||
| import com.ruoyi.platform.vo.ComponentVo; | import com.ruoyi.platform.vo.ComponentVo; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.springframework.data.domain.Page; | |||||
| import org.springframework.data.domain.PageRequest; | import org.springframework.data.domain.PageRequest; | ||||
| import org.springframework.http.ResponseEntity; | |||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| /** | /** | ||||
| * (Component)表控制层 | * (Component)表控制层 | ||||
| @@ -38,9 +35,9 @@ public class ComponentController { | |||||
| */ | */ | ||||
| @GetMapping | @GetMapping | ||||
| @ApiOperation("分页查询") | @ApiOperation("分页查询") | ||||
| public ResponseEntity<Page<Component>> queryByPage( Component component, int page, int size) { | |||||
| public AjaxResult queryByPage( Component component, int page, int size) { | |||||
| PageRequest pageRequest = PageRequest.of(page,size); | PageRequest pageRequest = PageRequest.of(page,size); | ||||
| return ResponseEntity.ok(this.componentService.queryByPage(component, pageRequest)); | |||||
| return AjaxResult.success(this.componentService.queryByPage(component, pageRequest)); | |||||
| } | } | ||||
| @@ -53,8 +50,8 @@ public class ComponentController { | |||||
| */ | */ | ||||
| @GetMapping("/components/all") | @GetMapping("/components/all") | ||||
| @ApiOperation("查询全部") | @ApiOperation("查询全部") | ||||
| public ResponseEntity<List> queryAll() throws Exception { | |||||
| return ResponseEntity.ok(this.componentService.queryAllGroupedByCategory()); | |||||
| public AjaxResult queryAll() throws Exception { | |||||
| return AjaxResult.success(this.componentService.queryAllGroupedByCategory()); | |||||
| } | } | ||||
| @@ -67,8 +64,8 @@ public class ComponentController { | |||||
| */ | */ | ||||
| @GetMapping("{id}") | @GetMapping("{id}") | ||||
| @ApiOperation("根据id查询") | @ApiOperation("根据id查询") | ||||
| public ResponseEntity<Component> queryById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.componentService.queryById(id)); | |||||
| public AjaxResult queryById(@PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.componentService.queryById(id)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -79,8 +76,8 @@ public class ComponentController { | |||||
| */ | */ | ||||
| @PostMapping | @PostMapping | ||||
| @ApiOperation("添加组件") | @ApiOperation("添加组件") | ||||
| public ResponseEntity<Component> add(@RequestBody ComponentVo component) { | |||||
| return ResponseEntity.ok(this.componentService.insert(component)); | |||||
| public AjaxResult add(@RequestBody ComponentVo component) { | |||||
| return AjaxResult.success(this.componentService.insert(component)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -91,8 +88,8 @@ public class ComponentController { | |||||
| */ | */ | ||||
| @PutMapping | @PutMapping | ||||
| @ApiOperation("编辑组件") | @ApiOperation("编辑组件") | ||||
| public ResponseEntity<Component> edit(@RequestBody ComponentVo component) { | |||||
| return ResponseEntity.ok(this.componentService.update(component)); | |||||
| public AjaxResult edit(@RequestBody ComponentVo component) { | |||||
| return AjaxResult.success(this.componentService.update(component)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -103,8 +100,8 @@ public class ComponentController { | |||||
| */ | */ | ||||
| @DeleteMapping("{id}") | @DeleteMapping("{id}") | ||||
| @ApiOperation("根据id删除组件") | @ApiOperation("根据id删除组件") | ||||
| public ResponseEntity<String> deleteById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.componentService.removeById(id)); | |||||
| public AjaxResult deleteById(@PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.componentService.removeById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,20 +1,19 @@ | |||||
| package com.ruoyi.platform.controller.dataset; | package com.ruoyi.platform.controller.dataset; | ||||
| import com.ruoyi.platform.domain.*; | |||||
| import com.ruoyi.platform.service.*; | |||||
| import com.ruoyi.common.core.web.domain.AjaxResult; | |||||
| import com.ruoyi.platform.domain.Dataset; | |||||
| import com.ruoyi.platform.domain.DatasetVersion; | |||||
| import com.ruoyi.platform.service.DatasetService; | |||||
| import com.ruoyi.platform.service.DatasetVersionService; | |||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.springframework.core.io.InputStreamResource; | |||||
| import org.springframework.data.domain.Page; | |||||
| import org.springframework.data.domain.PageRequest; | import org.springframework.data.domain.PageRequest; | ||||
| import org.springframework.http.ResponseEntity; | |||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import org.springframework.web.multipart.MultipartFile; | import org.springframework.web.multipart.MultipartFile; | ||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||
| import java.util.Map; | |||||
| /** | /** | ||||
| * (Dataset)表控制层 | * (Dataset)表控制层 | ||||
| @@ -45,9 +44,9 @@ public class DatasetController { | |||||
| */ | */ | ||||
| @GetMapping | @GetMapping | ||||
| @ApiOperation("分页查询") | @ApiOperation("分页查询") | ||||
| public ResponseEntity<Page<Dataset>> queryByPage(Dataset dataset, int page,int size) { | |||||
| public AjaxResult queryByPage(Dataset dataset, int page,int size) { | |||||
| PageRequest pageRequest = PageRequest.of(page,size); | PageRequest pageRequest = PageRequest.of(page,size); | ||||
| return ResponseEntity.ok(this.datasetService.queryByPage(dataset, pageRequest)); | |||||
| return AjaxResult.success(this.datasetService.queryByPage(dataset, pageRequest)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -58,8 +57,8 @@ public class DatasetController { | |||||
| */ | */ | ||||
| @GetMapping("{id}") | @GetMapping("{id}") | ||||
| @ApiOperation("根据id查询数据集") | @ApiOperation("根据id查询数据集") | ||||
| public ResponseEntity<Dataset> queryById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.datasetService.queryById(id)); | |||||
| public AjaxResult queryById(@PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.datasetService.queryById(id)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -70,8 +69,8 @@ public class DatasetController { | |||||
| */ | */ | ||||
| @PostMapping | @PostMapping | ||||
| @ApiOperation("添加数据集") | @ApiOperation("添加数据集") | ||||
| public ResponseEntity<Dataset> add(@RequestBody Dataset dataset) { | |||||
| return ResponseEntity.ok(this.datasetService.insert(dataset)); | |||||
| public AjaxResult add(@RequestBody Dataset dataset) { | |||||
| return AjaxResult.success(this.datasetService.insert(dataset)); | |||||
| } | } | ||||
| @@ -83,8 +82,8 @@ public class DatasetController { | |||||
| */ | */ | ||||
| @PutMapping | @PutMapping | ||||
| @ApiOperation("编辑数据集") | @ApiOperation("编辑数据集") | ||||
| public ResponseEntity<Dataset> edit(@RequestBody Dataset dataset) { | |||||
| return ResponseEntity.ok(this.datasetService.update(dataset)); | |||||
| public AjaxResult edit(@RequestBody Dataset dataset) { | |||||
| return AjaxResult.success(this.datasetService.update(dataset)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -95,8 +94,8 @@ public class DatasetController { | |||||
| */ | */ | ||||
| @DeleteMapping({"{id}"}) | @DeleteMapping({"{id}"}) | ||||
| @ApiOperation("删除数据集") | @ApiOperation("删除数据集") | ||||
| public ResponseEntity<String> deleteById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.datasetService.removeById(id)); | |||||
| public AjaxResult deleteById(@PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.datasetService.removeById(id)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -107,8 +106,8 @@ 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) { | |||||
| return datasetService.downloadDataset(dataset_version_id); | |||||
| public AjaxResult downloadDataset(@PathVariable("dataset_version_id") Integer dataset_version_id) { | |||||
| return AjaxResult.success(datasetService.downloadDataset(dataset_version_id)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -124,9 +123,9 @@ public class DatasetController { | |||||
| @ApiImplicitParam(name = "file", value = "要上传的数据集文件", required = true, dataType = "file", paramType = "form"), | @ApiImplicitParam(name = "file", value = "要上传的数据集文件", required = true, dataType = "file", paramType = "form"), | ||||
| @ApiImplicitParam(name = "dataset_version_id", value = "数据集版本表id", required = true, dataType = "integer", paramType = "path") | @ApiImplicitParam(name = "dataset_version_id", value = "数据集版本表id", required = true, dataType = "integer", paramType = "path") | ||||
| }) | }) | ||||
| public ResponseEntity<Map> uploadDataset(@RequestParam("file") MultipartFile file, | |||||
| public AjaxResult uploadDataset(@RequestParam("file") MultipartFile file, | |||||
| @PathVariable("dataset_version_id") Integer dataset_version_id) throws Exception { | @PathVariable("dataset_version_id") Integer dataset_version_id) throws Exception { | ||||
| return ResponseEntity.ok(this.datasetService.uploadDataset(file, dataset_version_id)); | |||||
| return AjaxResult.success(this.datasetService.uploadDataset(file, dataset_version_id)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -135,8 +134,8 @@ public class DatasetController { | |||||
| */ | */ | ||||
| @PostMapping("/upload_pipeline") | @PostMapping("/upload_pipeline") | ||||
| @ApiOperation(value = "从流水线上传数据集", notes = "并将信息存入数据库。") | @ApiOperation(value = "从流水线上传数据集", notes = "并将信息存入数据库。") | ||||
| public ResponseEntity<Map> uploadDatasetPipeline(@RequestBody(required =false) DatasetVersion datasetVersion) throws Exception { | |||||
| return ResponseEntity.ok(this.datasetService.uploadDatasetPipeline(datasetVersion)); | |||||
| public AjaxResult uploadDatasetPipeline(@RequestBody(required =false) DatasetVersion datasetVersion) throws Exception { | |||||
| return AjaxResult.success(this.datasetService.uploadDatasetPipeline(datasetVersion)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,11 +1,10 @@ | |||||
| package com.ruoyi.platform.controller.dataset; | package com.ruoyi.platform.controller.dataset; | ||||
| import com.ruoyi.platform.domain.*; | |||||
| import com.ruoyi.platform.service.*; | |||||
| import com.ruoyi.common.core.web.domain.AjaxResult; | |||||
| import com.ruoyi.platform.domain.DatasetVersion; | |||||
| import com.ruoyi.platform.service.DatasetVersionService; | |||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.springframework.data.domain.Page; | |||||
| import org.springframework.data.domain.PageRequest; | import org.springframework.data.domain.PageRequest; | ||||
| import org.springframework.http.ResponseEntity; | |||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||
| @@ -36,9 +35,9 @@ public class DatasetVersionController { | |||||
| */ | */ | ||||
| @GetMapping | @GetMapping | ||||
| @ApiOperation("分页查询") | @ApiOperation("分页查询") | ||||
| public ResponseEntity<Page<DatasetVersion>> queryByPage(DatasetVersion datasetVersion, int page,int size) { | |||||
| public AjaxResult queryByPage(DatasetVersion datasetVersion, int page,int size) { | |||||
| PageRequest pageRequest = PageRequest.of(page,size); | PageRequest pageRequest = PageRequest.of(page,size); | ||||
| return ResponseEntity.ok(this.datasetVersionService.queryByPage(datasetVersion, pageRequest)); | |||||
| return AjaxResult.success(this.datasetVersionService.queryByPage(datasetVersion, pageRequest)); | |||||
| } | } | ||||
| @@ -50,8 +49,8 @@ public class DatasetVersionController { | |||||
| */ | */ | ||||
| @GetMapping("{id}") | @GetMapping("{id}") | ||||
| @ApiOperation("根据id查询数据集版本") | @ApiOperation("根据id查询数据集版本") | ||||
| public ResponseEntity<DatasetVersion> queryById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.datasetVersionService.queryById(id)); | |||||
| public AjaxResult queryById(@PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.datasetVersionService.queryById(id)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -62,8 +61,8 @@ public class DatasetVersionController { | |||||
| */ | */ | ||||
| @PostMapping | @PostMapping | ||||
| @ApiOperation("添加数据集版本") | @ApiOperation("添加数据集版本") | ||||
| public ResponseEntity<DatasetVersion> add(@RequestBody DatasetVersion datasetVersion) { | |||||
| return ResponseEntity.ok(this.datasetVersionService.insert(datasetVersion)); | |||||
| public AjaxResult add(@RequestBody DatasetVersion datasetVersion) { | |||||
| return AjaxResult.success(this.datasetVersionService.insert(datasetVersion)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -74,8 +73,8 @@ public class DatasetVersionController { | |||||
| */ | */ | ||||
| @PutMapping | @PutMapping | ||||
| @ApiOperation("编辑数据集版本") | @ApiOperation("编辑数据集版本") | ||||
| public ResponseEntity<DatasetVersion> edit(@RequestBody DatasetVersion datasetVersion) { | |||||
| return ResponseEntity.ok(this.datasetVersionService.update(datasetVersion)); | |||||
| public AjaxResult edit(@RequestBody DatasetVersion datasetVersion) { | |||||
| return AjaxResult.success(this.datasetVersionService.update(datasetVersion)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -86,8 +85,8 @@ public class DatasetVersionController { | |||||
| */ | */ | ||||
| @DeleteMapping({"{id}"}) | @DeleteMapping({"{id}"}) | ||||
| @ApiOperation("删除数据集版本") | @ApiOperation("删除数据集版本") | ||||
| public ResponseEntity<String> deleteById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.datasetVersionService.removeById(id)); | |||||
| public AjaxResult deleteById(@PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.datasetVersionService.removeById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,14 +1,12 @@ | |||||
| package com.ruoyi.platform.controller.experiment; | package com.ruoyi.platform.controller.experiment; | ||||
| import com.ruoyi.platform.domain.*; | |||||
| import com.ruoyi.platform.service.*; | |||||
| import com.ruoyi.common.core.web.domain.AjaxResult; | |||||
| import com.ruoyi.platform.domain.Experiment; | |||||
| import com.ruoyi.platform.service.ExperimentService; | |||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.models.auth.In; | |||||
| import org.springframework.data.domain.Page; | |||||
| import org.springframework.data.domain.PageRequest; | import org.springframework.data.domain.PageRequest; | ||||
| import org.springframework.http.ResponseEntity; | |||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||
| @@ -37,22 +35,22 @@ public class ExperimentController { | |||||
| */ | */ | ||||
| @GetMapping | @GetMapping | ||||
| @ApiOperation("分页查询") | @ApiOperation("分页查询") | ||||
| public ResponseEntity<Page<Experiment>> queryByPage(Experiment experiment, int page,int size) { | |||||
| public AjaxResult queryByPage(Experiment experiment, int page,int size) { | |||||
| PageRequest pageRequest = PageRequest.of(page,size); | PageRequest pageRequest = PageRequest.of(page,size); | ||||
| return ResponseEntity.ok(this.experimentService.queryByPage(experiment, pageRequest)); | |||||
| return AjaxResult.success(this.experimentService.queryByPage(experiment, pageRequest)); | |||||
| } | } | ||||
| @GetMapping(("/status")) | @GetMapping(("/status")) | ||||
| @ApiOperation("查询实验状态") | @ApiOperation("查询实验状态") | ||||
| public Page<Experiment> selectStatus(@RequestBody Experiment experiment, PageRequest pageRequest){ | |||||
| return this.experimentService.selectStatus(experiment, pageRequest); | |||||
| public AjaxResult selectStatus(@RequestBody Experiment experiment, PageRequest pageRequest){ | |||||
| return AjaxResult.success(this.experimentService.selectStatus(experiment, pageRequest)); | |||||
| } | } | ||||
| @GetMapping(("/configuration")) | @GetMapping(("/configuration")) | ||||
| public ResponseEntity<Experiment> showExperimentConfig(@RequestBody Experiment experiment){ | |||||
| return this.experimentService.showExperimentConfig(experiment); | |||||
| public AjaxResult showExperimentConfig(@RequestBody Experiment experiment){ | |||||
| return AjaxResult.success(this.experimentService.showExperimentConfig(experiment)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -63,8 +61,8 @@ public class ExperimentController { | |||||
| */ | */ | ||||
| @GetMapping("{id}") | @GetMapping("{id}") | ||||
| @ApiOperation("通过id查询实验") | @ApiOperation("通过id查询实验") | ||||
| public ResponseEntity<Experiment> queryById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.experimentService.queryById(id)); | |||||
| public AjaxResult queryById(@PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.experimentService.queryById(id)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -75,8 +73,8 @@ public class ExperimentController { | |||||
| */ | */ | ||||
| @PostMapping | @PostMapping | ||||
| @ApiOperation("新增实验") | @ApiOperation("新增实验") | ||||
| public ResponseEntity<Experiment> add(@RequestBody Experiment experiment) { | |||||
| return ResponseEntity.ok(this.experimentService.insert(experiment)); | |||||
| public AjaxResult add(@RequestBody Experiment experiment) { | |||||
| return AjaxResult.success(this.experimentService.insert(experiment)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -87,8 +85,8 @@ public class ExperimentController { | |||||
| */ | */ | ||||
| @PutMapping | @PutMapping | ||||
| @ApiOperation("编辑实验") | @ApiOperation("编辑实验") | ||||
| public ResponseEntity<Experiment> edit(@RequestBody Experiment experiment) { | |||||
| return ResponseEntity.ok(this.experimentService.update(experiment)); | |||||
| public AjaxResult edit(@RequestBody Experiment experiment) { | |||||
| return AjaxResult.success(this.experimentService.update(experiment)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -99,8 +97,8 @@ public class ExperimentController { | |||||
| */ | */ | ||||
| @DeleteMapping("{id}") | @DeleteMapping("{id}") | ||||
| @ApiOperation("删除流水线") | @ApiOperation("删除流水线") | ||||
| public ResponseEntity<String> deleteById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.experimentService.removeById(id)); | |||||
| public AjaxResult deleteById(@PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.experimentService.removeById(id)); | |||||
| } | } | ||||
| @@ -115,8 +113,8 @@ public class ExperimentController { | |||||
| */ | */ | ||||
| @PutMapping("/experiments/{id}") | @PutMapping("/experiments/{id}") | ||||
| @ApiOperation("运行实验") | @ApiOperation("运行实验") | ||||
| public ResponseEntity<Experiment> runExperiment(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.experimentService.runExperiment(id)); | |||||
| public AjaxResult runExperiment(@PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.experimentService.runExperiment(id)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -127,8 +125,8 @@ public class ExperimentController { | |||||
| */ | */ | ||||
| @PostMapping("/addAndRunExperiment") | @PostMapping("/addAndRunExperiment") | ||||
| @ApiOperation("实验创建页面确定并运行") | @ApiOperation("实验创建页面确定并运行") | ||||
| public ResponseEntity<Experiment> addAndRunExperiment(@RequestBody Experiment experiment) { | |||||
| return ResponseEntity.ok(this.experimentService.addAndRunExperiment(experiment)); | |||||
| public AjaxResult addAndRunExperiment(@RequestBody Experiment experiment) { | |||||
| return AjaxResult.success(this.experimentService.addAndRunExperiment(experiment)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,12 +1,11 @@ | |||||
| package com.ruoyi.platform.controller.experiment; | package com.ruoyi.platform.controller.experiment; | ||||
| import com.ruoyi.common.core.web.domain.AjaxResult; | |||||
| import com.ruoyi.platform.domain.ExperimentIns; | import com.ruoyi.platform.domain.ExperimentIns; | ||||
| import com.ruoyi.platform.service.ExperimentInsService; | import com.ruoyi.platform.service.ExperimentInsService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.springframework.data.domain.Page; | |||||
| import org.springframework.data.domain.PageRequest; | import org.springframework.data.domain.PageRequest; | ||||
| import org.springframework.http.ResponseEntity; | |||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||
| @@ -35,9 +34,9 @@ public class ExperimentInsController { | |||||
| */ | */ | ||||
| @GetMapping | @GetMapping | ||||
| @ApiOperation("分页查询") | @ApiOperation("分页查询") | ||||
| public ResponseEntity<Page<ExperimentIns>> queryByPage(ExperimentIns experimentIns, int page, int size) { | |||||
| public AjaxResult queryByPage(ExperimentIns experimentIns, int page, int size) { | |||||
| PageRequest pageRequest = PageRequest.of(page,size); | PageRequest pageRequest = PageRequest.of(page,size); | ||||
| return ResponseEntity.ok(this.experimentInsService.queryByPage(experimentIns, pageRequest)); | |||||
| return AjaxResult.success(this.experimentInsService.queryByPage(experimentIns, pageRequest)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -48,8 +47,8 @@ public class ExperimentInsController { | |||||
| */ | */ | ||||
| @GetMapping("{id}") | @GetMapping("{id}") | ||||
| @ApiOperation("通过id查询实验实例") | @ApiOperation("通过id查询实验实例") | ||||
| public ResponseEntity<ExperimentIns> queryById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.experimentInsService.queryById(id)); | |||||
| public AjaxResult queryById(@PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.experimentInsService.queryById(id)); | |||||
| } | } | ||||
| @@ -62,8 +61,8 @@ public class ExperimentInsController { | |||||
| */ | */ | ||||
| @PostMapping | @PostMapping | ||||
| @ApiOperation("新增实验实例") | @ApiOperation("新增实验实例") | ||||
| public ResponseEntity<ExperimentIns> add(@RequestBody ExperimentIns experimentIns) { | |||||
| return ResponseEntity.ok(this.experimentInsService.insert(experimentIns)); | |||||
| public AjaxResult add(@RequestBody ExperimentIns experimentIns) { | |||||
| return AjaxResult.success(this.experimentInsService.insert(experimentIns)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -74,8 +73,8 @@ public class ExperimentInsController { | |||||
| */ | */ | ||||
| @PutMapping | @PutMapping | ||||
| @ApiOperation("编辑实验实例") | @ApiOperation("编辑实验实例") | ||||
| public ResponseEntity<ExperimentIns> edit(@RequestBody ExperimentIns experimentIns) { | |||||
| return ResponseEntity.ok(this.experimentInsService.update(experimentIns)); | |||||
| public AjaxResult edit(@RequestBody ExperimentIns experimentIns) { | |||||
| return AjaxResult.success(this.experimentInsService.update(experimentIns)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -86,8 +85,8 @@ public class ExperimentInsController { | |||||
| */ | */ | ||||
| @DeleteMapping("{id}") | @DeleteMapping("{id}") | ||||
| @ApiOperation("删除实验实例") | @ApiOperation("删除实验实例") | ||||
| public ResponseEntity<String> deleteById( @PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.experimentInsService.removeById(id)); | |||||
| public AjaxResult deleteById( @PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.experimentInsService.removeById(id)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -98,8 +97,8 @@ public class ExperimentInsController { | |||||
| */ | */ | ||||
| @PutMapping("{id}") | @PutMapping("{id}") | ||||
| @ApiOperation("终止实验实例") | @ApiOperation("终止实验实例") | ||||
| public boolean terminateExperimentIns(@PathVariable("id") Integer id) { | |||||
| return this.experimentInsService.terminateExperimentIns(id); | |||||
| public AjaxResult terminateExperimentIns(@PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.experimentInsService.terminateExperimentIns(id)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -110,8 +109,8 @@ public class ExperimentInsController { | |||||
| */ | */ | ||||
| @GetMapping(("/log/{id}")) | @GetMapping(("/log/{id}")) | ||||
| public String showExperimentInsLog(@PathVariable("id") Integer id){ | |||||
| return this.experimentInsService.showExperimentInsLog(id); | |||||
| public AjaxResult showExperimentInsLog(@PathVariable("id") Integer id){ | |||||
| return AjaxResult.success(this.experimentInsService.showExperimentInsLog(id)); | |||||
| } | } | ||||
| @@ -1,21 +1,17 @@ | |||||
| package com.ruoyi.platform.controller.model; | package com.ruoyi.platform.controller.model; | ||||
| import com.ruoyi.platform.domain.*; | |||||
| import com.ruoyi.platform.service.*; | |||||
| import com.ruoyi.common.core.web.domain.AjaxResult; | |||||
| import com.ruoyi.platform.domain.Models; | |||||
| import com.ruoyi.platform.domain.ModelsVersion; | |||||
| import com.ruoyi.platform.service.ModelsService; | |||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.springframework.core.io.InputStreamResource; | |||||
| import org.springframework.data.domain.Page; | |||||
| import org.springframework.data.domain.PageRequest; | import org.springframework.data.domain.PageRequest; | ||||
| import org.springframework.http.MediaType; | |||||
| import org.springframework.http.ResponseEntity; | |||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import org.springframework.web.multipart.MultipartFile; | import org.springframework.web.multipart.MultipartFile; | ||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||
| import java.util.Map; | |||||
| /** | /** | ||||
| * (Models)表控制层 | * (Models)表控制层 | ||||
| @@ -43,9 +39,9 @@ public class ModelsController { | |||||
| */ | */ | ||||
| @GetMapping | @GetMapping | ||||
| @ApiOperation("分页查询") | @ApiOperation("分页查询") | ||||
| public ResponseEntity<Page<Models>> queryByPage(Models models, int page, int size) { | |||||
| public AjaxResult queryByPage(Models models, int page, int size) { | |||||
| PageRequest pageRequest = PageRequest.of(page,size); | PageRequest pageRequest = PageRequest.of(page,size); | ||||
| return ResponseEntity.ok(this.modelsService.queryByPage(models, pageRequest)); | |||||
| return AjaxResult.success(this.modelsService.queryByPage(models, pageRequest)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -56,8 +52,8 @@ public class ModelsController { | |||||
| */ | */ | ||||
| @GetMapping("{id}") | @GetMapping("{id}") | ||||
| @ApiOperation("根据id查询") | @ApiOperation("根据id查询") | ||||
| public ResponseEntity<Models> queryById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.modelsService.queryById(id)); | |||||
| public AjaxResult queryById(@PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.modelsService.queryById(id)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -68,8 +64,8 @@ public class ModelsController { | |||||
| */ | */ | ||||
| @PostMapping | @PostMapping | ||||
| @ApiOperation("添加模型") | @ApiOperation("添加模型") | ||||
| public ResponseEntity<Models> add(@RequestBody Models models) { | |||||
| return ResponseEntity.ok(this.modelsService.insert(models)); | |||||
| public AjaxResult add(@RequestBody Models models) { | |||||
| return AjaxResult.success(this.modelsService.insert(models)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -80,8 +76,8 @@ public class ModelsController { | |||||
| */ | */ | ||||
| @PutMapping | @PutMapping | ||||
| @ApiOperation("编辑模型") | @ApiOperation("编辑模型") | ||||
| public ResponseEntity<Models> edit(@RequestBody Models models) { | |||||
| return ResponseEntity.ok(this.modelsService.update(models)); | |||||
| public AjaxResult edit(@RequestBody Models models) { | |||||
| return AjaxResult.success(this.modelsService.update(models)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -92,8 +88,8 @@ public class ModelsController { | |||||
| */ | */ | ||||
| @DeleteMapping("{id}") | @DeleteMapping("{id}") | ||||
| @ApiOperation("删除模型") | @ApiOperation("删除模型") | ||||
| public ResponseEntity<String> deleteById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.modelsService.removeById(id)); | |||||
| public AjaxResult deleteById(@PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.modelsService.removeById(id)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -108,8 +104,8 @@ public class ModelsController { | |||||
| @PostMapping("/upload/{models_version_id}") | @PostMapping("/upload/{models_version_id}") | ||||
| @ApiOperation(value = "上传模型", notes = "根据模型版本表id上传模型文件,并将信息存入数据库。") | @ApiOperation(value = "上传模型", notes = "根据模型版本表id上传模型文件,并将信息存入数据库。") | ||||
| public ResponseEntity<Map> uploadModels(@RequestParam("file") MultipartFile file, @PathVariable("models_version_id") Integer models_version_id) throws Exception { | |||||
| return ResponseEntity.ok(this.modelsService.uploadModels(file,models_version_id)); | |||||
| public AjaxResult uploadModels(@RequestParam("file") MultipartFile file, @PathVariable("models_version_id") Integer models_version_id) throws Exception { | |||||
| return AjaxResult.success(this.modelsService.uploadModels(file,models_version_id)); | |||||
| } | } | ||||
| @@ -119,8 +115,8 @@ public class ModelsController { | |||||
| */ | */ | ||||
| @PostMapping("/upload_pipeline") | @PostMapping("/upload_pipeline") | ||||
| @ApiOperation("从流水线上传模型,并将信息存入数据库") | @ApiOperation("从流水线上传模型,并将信息存入数据库") | ||||
| public ResponseEntity<Map> uploadModelsPipeline(@RequestBody(required =false) ModelsVersion modelsVersion) throws Exception { | |||||
| return ResponseEntity.ok(this.modelsService.uploadModelsPipeline(modelsVersion)); | |||||
| public AjaxResult uploadModelsPipeline(@RequestBody(required =false) ModelsVersion modelsVersion) throws Exception { | |||||
| return AjaxResult.success(this.modelsService.uploadModelsPipeline(modelsVersion)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -131,8 +127,8 @@ public class ModelsController { | |||||
| */ | */ | ||||
| @GetMapping("/download/{models_version_id}") | @GetMapping("/download/{models_version_id}") | ||||
| @ApiOperation(value = "下载模型", notes = "根据模型版本表id下载模型文件。") | @ApiOperation(value = "下载模型", notes = "根据模型版本表id下载模型文件。") | ||||
| public ResponseEntity<InputStreamResource> downloadModels(@PathVariable("models_version_id") Integer models_version_id) { | |||||
| return modelsService.downloadModels(models_version_id); | |||||
| public AjaxResult downloadModels(@PathVariable("models_version_id") Integer models_version_id) { | |||||
| return AjaxResult.success(modelsService.downloadModels(models_version_id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.ruoyi.platform.controller.model; | package com.ruoyi.platform.controller.model; | ||||
| import com.ruoyi.common.core.web.domain.AjaxResult; | |||||
| import com.ruoyi.platform.domain.*; | import com.ruoyi.platform.domain.*; | ||||
| import com.ruoyi.platform.service.*; | import com.ruoyi.platform.service.*; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| @@ -35,9 +36,9 @@ public class ModelsVersionController { | |||||
| */ | */ | ||||
| @GetMapping | @GetMapping | ||||
| @ApiOperation("分页查询") | @ApiOperation("分页查询") | ||||
| public ResponseEntity<Page<ModelsVersion>> queryByPage(ModelsVersion modelsVersion, int page, int size) { | |||||
| public AjaxResult queryByPage(ModelsVersion modelsVersion, int page, int size) { | |||||
| PageRequest pageRequest = PageRequest.of(page,size); | PageRequest pageRequest = PageRequest.of(page,size); | ||||
| return ResponseEntity.ok(this.modelsVersionService.queryByPage(modelsVersion, pageRequest)); | |||||
| return AjaxResult.success(this.modelsVersionService.queryByPage(modelsVersion, pageRequest)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -47,8 +48,8 @@ public class ModelsVersionController { | |||||
| * @return 单条数据 | * @return 单条数据 | ||||
| */ | */ | ||||
| @GetMapping("{id}") | @GetMapping("{id}") | ||||
| public ResponseEntity<ModelsVersion> queryById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.modelsVersionService.queryById(id)); | |||||
| public AjaxResult queryById(@PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.modelsVersionService.queryById(id)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -58,8 +59,8 @@ public class ModelsVersionController { | |||||
| * @return 新增结果 | * @return 新增结果 | ||||
| */ | */ | ||||
| @PostMapping | @PostMapping | ||||
| public ResponseEntity<ModelsVersion> add(@RequestBody ModelsVersion modelsVersion) { | |||||
| return ResponseEntity.ok(this.modelsVersionService.insert(modelsVersion)); | |||||
| public AjaxResult add(@RequestBody ModelsVersion modelsVersion) { | |||||
| return AjaxResult.success(this.modelsVersionService.insert(modelsVersion)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -69,8 +70,8 @@ public class ModelsVersionController { | |||||
| * @return 编辑结果 | * @return 编辑结果 | ||||
| */ | */ | ||||
| @PutMapping | @PutMapping | ||||
| public ResponseEntity<ModelsVersion> edit(@RequestBody ModelsVersion modelsVersion) { | |||||
| return ResponseEntity.ok(this.modelsVersionService.update(modelsVersion)); | |||||
| public AjaxResult edit(@RequestBody ModelsVersion modelsVersion) { | |||||
| return AjaxResult.success(this.modelsVersionService.update(modelsVersion)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -80,8 +81,8 @@ public class ModelsVersionController { | |||||
| * @return 删除是否成功 | * @return 删除是否成功 | ||||
| */ | */ | ||||
| @DeleteMapping("{id}") | @DeleteMapping("{id}") | ||||
| public ResponseEntity<String> deleteById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.modelsVersionService.removeById(id)); | |||||
| public AjaxResult deleteById(@PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.modelsVersionService.removeById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,12 +1,11 @@ | |||||
| package com.ruoyi.platform.controller.resources; | package com.ruoyi.platform.controller.resources; | ||||
| import com.ruoyi.platform.domain.*; | |||||
| import com.ruoyi.platform.service.*; | |||||
| import com.ruoyi.common.core.web.domain.AjaxResult; | |||||
| import com.ruoyi.platform.domain.ComputingResource; | |||||
| import com.ruoyi.platform.service.ComputingResourceService; | |||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.springframework.data.domain.Page; | |||||
| import org.springframework.data.domain.PageRequest; | import org.springframework.data.domain.PageRequest; | ||||
| import org.springframework.http.ResponseEntity; | |||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||
| @@ -35,9 +34,9 @@ public class ComputingResourceController { | |||||
| */ | */ | ||||
| @GetMapping | @GetMapping | ||||
| @ApiOperation("分页查询") | @ApiOperation("分页查询") | ||||
| public ResponseEntity<Page<ComputingResource>> queryByPage(ComputingResource computingResource, int page, int size) { | |||||
| public AjaxResult queryByPage(ComputingResource computingResource, int page, int size) { | |||||
| PageRequest pageRequest = PageRequest.of(page,size); | PageRequest pageRequest = PageRequest.of(page,size); | ||||
| return ResponseEntity.ok(this.computingResourceService.queryByPage(computingResource, pageRequest)); | |||||
| return AjaxResult.success(this.computingResourceService.queryByPage(computingResource, pageRequest)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -48,8 +47,8 @@ public class ComputingResourceController { | |||||
| */ | */ | ||||
| @GetMapping("{id}") | @GetMapping("{id}") | ||||
| @ApiOperation("根据id查询") | @ApiOperation("根据id查询") | ||||
| public ResponseEntity<ComputingResource> queryById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.computingResourceService.queryById(id)); | |||||
| public AjaxResult queryById(@PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.computingResourceService.queryById(id)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -60,8 +59,8 @@ public class ComputingResourceController { | |||||
| */ | */ | ||||
| @PostMapping | @PostMapping | ||||
| @ApiOperation("新增计算资源") | @ApiOperation("新增计算资源") | ||||
| public ResponseEntity<ComputingResource> add(@RequestBody ComputingResource computingResource) { | |||||
| return ResponseEntity.ok(this.computingResourceService.insert(computingResource)); | |||||
| public AjaxResult add(@RequestBody ComputingResource computingResource) { | |||||
| return AjaxResult.success(this.computingResourceService.insert(computingResource)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -72,8 +71,8 @@ public class ComputingResourceController { | |||||
| */ | */ | ||||
| @PutMapping | @PutMapping | ||||
| @ApiOperation("编辑计算资源") | @ApiOperation("编辑计算资源") | ||||
| public ResponseEntity<ComputingResource> edit(@RequestBody ComputingResource computingResource) { | |||||
| return ResponseEntity.ok(this.computingResourceService.update(computingResource)); | |||||
| public AjaxResult edit(@RequestBody ComputingResource computingResource) { | |||||
| return AjaxResult.success(this.computingResourceService.update(computingResource)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -84,8 +83,8 @@ public class ComputingResourceController { | |||||
| */ | */ | ||||
| @DeleteMapping("{id}") | @DeleteMapping("{id}") | ||||
| @ApiOperation("删除计算资源") | @ApiOperation("删除计算资源") | ||||
| public ResponseEntity<String> deleteById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.computingResourceService.removeById(id)); | |||||
| public AjaxResult deleteById(@PathVariable("id") Integer id) { | |||||
| return AjaxResult.success(this.computingResourceService.removeById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,12 +1,11 @@ | |||||
| package com.ruoyi.platform.controller.workflow; | package com.ruoyi.platform.controller.workflow; | ||||
| import com.ruoyi.common.core.web.domain.AjaxResult; | |||||
| import com.ruoyi.platform.domain.Workflow; | import com.ruoyi.platform.domain.Workflow; | ||||
| import com.ruoyi.platform.service.WorkflowService; | import com.ruoyi.platform.service.WorkflowService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.springframework.data.domain.Page; | |||||
| import org.springframework.data.domain.PageRequest; | import org.springframework.data.domain.PageRequest; | ||||
| import org.springframework.http.ResponseEntity; | |||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||
| @@ -40,9 +39,9 @@ public class WorkflowController { | |||||
| */ | */ | ||||
| @GetMapping | @GetMapping | ||||
| @ApiOperation("分页查询") | @ApiOperation("分页查询") | ||||
| public ResponseEntity<Page<Workflow>> queryByPage(Workflow workflow, int page,int size) { | |||||
| public AjaxResult queryByPage(Workflow workflow, int page,int size) { | |||||
| PageRequest pageRequest = PageRequest.of(page,size); | PageRequest pageRequest = PageRequest.of(page,size); | ||||
| return ResponseEntity.ok(this.workflowService.queryByPage(workflow, pageRequest)); | |||||
| return AjaxResult.success(this.workflowService.queryByPage(workflow, pageRequest)); | |||||
| } | } | ||||
| @@ -54,8 +53,8 @@ public class WorkflowController { | |||||
| */ | */ | ||||
| @GetMapping("name/{name}") | @GetMapping("name/{name}") | ||||
| @ApiOperation("按流水线名字模糊查询流水线") | @ApiOperation("按流水线名字模糊查询流水线") | ||||
| public ResponseEntity<Page<Workflow>> queryByName(@PathVariable("name") String name) { | |||||
| return ResponseEntity.ok(this.workflowService.queryByName(name)); | |||||
| public AjaxResult queryByName(@PathVariable("name") String name) { | |||||
| return AjaxResult.success(this.workflowService.queryByName(name)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -66,8 +65,8 @@ public class WorkflowController { | |||||
| */ | */ | ||||
| @GetMapping("{id}") | @GetMapping("{id}") | ||||
| @ApiOperation("根据id查询单条数据") | @ApiOperation("根据id查询单条数据") | ||||
| public ResponseEntity<Workflow> queryById(@PathVariable("id") Long id) { | |||||
| return ResponseEntity.ok(this.workflowService.queryById(id)); | |||||
| public AjaxResult queryById(@PathVariable("id") Long id) { | |||||
| return AjaxResult.success(this.workflowService.queryById(id)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -78,8 +77,8 @@ public class WorkflowController { | |||||
| */ | */ | ||||
| @PostMapping | @PostMapping | ||||
| @ApiOperation("新增") | @ApiOperation("新增") | ||||
| public ResponseEntity<Workflow> add(@RequestBody Workflow workflow) { | |||||
| return ResponseEntity.ok(this.workflowService.insert(workflow)); | |||||
| public AjaxResult add(@RequestBody Workflow workflow) { | |||||
| return AjaxResult.success(this.workflowService.insert(workflow)); | |||||
| } | } | ||||
| @@ -91,8 +90,8 @@ public class WorkflowController { | |||||
| */ | */ | ||||
| @ApiOperation("复制流水线记录") | @ApiOperation("复制流水线记录") | ||||
| @PostMapping("duplicate/{id}") | @PostMapping("duplicate/{id}") | ||||
| public ResponseEntity<Workflow> duplicateWorkflow(@PathVariable("id") Long id) { | |||||
| return ResponseEntity.ok(this.workflowService.duplicateWorkflow(id)); | |||||
| public AjaxResult duplicateWorkflow(@PathVariable("id") Long id) { | |||||
| return AjaxResult.success(this.workflowService.duplicateWorkflow(id)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -103,7 +102,7 @@ public class WorkflowController { | |||||
| // @ApiOperation("流水线保存") | // @ApiOperation("流水线保存") | ||||
| // @PutMapping("/saveWorkflow/{id}") | // @PutMapping("/saveWorkflow/{id}") | ||||
| // public ResponseEntity<Workflow> saveWorkflow(@PathVariable("id") Long id) { | // public ResponseEntity<Workflow> saveWorkflow(@PathVariable("id") Long id) { | ||||
| // return ResponseEntity.ok(this.workflowService.saveWorkflow(id)); | |||||
| // return AjaxResult.success(this.workflowService.saveWorkflow(id)); | |||||
| // } | // } | ||||
| @@ -115,8 +114,8 @@ public class WorkflowController { | |||||
| */ | */ | ||||
| @PutMapping | @PutMapping | ||||
| @ApiOperation("编辑流水线") | @ApiOperation("编辑流水线") | ||||
| public ResponseEntity<Workflow> edit(@RequestBody Workflow workflow) { | |||||
| return ResponseEntity.ok(this.workflowService.update(workflow)); | |||||
| public AjaxResult edit(@RequestBody Workflow workflow) { | |||||
| return AjaxResult.success(this.workflowService.update(workflow)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -130,8 +129,8 @@ public class WorkflowController { | |||||
| */ | */ | ||||
| @DeleteMapping("{id}") | @DeleteMapping("{id}") | ||||
| @ApiOperation("删除流水线") | @ApiOperation("删除流水线") | ||||
| public ResponseEntity<String> deleteById(@PathVariable("id") Long id) { | |||||
| return ResponseEntity.ok(this.workflowService.removeById(id)); | |||||
| public AjaxResult deleteById(@PathVariable("id") Long id) { | |||||
| return AjaxResult.success(this.workflowService.removeById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -114,13 +114,15 @@ public class ExperimentInsServiceImpl implements ExperimentInsService { | |||||
| public Page<ExperimentIns> queryByPage(ExperimentIns experimentIns, PageRequest pageRequest) { | public Page<ExperimentIns> queryByPage(ExperimentIns experimentIns, PageRequest pageRequest) { | ||||
| long total = this.experimentInsDao.count(experimentIns); | long total = this.experimentInsDao.count(experimentIns); | ||||
| List<ExperimentIns> experimentInsList = this.experimentInsDao.queryAllByLimit(experimentIns, pageRequest); | List<ExperimentIns> experimentInsList = this.experimentInsDao.queryAllByLimit(experimentIns, pageRequest); | ||||
| for (ExperimentIns ins: experimentInsList) { | |||||
| //如果实验实例不为空或者 | |||||
| if (experimentIns!=null && StringUtils.isEmpty(experimentIns.getStatus())) { | |||||
| Integer experimentInsId = experimentIns.getId(); | |||||
| String status = this.queryStatusFromArgo(ins.getArgoInsNs(), ins.getArgoInsName(), experimentInsId ); | |||||
| ins.setStatus(status); | |||||
| this.update(experimentIns); | |||||
| if (experimentInsList!=null && experimentInsList.size()>0) { | |||||
| for (ExperimentIns ins : experimentInsList) { | |||||
| //如果实验实例不为空或者 | |||||
| if (ins != null && StringUtils.isEmpty(ins.getStatus())) { | |||||
| Integer experimentInsId = ins.getId(); | |||||
| String status = this.queryStatusFromArgo(ins.getArgoInsNs(), ins.getArgoInsName(), experimentInsId); | |||||
| ins.setStatus(status); | |||||
| this.update(ins); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| return new PageImpl<>(experimentInsList, pageRequest, total); | return new PageImpl<>(experimentInsList, pageRequest, total); | ||||