From 6a0f4c91fbbaa0ace94cc069d39e4efd9523d38a Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 19 Mar 2024 13:55:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dopenai=20setProperty=20?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=BC=96=E5=8F=B7=E4=B8=8D=E5=AD=98=E5=9C=A8?= =?UTF-8?q?500=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cc/iotkit/openapi/service/impl/OpenDeviceServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iot-module/iot-openapi/src/main/java/cc/iotkit/openapi/service/impl/OpenDeviceServiceImpl.java b/iot-module/iot-openapi/src/main/java/cc/iotkit/openapi/service/impl/OpenDeviceServiceImpl.java index 61698baf..1cb9a410 100644 --- a/iot-module/iot-openapi/src/main/java/cc/iotkit/openapi/service/impl/OpenDeviceServiceImpl.java +++ b/iot-module/iot-openapi/src/main/java/cc/iotkit/openapi/service/impl/OpenDeviceServiceImpl.java @@ -106,6 +106,9 @@ public class OpenDeviceServiceImpl implements OpenDeviceService { @Override public String setProperty(String productKey, String deviceName, String args) { DeviceInfo deviceRepetition = deviceInfoData.findByDeviceName(deviceName); + if (deviceRepetition == null){ + throw new BizException(ErrCode.DEVICE_NOT_FOUND); + } return deviceCtrlService.setProperty(deviceRepetition.getDeviceId(), JsonUtils.parseObject(args,Map.class), true); }