Commit 3dd2e2c9 authored by 黎博's avatar 黎博

优化删除pipeline接口

parent d1d879f9
...@@ -157,12 +157,19 @@ public class PipelineController { ...@@ -157,12 +157,19 @@ public class PipelineController {
@Transactional @Transactional
@GetMapping("/delete") @GetMapping("/delete")
public JsonResult deletePipeline(@RequestParam Integer dingRobotId) { public JsonResult deletePipeline(@RequestParam Integer dingRobotId) {
try {
if (dingRobotService.getById(dingRobotId) != null) { if (dingRobotService.getById(dingRobotId) != null) {
dingRobotService.removeById(dingRobotId); dingRobotService.removeById(dingRobotId);
} }
QueryWrapper<Pipeline> pipelineQueryWrapper = new QueryWrapper<>(); QueryWrapper<Pipeline> pipelineQueryWrapper = new QueryWrapper<>();
pipelineQueryWrapper.eq("ding_robot_id", dingRobotId); pipelineQueryWrapper.eq("ding_robot_id", dingRobotId);
return JsonResult.buildSuccessResult(pipelineService.remove(pipelineQueryWrapper)); if (pipelineService.list(pipelineQueryWrapper) != null) {
pipelineService.remove(pipelineQueryWrapper);
}
return JsonResult.buildSuccessResult(true);
} catch (Exception e) {
return JsonResult.buildErrorStateResult("删除失败", false);
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment