From bf4990ffb53e2a0e7b2ec0c7a8a054bdf8a57db5 Mon Sep 17 00:00:00 2001
From: shenyijian <1178253012@qq.com>
Date: Thu, 16 Nov 2023 10:02:13 +0800
Subject: [PATCH] 无人机 -设备分页新增保护区ID查询条件
---
src/main/java/com/dji/sample/control/service/impl/PayloadCommandsHandler.java | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/dji/sample/control/service/impl/PayloadCommandsHandler.java b/src/main/java/com/dji/sample/control/service/impl/PayloadCommandsHandler.java
index c0eeee6..a348f5b 100644
--- a/src/main/java/com/dji/sample/control/service/impl/PayloadCommandsHandler.java
+++ b/src/main/java/com/dji/sample/control/service/impl/PayloadCommandsHandler.java
@@ -33,19 +33,19 @@
Optional<OsdSubDeviceReceiver> deviceOpt = SpringBeanUtils.getBean(IDeviceRedisService.class)
.getDeviceOsd(deviceSn, OsdSubDeviceReceiver.class);
if (deviceOpt.isEmpty()) {
- throw new RuntimeException("The device is offline.");
+ throw new RuntimeException("设备离线");
}
osdCamera = deviceOpt.get().getCameras().stream()
.filter(osdCamera -> param.getPayloadIndex().equals(osdCamera.getPayloadIndex()))
.findAny()
- .orElseThrow(() -> new RuntimeException("Did not receive osd information about the camera, please check the cache data."));
+ .orElseThrow(() -> new RuntimeException("没有收到相机osd信息,请检查缓存数据"));
return true;
}
private String checkDockOnline(String dockSn) {
Optional<DeviceDTO> deviceOpt = SpringBeanUtils.getBean(IDeviceRedisService.class).getDeviceOnline(dockSn);
if (deviceOpt.isEmpty()) {
- throw new RuntimeException("The dock is offline.");
+ throw new RuntimeException("设备离线");
}
return deviceOpt.get().getChildDeviceSn();
}
@@ -53,7 +53,7 @@
private void checkDeviceOnline(String deviceSn) {
boolean isOnline = SpringBeanUtils.getBean(IDeviceRedisService.class).checkDeviceOnline(deviceSn);
if (!isOnline) {
- throw new RuntimeException("The device is offline.");
+ throw new RuntimeException("设备离线");
}
}
@@ -61,13 +61,13 @@
boolean hasAuthority = SpringBeanUtils.getBean(IDevicePayloadService.class)
.checkAuthorityPayload(deviceSn, param.getPayloadIndex());
if (!hasAuthority) {
- throw new RuntimeException("The device does not have payload control authority.");
+ throw new RuntimeException("设备没有有效载荷控制权限");
}
}
public final void checkCondition(String dockSn) {
if (!valid()) {
- throw new RuntimeException("illegal argument");
+ throw new RuntimeException("非法参数");
}
String deviceSn = checkDockOnline(dockSn);
@@ -75,7 +75,7 @@
checkAuthority(deviceSn);
if (!canPublish(deviceSn)) {
- throw new RuntimeException("The current state of the drone does not support this function, please try again later.");
+ throw new RuntimeException("无人机当前状态不支持此功能,请稍后再试");
}
}
--
Gitblit v1.9.3