From a5b3c07c01584bae8a054b9b88ba3df1c540c70d Mon Sep 17 00:00:00 2001 From: zhouwentao <1577701412@qq.com> Date: Fri, 15 Sep 2023 11:12:51 +0800 Subject: [PATCH] updates --- src/main/java/com/example/zxweb/init/LoadCelueInit.java | 1 + src/main/java/com/example/zxweb/utils/IotUtils.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/example/zxweb/init/LoadCelueInit.java b/src/main/java/com/example/zxweb/init/LoadCelueInit.java index c76c15c..f2c52cc 100644 --- a/src/main/java/com/example/zxweb/init/LoadCelueInit.java +++ b/src/main/java/com/example/zxweb/init/LoadCelueInit.java @@ -36,6 +36,7 @@ public class LoadCelueInit implements ApplicationRunner{ String format = String.format("{\"serial\":\"%s\",\"productId\":\"\",\"methodName\":\"celueListQuery\",\"inputData\":{\"devid\":\"%s\"}}", gateway_5lqh,gateway_5lqh); JSONObject requestBody = JSONObject.parseObject(format); JSONObject responseBody = IotUtils.postApi(IotApiEnum.getPathByText("向设备发送方法"), requestBody); + log.info(responseBody.toJSONString()); JSONObject data = responseBody.getJSONObject("data"); if (data!=null) { JSONObject outputData = data.getJSONObject("outputData"); diff --git a/src/main/java/com/example/zxweb/utils/IotUtils.java b/src/main/java/com/example/zxweb/utils/IotUtils.java index e4dc46c..ae6defa 100644 --- a/src/main/java/com/example/zxweb/utils/IotUtils.java +++ b/src/main/java/com/example/zxweb/utils/IotUtils.java @@ -74,7 +74,7 @@ public class IotUtils { } } }catch (Exception e){ - throw new BusinessException(e); + throw new BusinessException(e.getMessage()); } return false; } @@ -105,7 +105,7 @@ public class IotUtils { } } }catch (Exception e){ - throw new BusinessException(e); + throw new BusinessException(e.getMessage()); } return false; }