|
|
|
@ -86,7 +86,7 @@ public class IotUtils {
|
|
|
|
|
JSONObject requestBody=JSONObject.parseObject(String.format("{\t\"serial\":\"%s\",\t\"productId\":\"\",\t\"methodName\":\"celueCmd\",\t\"inputData\":{\t\t\"devid\":\"%s\",\t\t\"celueid\":\"%s\",\t\t\"startStop\":\"%s\"\t}}",serial,serial,celueId,status));
|
|
|
|
|
System.out.println(requestBody.toJSONString());
|
|
|
|
|
try {
|
|
|
|
|
JSONObject jsonObject = postApi(IotApiEnum.getPathByText("向设备发送消息"), requestBody);
|
|
|
|
|
JSONObject jsonObject = postApi(IotApiEnum.getPathByText("向设备发送方法"), requestBody);
|
|
|
|
|
Integer code = jsonObject.getInteger("code");
|
|
|
|
|
if (code==0) {
|
|
|
|
|
JSONObject data = jsonObject.getJSONObject("data");
|
|
|
|
@ -114,7 +114,7 @@ public class IotUtils {
|
|
|
|
|
String request=String.format("{\"serial\":\"%s\",\"productId\":\"\",\"methodName\":\"celueDelete\",\"inputData\":{\"devid\":\"%s\",\t\"celueid\":\"%s\"}}",serial,serial,celueId);
|
|
|
|
|
try {
|
|
|
|
|
JSONObject requestBody = JSONObject.parseObject(request);
|
|
|
|
|
JSONObject responseBody = postApi(IotApiEnum.getPathByText("向设备发送消息"), requestBody);
|
|
|
|
|
JSONObject responseBody = postApi(IotApiEnum.getPathByText("向设备发送方法"), requestBody);
|
|
|
|
|
JSONObject data = responseBody.getJSONObject("data");
|
|
|
|
|
if (data!=null) {
|
|
|
|
|
JSONObject outputData = data.getJSONObject("outputData");
|
|
|
|
|