| @@ -0,0 +1,93 @@ | |||||
| package com.ruoyi.platform.controller.component; | |||||
| import com.ruoyi.platform.domain.*; | |||||
| import com.ruoyi.platform.service.*; | |||||
| import com.ruoyi.platform.vo.ComponentVo; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.springframework.data.domain.Page; | |||||
| import org.springframework.data.domain.PageRequest; | |||||
| import org.springframework.http.ResponseEntity; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import javax.annotation.Resource; | |||||
| /** | |||||
| * (Component)表控制层 | |||||
| * | |||||
| * @author Xidaray | |||||
| * @since 2023-11-30 11:34:26 | |||||
| */ | |||||
| @RestController | |||||
| @RequestMapping("component") | |||||
| @Api("组件管理") | |||||
| public class ComponentController { | |||||
| /** | |||||
| * 服务对象 | |||||
| */ | |||||
| @Resource | |||||
| private ComponentService componentService; | |||||
| /** | |||||
| * 分页查询 | |||||
| * | |||||
| * @param component 筛选条件 | |||||
| * @return 查询结果 | |||||
| */ | |||||
| @GetMapping | |||||
| @ApiOperation("分页查询") | |||||
| public ResponseEntity<Page<Component>> queryByPage(Component component, int page, int size) { | |||||
| PageRequest pageRequest = PageRequest.of(page,size); | |||||
| return ResponseEntity.ok(this.componentService.queryByPage(component, pageRequest)); | |||||
| } | |||||
| /** | |||||
| * 通过主键查询单条数据 | |||||
| * | |||||
| * @param id 主键 | |||||
| * @return 单条数据 | |||||
| */ | |||||
| @GetMapping("{id}") | |||||
| @ApiOperation("根据id查询") | |||||
| public ResponseEntity<Component> queryById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.componentService.queryById(id)); | |||||
| } | |||||
| /** | |||||
| * 新增数据 | |||||
| * | |||||
| * @param component 实体 | |||||
| * @return 新增结果 | |||||
| */ | |||||
| @PostMapping | |||||
| @ApiOperation("添加组件") | |||||
| public ResponseEntity<Component> add(@RequestBody ComponentVo component) { | |||||
| return ResponseEntity.ok(this.componentService.insert(component)); | |||||
| } | |||||
| /** | |||||
| * 编辑数据 | |||||
| * | |||||
| * @param component 实体 | |||||
| * @return 编辑结果 | |||||
| */ | |||||
| @PutMapping | |||||
| @ApiOperation("编辑组件") | |||||
| public ResponseEntity<Component> edit(@RequestBody ComponentVo component) { | |||||
| return ResponseEntity.ok(this.componentService.update(component)); | |||||
| } | |||||
| /** | |||||
| * 删除数据 | |||||
| * | |||||
| * @param id 主键 | |||||
| * @return 删除是否成功 | |||||
| */ | |||||
| @DeleteMapping("{id}") | |||||
| @ApiOperation("根据id删除组件") | |||||
| public ResponseEntity<String> deleteById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.componentService.removeById(id)); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,115 @@ | |||||
| package com.ruoyi.platform.controller.dataset; | |||||
| import com.ruoyi.platform.domain.*; | |||||
| import com.ruoyi.platform.service.*; | |||||
| import io.swagger.annotations.Api; | |||||
| 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.http.ResponseEntity; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import org.springframework.web.multipart.MultipartFile; | |||||
| import javax.annotation.Resource; | |||||
| /** | |||||
| * (Dataset)表控制层 | |||||
| * | |||||
| * @author Xidaray | |||||
| * @since 2023-11-28 11:46:50 | |||||
| */ | |||||
| @RestController | |||||
| @RequestMapping("dataset") | |||||
| @Api(value = "数据集管理") | |||||
| public class DatasetController { | |||||
| /** | |||||
| * 服务对象 | |||||
| */ | |||||
| @Resource | |||||
| private DatasetService datasetService; | |||||
| /** | |||||
| * 分页查询 | |||||
| * | |||||
| * @param dataset 筛选条件 | |||||
| * @param page 页数 | |||||
| * @param size 大小 | |||||
| * @return 查询结果 | |||||
| */ | |||||
| @GetMapping | |||||
| @ApiOperation("分页查询") | |||||
| public ResponseEntity<Page<Dataset>> queryByPage(Dataset dataset, int page,int size) { | |||||
| PageRequest pageRequest = PageRequest.of(page,size); | |||||
| return ResponseEntity.ok(this.datasetService.queryByPage(dataset, pageRequest)); | |||||
| } | |||||
| /** | |||||
| * 通过主键查询单条数据 | |||||
| * | |||||
| * @param id 主键 | |||||
| * @return 单条数据 | |||||
| */ | |||||
| @GetMapping("{id}") | |||||
| @ApiOperation("根据id查询数据集") | |||||
| public ResponseEntity<Dataset> queryById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.datasetService.queryById(id)); | |||||
| } | |||||
| /** | |||||
| * 新增数据 | |||||
| * | |||||
| * @param dataset 实体 | |||||
| * @return 新增结果 | |||||
| */ | |||||
| @PostMapping | |||||
| @ApiOperation("添加数据集") | |||||
| public ResponseEntity<Dataset> add(Dataset dataset) { | |||||
| return ResponseEntity.ok(this.datasetService.insert(dataset)); | |||||
| } | |||||
| /** | |||||
| * 编辑数据 | |||||
| * | |||||
| * @param dataset 实体 | |||||
| * @return 编辑结果 | |||||
| */ | |||||
| @PutMapping | |||||
| @ApiOperation("编辑数据集") | |||||
| public ResponseEntity<Dataset> edit(Dataset dataset) { | |||||
| return ResponseEntity.ok(this.datasetService.update(dataset)); | |||||
| } | |||||
| /** | |||||
| * 删除数据 | |||||
| * | |||||
| * @param id 主键 | |||||
| * @return 删除是否成功 | |||||
| */ | |||||
| @DeleteMapping({"{id}"}) | |||||
| @ApiOperation("删除数据集") | |||||
| public ResponseEntity<String> deleteById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.datasetService.removeById(id)); | |||||
| } | |||||
| /** | |||||
| * 下载数据集 | |||||
| * | |||||
| * @param id 主键 | |||||
| * @return 单条数据 | |||||
| */ | |||||
| @GetMapping("/download/{id}") | |||||
| @ApiOperation("下载数据集") | |||||
| public ResponseEntity<InputStreamResource> downloadDataset(@PathVariable("id") Integer id) { | |||||
| return datasetService.downloadDataset(id); | |||||
| } | |||||
| @PostMapping("/upload/{id}") | |||||
| @ApiOperation("上传数据集") | |||||
| public ResponseEntity<String> uploadDataset(@RequestParam("file") MultipartFile file , @PathVariable("id") Integer id) throws Exception { | |||||
| return ResponseEntity.ok(this.datasetService.uploadDataset(file,id)); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,134 @@ | |||||
| package com.ruoyi.platform.controller.experiment; | |||||
| import com.ruoyi.platform.domain.*; | |||||
| import com.ruoyi.platform.service.*; | |||||
| import io.swagger.annotations.Api; | |||||
| 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.http.ResponseEntity; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import javax.annotation.Resource; | |||||
| /** | |||||
| * (Experiment)表控制层 | |||||
| * | |||||
| * @author makejava | |||||
| * @since 2023-11-01 16:50:37 | |||||
| */ | |||||
| @RestController | |||||
| @RequestMapping("experiment") | |||||
| @Api("实验管理") | |||||
| public class ExperimentController { | |||||
| /** | |||||
| * 服务对象 | |||||
| */ | |||||
| @Resource | |||||
| private ExperimentService experimentService; | |||||
| /** | |||||
| * 分页查询 | |||||
| * | |||||
| * @param experiment 筛选条件 | |||||
| * @return 查询结果 | |||||
| */ | |||||
| @GetMapping | |||||
| @ApiOperation("分页查询") | |||||
| public ResponseEntity<Page<Experiment>> queryByPage(Experiment experiment, int page,int size) { | |||||
| PageRequest pageRequest = PageRequest.of(page,size); | |||||
| return ResponseEntity.ok(this.experimentService.queryByPage(experiment, pageRequest)); | |||||
| } | |||||
| @GetMapping(("/status")) | |||||
| @ApiOperation("查询实验状态") | |||||
| public Page<Experiment> selectStatus(Experiment experiment, PageRequest pageRequest){ | |||||
| return this.experimentService.selectStatus(experiment, pageRequest); | |||||
| } | |||||
| @GetMapping(("/configuration")) | |||||
| public ResponseEntity<Experiment> showExperimentConfig(Experiment experiment){ | |||||
| return this.experimentService.showExperimentConfig(experiment); | |||||
| } | |||||
| /** | |||||
| * 通过主键查询单条数据 | |||||
| * | |||||
| * @param id 主键 | |||||
| * @return 单条数据 | |||||
| */ | |||||
| @GetMapping("{id}") | |||||
| @ApiOperation("通过id查询实验") | |||||
| public ResponseEntity<Experiment> queryById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.experimentService.queryById(id)); | |||||
| } | |||||
| /** | |||||
| * 新增数据 | |||||
| * | |||||
| * @param experiment 实体 | |||||
| * @return 新增结果 | |||||
| */ | |||||
| @PostMapping | |||||
| @ApiOperation("新增实验") | |||||
| public ResponseEntity<Experiment> add(Experiment experiment) { | |||||
| return ResponseEntity.ok(this.experimentService.insert(experiment)); | |||||
| } | |||||
| /** | |||||
| * 编辑数据 | |||||
| * | |||||
| * @param experiment 实体 | |||||
| * @return 编辑结果 | |||||
| */ | |||||
| @PutMapping | |||||
| @ApiOperation("编辑实验") | |||||
| public ResponseEntity<Experiment> edit(Experiment experiment) { | |||||
| return ResponseEntity.ok(this.experimentService.update(experiment)); | |||||
| } | |||||
| /** | |||||
| * 删除数据 | |||||
| * | |||||
| * @param id 主键 | |||||
| * @return 删除是否成功 | |||||
| */ | |||||
| @DeleteMapping("{id}") | |||||
| @ApiOperation("删除流水线") | |||||
| public ResponseEntity<String> deleteById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.experimentService.removeById(id)); | |||||
| } | |||||
| /** | |||||
| * 实验管理页面运行实验 | |||||
| * | |||||
| * | |||||
| * | |||||
| * @param id 主键 | |||||
| * @return 运行结果 | |||||
| */ | |||||
| @PutMapping("/experiments/{id}") | |||||
| @ApiOperation("运行实验") | |||||
| public ResponseEntity<Experiment> runExperiment(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.experimentService.runExperiment(id)); | |||||
| } | |||||
| /** | |||||
| * 实验创建页面确定并运行 | |||||
| * | |||||
| * @param experiment 实体 | |||||
| * @return 运行结果 | |||||
| */ | |||||
| @PostMapping("/addAndRunExperiment") | |||||
| @ApiOperation("实验创建页面确定并运行") | |||||
| public ResponseEntity<Experiment> addAndRunExperiment(Experiment experiment) { | |||||
| return ResponseEntity.ok(this.experimentService.addAndRunExperiment(experiment)); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,120 @@ | |||||
| package com.ruoyi.platform.controller.experiment; | |||||
| import com.ruoyi.platform.domain.ExperimentIns; | |||||
| import com.ruoyi.platform.service.ExperimentInsService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.springframework.data.domain.Page; | |||||
| import org.springframework.data.domain.PageRequest; | |||||
| import org.springframework.http.ResponseEntity; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import javax.annotation.Resource; | |||||
| /** | |||||
| * (ExperimentIns)表控制层 | |||||
| * | |||||
| * @author makejava | |||||
| * @since 2023-11-07 15:08:22 | |||||
| */ | |||||
| @RestController | |||||
| @RequestMapping("experimentIns") | |||||
| @Api("实验实例管理") | |||||
| public class ExperimentInsController { | |||||
| /** | |||||
| * 服务对象 | |||||
| */ | |||||
| @Resource | |||||
| private ExperimentInsService experimentInsService; | |||||
| /** | |||||
| * 分页查询 | |||||
| * | |||||
| * @param experimentIns 筛选条件 | |||||
| * @return 查询结果 | |||||
| */ | |||||
| @GetMapping | |||||
| @ApiOperation("分页查询") | |||||
| public ResponseEntity<Page<ExperimentIns>> queryByPage(ExperimentIns experimentIns, int page, int size) { | |||||
| PageRequest pageRequest = PageRequest.of(page,size); | |||||
| return ResponseEntity.ok(this.experimentInsService.queryByPage(experimentIns, pageRequest)); | |||||
| } | |||||
| /** | |||||
| * 通过主键查询单条数据 | |||||
| * | |||||
| * @param id 主键 | |||||
| * @return 单条数据 | |||||
| */ | |||||
| @GetMapping("{id}") | |||||
| @ApiOperation("通过id查询实验实例") | |||||
| public ResponseEntity<ExperimentIns> queryById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.experimentInsService.queryById(id)); | |||||
| } | |||||
| /** | |||||
| * 新增数据 | |||||
| * | |||||
| * @param experimentIns 实体 | |||||
| * @return 新增结果 | |||||
| */ | |||||
| @PostMapping | |||||
| @ApiOperation("新增实验实例") | |||||
| public ResponseEntity<ExperimentIns> add(ExperimentIns experimentIns) { | |||||
| return ResponseEntity.ok(this.experimentInsService.insert(experimentIns)); | |||||
| } | |||||
| /** | |||||
| * 编辑数据 | |||||
| * | |||||
| * @param experimentIns 实体 | |||||
| * @return 编辑结果 | |||||
| */ | |||||
| @PutMapping | |||||
| @ApiOperation("编辑实验实例") | |||||
| public ResponseEntity<ExperimentIns> edit(ExperimentIns experimentIns) { | |||||
| return ResponseEntity.ok(this.experimentInsService.update(experimentIns)); | |||||
| } | |||||
| /** | |||||
| * 删除数据 | |||||
| * | |||||
| * @param id 主键 | |||||
| * @return 删除是否成功 | |||||
| */ | |||||
| @DeleteMapping("{id}") | |||||
| @ApiOperation("删除实验实例") | |||||
| public ResponseEntity<String> deleteById( @PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.experimentInsService.removeById(id)); | |||||
| } | |||||
| /** | |||||
| * 终止实验实例 | |||||
| * | |||||
| * @param id 主键 | |||||
| * @return 运行结果 | |||||
| */ | |||||
| @PutMapping("{id}") | |||||
| @ApiOperation("终止实验实例") | |||||
| public boolean terminateExperimentIns(@PathVariable("id") Integer id) { | |||||
| return this.experimentInsService.terminateExperimentIns(id); | |||||
| } | |||||
| /** | |||||
| * 查询实验实例日志 | |||||
| * | |||||
| * @param id 主键 | |||||
| * @return 运行日志 | |||||
| */ | |||||
| @GetMapping(("/log/{id}")) | |||||
| public String showExperimentInsLog(@PathVariable("id") Integer id){ | |||||
| return this.experimentInsService.showExperimentInsLog(id); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,43 @@ | |||||
| package com.ruoyi.platform.controller.jupyter; | |||||
| import com.ruoyi.common.core.web.controller.BaseController; | |||||
| import com.ruoyi.common.core.web.domain.AjaxResult; | |||||
| import com.ruoyi.platform.service.JupyterService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import javax.annotation.Resource; | |||||
| import java.io.File; | |||||
| import java.io.FileInputStream; | |||||
| import java.io.IOException; | |||||
| import java.io.InputStream; | |||||
| @RestController | |||||
| @RequestMapping("/jupyter") | |||||
| @Api("jupyter service") | |||||
| public class JupyterController extends BaseController { | |||||
| @Resource | |||||
| private JupyterService jupyterService; | |||||
| @GetMapping(value = "/getURL") | |||||
| @ApiOperation("得到访问地址") | |||||
| public AjaxResult getURL() throws IOException { | |||||
| return AjaxResult.success(jupyterService.getJupyterServiceUrl()); | |||||
| } | |||||
| @GetMapping(value = "/upload") | |||||
| public AjaxResult upload() throws Exception { | |||||
| File file = new File("D://nexus-deploy.yaml"); | |||||
| InputStream inputStream = new FileInputStream(file); | |||||
| jupyterService.upload(inputStream); | |||||
| return AjaxResult.success(); | |||||
| } | |||||
| @GetMapping(value = "/mlflow") | |||||
| public AjaxResult mlflow() throws Exception { | |||||
| jupyterService.mlflow(); | |||||
| return AjaxResult.success(); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,131 @@ | |||||
| package com.ruoyi.platform.controller.model; | |||||
| import com.ruoyi.platform.domain.*; | |||||
| import com.ruoyi.platform.service.*; | |||||
| import io.swagger.annotations.Api; | |||||
| 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.http.ResponseEntity; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import org.springframework.web.multipart.MultipartFile; | |||||
| import javax.annotation.Resource; | |||||
| /** | |||||
| * (Models)表控制层 | |||||
| * | |||||
| * @author Xidaray | |||||
| * @since 2023-11-28 16:21:30 | |||||
| */ | |||||
| @RestController | |||||
| @RequestMapping("models") | |||||
| @Api("模型管理") | |||||
| public class ModelsController { | |||||
| /** | |||||
| * 服务对象 | |||||
| */ | |||||
| @Resource | |||||
| private ModelsService modelsService; | |||||
| /** | |||||
| * 分页查询 | |||||
| * | |||||
| * @param models 筛选条件 | |||||
| * @param page 分页对象 | |||||
| * @param size 分页对象 | |||||
| * @return 查询结果 | |||||
| */ | |||||
| @GetMapping | |||||
| @ApiOperation("分页查询") | |||||
| public ResponseEntity<Page<Models>> queryByPage(Models models, int page, int size) { | |||||
| PageRequest pageRequest = PageRequest.of(page,size); | |||||
| return ResponseEntity.ok(this.modelsService.queryByPage(models, pageRequest)); | |||||
| } | |||||
| /** | |||||
| * 通过主键查询单条数据 | |||||
| * | |||||
| * @param id 主键 | |||||
| * @return 单条数据 | |||||
| */ | |||||
| @GetMapping("{id}") | |||||
| @ApiOperation("根据id查询") | |||||
| public ResponseEntity<Models> queryById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.modelsService.queryById(id)); | |||||
| } | |||||
| /** | |||||
| * 新增数据 | |||||
| * | |||||
| * @param models 实体 | |||||
| * @return 新增结果 | |||||
| */ | |||||
| @PostMapping | |||||
| @ApiOperation("添加模型") | |||||
| public ResponseEntity<Models> add(Models models) { | |||||
| return ResponseEntity.ok(this.modelsService.insert(models)); | |||||
| } | |||||
| /** | |||||
| * 编辑数据 | |||||
| * | |||||
| * @param models 实体 | |||||
| * @return 编辑结果 | |||||
| */ | |||||
| @PutMapping | |||||
| @ApiOperation("编辑模型") | |||||
| public ResponseEntity<Models> edit(Models models) { | |||||
| return ResponseEntity.ok(this.modelsService.update(models)); | |||||
| } | |||||
| /** | |||||
| * 删除数据 | |||||
| * | |||||
| * @param id 主键 | |||||
| * @return 删除是否成功 | |||||
| */ | |||||
| @DeleteMapping("{id}") | |||||
| @ApiOperation("删除模型") | |||||
| public ResponseEntity<String> deleteById(@PathVariable("id") Integer id) { | |||||
| return ResponseEntity.ok(this.modelsService.removeById(id)); | |||||
| } | |||||
| /** | |||||
| * 模型上传 | |||||
| * | |||||
| * | |||||
| * | |||||
| * @param file 文件 | |||||
| * @return 上传结果 | |||||
| */ | |||||
| @PostMapping("/upload/{id}") | |||||
| @ApiOperation("上传数据集") | |||||
| public ResponseEntity<String> uploadModels(@RequestParam("file") MultipartFile file, @PathVariable("id") Integer id) throws Exception { | |||||
| return ResponseEntity.ok(this.modelsService.uploadModels(file,id)); | |||||
| } | |||||
| /** | |||||
| * 模型下载 | |||||
| * | |||||
| * | |||||
| * | |||||
| * @param id 主键 | |||||
| * @return 单条数据 | |||||
| */ | |||||
| @GetMapping("/download/{id}") | |||||
| @ApiOperation("下载模型") | |||||
| public ResponseEntity<InputStreamResource> downloadModels(@PathVariable("id") Integer id) | |||||
| { | |||||
| return modelsService.downloadModels(id); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,138 @@ | |||||
| package com.ruoyi.platform.controller.workflow; | |||||
| import com.ruoyi.platform.domain.Workflow; | |||||
| import com.ruoyi.platform.service.WorkflowService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.springframework.data.domain.Page; | |||||
| import org.springframework.data.domain.PageRequest; | |||||
| import org.springframework.http.ResponseEntity; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import javax.annotation.Resource; | |||||
| /** | |||||
| * DAG workflow(Workflow)表控制层 | |||||
| * | |||||
| * @author makejava | |||||
| * @since 2023-10-18 14:23:56 | |||||
| */ | |||||
| @RestController | |||||
| @RequestMapping("workflow") | |||||
| @Api("流水线管理") | |||||
| public class WorkflowController { | |||||
| /** | |||||
| * 服务对象 | |||||
| */ | |||||
| @Resource | |||||
| private WorkflowService workflowService; | |||||
| /** | |||||
| * 分页查询 | |||||
| * | |||||
| * @param workflow 筛选条件 | |||||
| * @return 查询结果 | |||||
| */ | |||||
| @GetMapping | |||||
| @ApiOperation("分页查询") | |||||
| public ResponseEntity<Page<Workflow>> queryByPage(Workflow workflow, int page,int size) { | |||||
| PageRequest pageRequest = PageRequest.of(page,size); | |||||
| return ResponseEntity.ok(this.workflowService.queryByPage(workflow, pageRequest)); | |||||
| } | |||||
| /** | |||||
| * 按流水线名字模糊查询 | |||||
| * | |||||
| * @param name 筛选条件 | |||||
| * @return 查询结果 | |||||
| */ | |||||
| @GetMapping("name/{name}") | |||||
| @ApiOperation("按流水线名字模糊查询流水线") | |||||
| public ResponseEntity<Page<Workflow>> queryByName(@PathVariable("name")String name) { | |||||
| return ResponseEntity.ok(this.workflowService.queryByName(name)); | |||||
| } | |||||
| /** | |||||
| * 通过主键查询单条数据 | |||||
| * | |||||
| * @param id 主键 | |||||
| * @return 单条数据 | |||||
| */ | |||||
| @GetMapping("{id}") | |||||
| @ApiOperation("根据id查询单条数据") | |||||
| public ResponseEntity<Workflow> queryById(@PathVariable("id") Long id) { | |||||
| return ResponseEntity.ok(this.workflowService.queryById(id)); | |||||
| } | |||||
| /** | |||||
| * 新增数据 | |||||
| * | |||||
| * @param workflow 实体 | |||||
| * @return 新增结果 | |||||
| */ | |||||
| @PostMapping | |||||
| @ApiOperation("新增") | |||||
| public ResponseEntity<Workflow> add(Workflow workflow) { | |||||
| return ResponseEntity.ok(this.workflowService.insert(workflow)); | |||||
| } | |||||
| /** | |||||
| * 复制流水线记录重新插入数据库 | |||||
| * | |||||
| * @param id 需要复制的流水线id | |||||
| * @return 复制结果 | |||||
| */ | |||||
| @ApiOperation("复制流水线记录") | |||||
| @PostMapping("duplicate/{id}") | |||||
| public ResponseEntity<Workflow> duplicateWorkflow(@PathVariable("id") Long id) { | |||||
| return ResponseEntity.ok(this.workflowService.duplicateWorkflow(id)); | |||||
| } | |||||
| /** | |||||
| * 流水线编辑页面保存接口 | |||||
| * | |||||
| * @return 保存结果 | |||||
| */ | |||||
| // @ApiOperation("流水线保存") | |||||
| // @PutMapping("/saveWorkflow/{id}") | |||||
| // public ResponseEntity<Workflow> saveWorkflow(@PathVariable("id") Long id) { | |||||
| // return ResponseEntity.ok(this.workflowService.saveWorkflow(id)); | |||||
| // } | |||||
| /* | |||||
| 编辑数据 | |||||
| @param workflow 实体 | |||||
| * @return 编辑结果 | |||||
| */ | |||||
| @PutMapping | |||||
| @ApiOperation("编辑流水线") | |||||
| public ResponseEntity<Workflow> edit(Workflow workflow) { | |||||
| return ResponseEntity.ok(this.workflowService.update(workflow)); | |||||
| } | |||||
| /** | |||||
| * | |||||
| * | |||||
| * | |||||
| * 删除数据 | |||||
| * | |||||
| * @param id 主键 | |||||
| * @return 删除是否成功 | |||||
| */ | |||||
| @DeleteMapping("{id}") | |||||
| @ApiOperation("删除流水线") | |||||
| public ResponseEntity<String> deleteById(@PathVariable("id") Long id) { | |||||
| return ResponseEntity.ok(this.workflowService.removeById(id)); | |||||
| } | |||||
| } | |||||