yeg
2026-08-29 14ac9c2a2384f1e55b4c01eb7a104033b589d1e0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/device/BtsDevelopmentSimulatorController.java
@@ -63,6 +63,16 @@
        return simulator.snapshot();
    }
    /** 模拟现场人工统一开关全部检测柜和采集器,不发送任何设备控制命令。 */
    @PostMapping("/dev/bts-simulator/power")
    public StateSnapshot setPower(@RequestBody SimulatorPowerCommand command)
    {
        if (command == null || command.poweredOn() == null)
            throw badRequest(new IllegalArgumentException("poweredOn must be true or false"));
        simulator.setAllDevicesPoweredOn(command.poweredOn());
        return simulator.snapshot();
    }
    /** 添加一台虚拟设备。 */
    @PostMapping("/dev/bts-simulator/devices")
    public StateSnapshot createDevice(@RequestBody CreateDeviceCommand command)
@@ -243,6 +253,8 @@
    public record CreateDeviceCommand(String ip, int channelCount) { }
    public record SimulatorPowerCommand(Boolean poweredOn) { }
    public record DeviceStateCommand(String ip, int channelCount, boolean online) { }
    public record ChannelStateCommand(boolean online, DeviceWorkStatus workStatus) { }