From 670836f6bf046451b13d6e401ca634b3ccd4ce33 Mon Sep 17 00:00:00 2001 From: jay <75509151@qq.com> Date: Wed, 2 Aug 2023 16:46:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20json=E6=A0=BC=E5=BC=8F=E5=8C=96=E6=94=BE?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iotkit/openapi/service/impl/OpenDeviceServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 858d6243..49e79148 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 @@ -3,6 +3,7 @@ package cc.iotkit.openapi.service.impl; import cc.iotkit.common.enums.ErrCode; import cc.iotkit.common.exception.BizException; import cc.iotkit.common.utils.DeviceUtil; +import cc.iotkit.common.utils.JsonUtils; import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.data.manager.IDeviceInfoData; import cc.iotkit.data.manager.IProductData; @@ -17,8 +18,7 @@ import cc.iotkit.openapi.dto.bo.device.OpenapiDeviceBo; import cc.iotkit.openapi.dto.vo.OpenDevicePropertyVo; import cc.iotkit.openapi.dto.vo.OpenPropertyVo; import cc.iotkit.openapi.service.OpenDeviceService; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; + import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; @@ -107,7 +107,7 @@ public class OpenDeviceServiceImpl implements OpenDeviceService { @Override public String setProperty(String productKey, String deviceName, String args) { DeviceInfo deviceRepetition = deviceInfoData.findByProductKeyAndDeviceName(productKey, deviceName); - return deviceService.setProperty(deviceRepetition.getDeviceId(), JSON.parseObject(args,Map.class), true); + return deviceService.setProperty(deviceRepetition.getDeviceId(), JsonUtils.parseObject(args,Map.class), true); } @Override