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

优化删除pipeline接口

parent d1d879f9
......@@ -157,12 +157,19 @@ public class PipelineController {
@Transactional
@GetMapping("/delete")
public JsonResult deletePipeline(@RequestParam Integer dingRobotId) {
if (dingRobotService.getById(dingRobotId) != null) {
dingRobotService.removeById(dingRobotId);
try {
if (dingRobotService.getById(dingRobotId) != null) {
dingRobotService.removeById(dingRobotId);
}
QueryWrapper<Pipeline> pipelineQueryWrapper = new QueryWrapper<>();
pipelineQueryWrapper.eq("ding_robot_id", dingRobotId);
if (pipelineService.list(pipelineQueryWrapper) != null) {
pipelineService.remove(pipelineQueryWrapper);
}
return JsonResult.buildSuccessResult(true);
} catch (Exception e) {
return JsonResult.buildErrorStateResult("删除失败", false);
}
QueryWrapper<Pipeline> pipelineQueryWrapper = new QueryWrapper<>();
pipelineQueryWrapper.eq("ding_robot_id", dingRobotId);
return JsonResult.buildSuccessResult(pipelineService.remove(pipelineQueryWrapper));
}
}
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