yeg
2026-08-30 1c26cdb81070af7f29df4462d3bfc1ae588ff8f3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/device/BtsDevelopmentSimulatorController.java
@@ -79,7 +79,10 @@
    {
        try
        {
            simulator.addDevice(command.ip(), command.channelCount());
            if (command.model() == null || command.model().isBlank())
                simulator.addDevice(command.ip(), command.channelCount());
            else
                simulator.addNewareDevice(command.ip(), command.model());
            return simulator.snapshot();
        }
        catch (IllegalArgumentException exception)
@@ -95,6 +98,8 @@
        try
        {
            simulator.updateDevice(deviceId, command.ip(), command.channelCount(), command.online());
            if (command.model() != null && !command.model().isBlank())
                simulator.configureNewareProfile(deviceId, command.model());
            return simulator.snapshot();
        }
        catch (IllegalArgumentException exception)
@@ -251,11 +256,23 @@
        return new ResponseStatusException(HttpStatus.BAD_REQUEST, exception.getMessage(), exception);
    }
    public record CreateDeviceCommand(String ip, int channelCount) { }
    public record CreateDeviceCommand(String ip, int channelCount, String model)
    {
        public CreateDeviceCommand(String ip, int channelCount)
        {
            this(ip, channelCount, null);
        }
    }
    public record SimulatorPowerCommand(Boolean poweredOn) { }
    public record DeviceStateCommand(String ip, int channelCount, boolean online) { }
    public record DeviceStateCommand(String ip, int channelCount, boolean online, String model)
    {
        public DeviceStateCommand(String ip, int channelCount, boolean online)
        {
            this(ip, channelCount, online, null);
        }
    }
    public record ChannelStateCommand(boolean online, DeviceWorkStatus workStatus) { }