From eeae9329aace7a60714326c9a3cce3deadbb913d Mon Sep 17 00:00:00 2001
From: zhaowenyu <35589726@qq.com>
Date: Thu, 05 Feb 2026 17:21:34 +0800
Subject: [PATCH] 2026-02-04 优化minio中转接口
---
ard-admin/src/main/java/com/ard/web/controller/sample/wayline/WaylineJobController.java | 35 ++++++++++++++++++++++++++---------
1 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/ard-admin/src/main/java/com/ard/web/controller/sample/wayline/WaylineJobController.java b/ard-admin/src/main/java/com/ard/web/controller/sample/wayline/WaylineJobController.java
index d4f110b..56a500a 100644
--- a/ard-admin/src/main/java/com/ard/web/controller/sample/wayline/WaylineJobController.java
+++ b/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("获取航线任务")
+ @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(99,"任务不存在");
+ }
+ return ResponseResult.success(waylineJobDTO.get());
+ } catch (Exception e) {
+ return ResponseResult.error(e.getMessage());
+ }
+ }
+
/**
* Paginate through all jobs.
* @param page
@@ -57,9 +75,14 @@
@RequestParam(required = false) Integer taskType,
@RequestParam(required = false) String name,
@RequestParam(required = false) Boolean isComplete) {
+ try {
// PaginationData<WaylineJobDTO> data = waylineJobService.getJobsByWorkspaceId(page, pageSize);defaultValue
- PaginationData<WaylineJobDTO> data = waylineJobService.getJobsList(page, pageSize, status,startTime, endTime, taskType,name,isComplete);
- return ResponseResult.success(data);
+ PaginationData<WaylineJobDTO> data = waylineJobService.getJobsList(page, pageSize, status, startTime, endTime, taskType, name, isComplete);
+ return ResponseResult.success(data);
+ }
+ catch (Exception e) {
+ return ResponseResult.error(e.getMessage());
+ }
}
/**
@@ -71,13 +94,7 @@
@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);
}
/**
--
Gitblit v1.9.3