From f7775c9fcef9785140dfdc0417d2556913572b42 Mon Sep 17 00:00:00 2001 From: zhouhao Date: Thu, 20 Feb 2020 20:47:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BC=82=E5=B8=B8=E8=BF=94?= =?UTF-8?q?=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community/device/web/DeviceMessageController.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jetlinks-manager/device-manager/src/main/java/org/jetlinks/community/device/web/DeviceMessageController.java b/jetlinks-manager/device-manager/src/main/java/org/jetlinks/community/device/web/DeviceMessageController.java index b07ae9fb..291b5131 100644 --- a/jetlinks-manager/device-manager/src/main/java/org/jetlinks/community/device/web/DeviceMessageController.java +++ b/jetlinks-manager/device-manager/src/main/java/org/jetlinks/community/device/web/DeviceMessageController.java @@ -122,7 +122,9 @@ public class DeviceMessageController { //设备功能调用 @PostMapping("invoked/{deviceId}/function/{functionId}") @SneakyThrows - public Flux invokedFunction(@PathVariable String deviceId, @PathVariable String functionId, @RequestBody Map properties) { + public Flux invokedFunction(@PathVariable String deviceId, + @PathVariable String functionId, + @RequestBody Map properties) { return registry .getDevice(deviceId) @@ -134,8 +136,6 @@ public class DeviceMessageController { .setParameter(properties)) .flatMapMany(FunctionInvokeMessageSender::send) .map(mapReply(FunctionInvokeMessageReply::getOutput)); - - } //获取设备所有属性 @@ -162,7 +162,7 @@ public class DeviceMessageController { } T mapped = function.apply(reply); if (mapped == null) { - throw new DeviceOperationException(ErrorCode.NO_REPLY); + throw new BusinessException(reply.getMessage(), reply.getCode()); } return mapped; };