iot交互大致框架修改

This commit is contained in:
zhangzhicheng 2024-07-26 18:08:17 +08:00
parent 496eb7c450
commit a7bf08efc6
2 changed files with 5 additions and 5 deletions

View File

@ -38,7 +38,7 @@ public class IotService {
*/
public String httpCtlPostSend(String deviceCode,String cmd){
DeviceCtlDto dto = new DeviceCtlDto();
DeviceCtlDto.Params params = dto.getParams();
DeviceCtlDto.Params params = new DeviceCtlDto.Params();
params.setCommand(cmd);
dto.setParams(params);
Map<String, String> paramMap = new HashMap<>();

View File

@ -69,10 +69,10 @@ public class IotHttpTest {
@Test
public void testMethod(){
String deviceCode = "4cd72020-2b11-11ef-890f-e7ba493dc999";
String cmd = "";
String cmd = "{\"method\":\"zzctest\",\"params\":{\"switch\":\"on\"}}";
// String result = httpCtlPostSend(deviceCode,cmd);
// System.out.println(result);
String result = httpCtlPostSend(deviceCode,cmd);
System.out.println(result);
String result2 = httpTelemetryGetSend(deviceCode);
System.out.println(result2);
@ -93,7 +93,7 @@ public class IotHttpTest {
*/
public String httpCtlPostSend(String deviceCode,String cmd){
DeviceCtlDto dto = new DeviceCtlDto();
DeviceCtlDto.Params params = dto.getParams();
DeviceCtlDto.Params params = new DeviceCtlDto.Params();
params.setCommand(cmd);
dto.setParams(params);
Map<String, String> paramMap = new HashMap<>();