| | |
| | | } |
| | | |
| | | @ApiOperation("获取航线任务") |
| | | @PostMapping("/flight-id") |
| | | @GetMapping("/flight-id") |
| | | public ResponseResult<WaylineJobDTO> getJob(@RequestParam(name = "job_id") String jobId) { |
| | | try { |
| | | if(jobId == null){ |
| | | return ResponseResult.error(98,"任务ID不能为空"); |
| | | } |
| | | Optional<WaylineJobDTO> waylineJobDTO = waylineJobService.getJobByJobId(jobId); |
| | | if(waylineJobDTO.isEmpty()) { |
| | | return ResponseResult.error("任务不存在"); |
| | | return ResponseResult.error(99,"任务不存在"); |
| | | } |
| | | return ResponseResult.success(waylineJobDTO.get()); |
| | | } catch (Exception e) { |
| | |
| | | @ApiOperation("取消航线任务") |
| | | @DeleteMapping("/jobs") |
| | | public ResponseResult publishCancelJob(@RequestParam(name = "job_id") Set<String> jobIds){ |
| | | try{ |
| | | waylineJobService.cancelFlightTask(jobIds); |
| | | } |
| | | catch (Exception e){ |
| | | return ResponseResult.error(e.getMessage()); |
| | | } |
| | | return ResponseResult.success(); |
| | | return waylineJobService.cancelFlightTask(jobIds); |
| | | } |
| | | |
| | | /** |