Sfoglia il codice sorgente

feat:“添加远程开启触摸屏功能“

soobin 1 anno fa
parent
commit
c6bcbc9a74

+ 19 - 0
src/main/java/com/szwl/controller/TEquipmentController.java

@@ -1859,5 +1859,24 @@ public class TEquipmentController {
         return R.ok();
     }
 
+
+    @ApiOperation(value = "远程开启触摸屏")
+    @GetMapping("/openScreen")
+    public ResponseModel<?> openScreen(String equipmentId) {
+        // 检查设备ID是否为空
+        if (StringUtils.isEmpty(equipmentId)) {
+            return R.fail(A0001);
+        }
+        // 根据设备ID查询设备信息
+        TEquipment equipment = tEquipmentService.getById(equipmentId);
+        if (equipment == null) {
+            return R.fail(A0001, "该设备不存在");
+        }
+        // 远程开启触摸屏
+        String clientId = equipment.getClientId();
+        tEquipmentService.sentMessage(clientId, PushUtils.buildJson("restartAndroid", "restartAndroid").toString());
+        return R.ok();
+    }
+
 }