zhaowenyu
2025-12-03 b5b95f50e7905e9424628254b3cba7b92aa77cde
ard-admin/src/main/java/com/ard/web/controller/sample/wayline/WaylineJobController.java
@@ -13,6 +13,7 @@
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.sql.SQLException;
import java.util.Optional;
import java.util.Set;
/**
@@ -41,6 +42,23 @@
        return waylineJobService.publishFlightTask(param, loginUser);
    }
    @ApiOperation("获取航线任务")
    @PostMapping("/flight-id")
    public ResponseResult<WaylineJobDTO> getJob(@RequestParam(name = "job_id") String jobId) {
        try {
            if(jobId == null){
                return ResponseResult.error("任务ID不能为空");
            }
            Optional<WaylineJobDTO> waylineJobDTO = waylineJobService.getJobByJobId(jobId);
            if(waylineJobDTO.isEmpty()) {
                return ResponseResult.error("任务不存在");
            }
            return ResponseResult.success(waylineJobDTO.get());
        } catch (Exception e) {
            return ResponseResult.error(e.getMessage());
        }
    }
    /**
     * Paginate through all jobs.
     * @param page