From 3e8e5d69378187932f574264336a287eb3e15d17 Mon Sep 17 00:00:00 2001
From: zy <zy@123>
Date: 星期四, 17 七月 2025 11:09:41 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/controller/OpenController.java | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/zy/core/controller/OpenController.java b/src/main/java/com/zy/core/controller/OpenController.java
index a7ec4ea..a13d9ba 100644
--- a/src/main/java/com/zy/core/controller/OpenController.java
+++ b/src/main/java/com/zy/core/controller/OpenController.java
@@ -6,25 +6,52 @@
import com.zy.core.model.param.AddFakeDeviceParam;
import com.zy.core.model.param.DeleteDeviceParam;
import com.zy.core.properties.DeviceConfig;
+import com.zy.core.thread.FakeThread;
import com.zy.core.thread.ForkLiftThread;
import com.zy.core.thread.ShuttleThread;
import com.zy.core.utils.DeviceMsgUtils;
import com.zy.core.utils.FakeDeviceUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
@RestController
@RequestMapping("/open")
public class OpenController {
+ @Value("${deviceMsgConfig.gatewayId}")
+ private Integer gatewayId;
+ @Value("${deviceMsgConfig.gatewayPort}")
+ private Integer gatewayPort;
+
@Autowired
private DeviceMsgUtils deviceMsgUtils;
@Autowired
private FakeDeviceUtils fakeDeviceUtils;
+ @GetMapping("/getSystemInfo")
+ public R getSystemInfo() {
+ HashMap<String, Object> map = new HashMap<>();
+ map.put("gatewayId", gatewayId);
+ map.put("gatewayPort", gatewayPort);
+ return R.ok().add(map);
+ }
+
+ @GetMapping("/getFakeThreadList")
+ public R getFakeThreadList() {
+ FakeThread fakeThread1 = (FakeThread) SlaveConnection.get(SlaveType.FakeThread, 1);
+ FakeThread fakeThread2 = (FakeThread) SlaveConnection.get(SlaveType.FakeThread, 2);
+
+ HashMap<String, Object> map = new HashMap<>();
+ map.put("fakeNyShuttleStatusMap", fakeThread1.getFakeStatusMap());
+ map.put("fakeZyForkLiftStatusMap", fakeThread2.getFakeStatusMap());
+ return R.ok().add(map);
+ }
+
@GetMapping("/getDeviceList")
public R getDeviceList() {
List<DeviceConfig> deviceList = new ArrayList<>();
--
Gitblit v1.9.1