mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-19 01:48:47 +08:00
iot交互大致框架修改
This commit is contained in:
parent
496eb7c450
commit
a7bf08efc6
@ -38,7 +38,7 @@ public class IotService {
|
|||||||
*/
|
*/
|
||||||
public String httpCtlPostSend(String deviceCode,String cmd){
|
public String httpCtlPostSend(String deviceCode,String cmd){
|
||||||
DeviceCtlDto dto = new DeviceCtlDto();
|
DeviceCtlDto dto = new DeviceCtlDto();
|
||||||
DeviceCtlDto.Params params = dto.getParams();
|
DeviceCtlDto.Params params = new DeviceCtlDto.Params();
|
||||||
params.setCommand(cmd);
|
params.setCommand(cmd);
|
||||||
dto.setParams(params);
|
dto.setParams(params);
|
||||||
Map<String, String> paramMap = new HashMap<>();
|
Map<String, String> paramMap = new HashMap<>();
|
||||||
|
|||||||
@ -69,10 +69,10 @@ public class IotHttpTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testMethod(){
|
public void testMethod(){
|
||||||
String deviceCode = "4cd72020-2b11-11ef-890f-e7ba493dc999";
|
String deviceCode = "4cd72020-2b11-11ef-890f-e7ba493dc999";
|
||||||
String cmd = "";
|
String cmd = "{\"method\":\"zzctest\",\"params\":{\"switch\":\"on\"}}";
|
||||||
|
|
||||||
// String result = httpCtlPostSend(deviceCode,cmd);
|
String result = httpCtlPostSend(deviceCode,cmd);
|
||||||
// System.out.println(result);
|
System.out.println(result);
|
||||||
|
|
||||||
String result2 = httpTelemetryGetSend(deviceCode);
|
String result2 = httpTelemetryGetSend(deviceCode);
|
||||||
System.out.println(result2);
|
System.out.println(result2);
|
||||||
@ -93,7 +93,7 @@ public class IotHttpTest {
|
|||||||
*/
|
*/
|
||||||
public String httpCtlPostSend(String deviceCode,String cmd){
|
public String httpCtlPostSend(String deviceCode,String cmd){
|
||||||
DeviceCtlDto dto = new DeviceCtlDto();
|
DeviceCtlDto dto = new DeviceCtlDto();
|
||||||
DeviceCtlDto.Params params = dto.getParams();
|
DeviceCtlDto.Params params = new DeviceCtlDto.Params();
|
||||||
params.setCommand(cmd);
|
params.setCommand(cmd);
|
||||||
dto.setParams(params);
|
dto.setParams(params);
|
||||||
Map<String, String> paramMap = new HashMap<>();
|
Map<String, String> paramMap = new HashMap<>();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user