From 8a36ef1cc5e1f051f17d4d99bc5a356020ae3f2e Mon Sep 17 00:00:00 2001
From: liusuyi <1951119284@qq.com>
Date: Fri, 17 Oct 2025 15:45:39 +0800
Subject: [PATCH] 增加获取盒子列表按服务器id查询
---
ard-work/src/main/java/com/ard/work/service/impl/TyServiceImpl.java | 13 +++++++++++--
ard-admin/src/main/java/com/ard/web/controller/work/UavBaseController.java | 21 ++++++++++++---------
ard-work/src/main/java/com/ard/work/service/ITyService.java | 9 ++++++++-
3 files changed, 31 insertions(+), 12 deletions(-)
diff --git a/ard-admin/src/main/java/com/ard/web/controller/work/UavBaseController.java b/ard-admin/src/main/java/com/ard/web/controller/work/UavBaseController.java
index ea36520..165711a 100644
--- a/ard-admin/src/main/java/com/ard/web/controller/work/UavBaseController.java
+++ b/ard-admin/src/main/java/com/ard/web/controller/work/UavBaseController.java
@@ -43,16 +43,19 @@
return AjaxResult.success(tyService.getAccessToken(serverId));
}
- @ApiOperation("获取全部服务器盒子列表")
+ @ApiOperation("获取盒子列表")
@ApiOperationSupport(order = 2)
@GetMapping("/getBoxList")
- public AjaxResult getBoxList() {
- List<BoxInfoReceiver> boxList = tyService.getBoxList();
- return AjaxResult.success(boxList);
+ public AjaxResult getBoxList(@RequestParam(required = false) String serverId) {
+ if (serverId == null) {
+ return AjaxResult.success(tyService.getBoxList());
+ } else {
+ return AjaxResult.success(tyService.getBoxList(serverId));
+ }
}
@ApiOperation("获取飞行历史")
- @ApiOperationSupport(order = 3)
+ @ApiOperationSupport(order = 4)
@PostMapping("/getBoxHistory")
public AjaxResult getBoxHistory(@RequestBody BoxHistoryDTO boxHistoryDTO) {
List<BoxHistoryReceiver> boxHistory = tyService.getBoxHistory(boxHistoryDTO);
@@ -60,7 +63,7 @@
}
@ApiOperation("获取任务照片")
- @ApiOperationSupport(order = 4)
+ @ApiOperationSupport(order = 5)
@PostMapping("/getBoxPhotos")
public AjaxResult getBoxPhotos(@RequestBody BoxPhotosDTO boxPhotosDTO) {
List<BoxPhotosReceiver> boxPhotos = tyService.getBoxPhotos(boxPhotosDTO);
@@ -68,7 +71,7 @@
}
@ApiOperation("获取直播地址")
- @ApiOperationSupport(order = 5)
+ @ApiOperationSupport(order = 6)
@GetMapping("/getBoxList/{boxSn}")
public AjaxResult getBoxLiveUrl(@PathVariable("boxSn") String boxSn) {
BoxStreamUrlReceiver boxLiveUrl = tyService.getBoxLiveUrl(boxSn);
@@ -76,7 +79,7 @@
}
@ApiOperation("修改云盒设置")
- @ApiOperationSupport(order = 6)
+ @ApiOperationSupport(order = 7)
@PostMapping("/updateBoxSettings")
public AjaxResult updateBoxSettings(@RequestBody BoxSettingsDTO boxSettingsDTO) {
Boolean state = tyService.updateBoxSettings(boxSettingsDTO);
@@ -84,7 +87,7 @@
}
@ApiOperation("根据[服务器id]获取六合盒子列表")
- @ApiOperationSupport(order = 7)
+ @ApiOperationSupport(order = 8)
@GetMapping("/getBoxSnToList/{id}")
public TableDataInfo getBoxSnToList(@PathVariable("id") String id) {
startPage();
diff --git a/ard-work/src/main/java/com/ard/work/service/ITyService.java b/ard-work/src/main/java/com/ard/work/service/ITyService.java
index f6bcf3d..5828e4e 100644
--- a/ard-work/src/main/java/com/ard/work/service/ITyService.java
+++ b/ard-work/src/main/java/com/ard/work/service/ITyService.java
@@ -38,12 +38,19 @@
/**
- * 获取云盒列表
+ * 获取全部服务器云盒列表
* @return
*/
List<BoxInfoReceiver> getBoxList();
/**
+ * 获取指定服务器云盒列表
+ *
+ * @return List<BoxInfoReceiver>
+ */
+ List<BoxInfoReceiver> getBoxList(String serverId);
+
+ /**
* 获取直播地址
* @return
*/
diff --git a/ard-work/src/main/java/com/ard/work/service/impl/TyServiceImpl.java b/ard-work/src/main/java/com/ard/work/service/impl/TyServiceImpl.java
index 39eb921..6f849c0 100644
--- a/ard-work/src/main/java/com/ard/work/service/impl/TyServiceImpl.java
+++ b/ard-work/src/main/java/com/ard/work/service/impl/TyServiceImpl.java
@@ -84,7 +84,7 @@
}
/**
- * 获取云盒列表
+ * 获取全部云盒列表
*
* @return List<BoxInfoReceiver>
*/
@@ -93,7 +93,16 @@
List<ArdServerInfo> ardServerInfos = ardServerService.selectArdServerInfoList(new ArdServerInfo());
return getBoxList(ardServerInfos);
}
-
+ /**
+ * 获取指定服务器云盒列表
+ *
+ * @return List<BoxInfoReceiver>
+ */
+ @Override
+ public List<BoxInfoReceiver> getBoxList(String serverId) {
+ TyHttpCommonReceiver<List<BoxInfoReceiver>> boxList = tyClient.getBoxList(serverId);
+ return boxList.getContent();
+ }
/**
* 获取直播地址
*
--
Gitblit v1.9.3