This commit is contained in:
2025-08-12 18:10:41 +08:00
parent 61ed9f0154
commit 546433b3bc

View File

@ -0,0 +1,23 @@
package com.fuyuanshen.app.service.device.status;
import org.springframework.stereotype.Component;
import java.util.LinkedHashMap;
import java.util.List;
@Component
public class RealTimeStatusEngine {
private final LinkedHashMap<String, DeviceStatusRule> rulesMap = new LinkedHashMap<>();
public RealTimeStatusEngine(List<DeviceStatusRule> rules) {
rules.forEach(rule -> rulesMap.put(rule.getCommandType(), rule)
);
}
public DeviceStatusRule getDeviceStatusRule(String commandType) {
return rulesMap.get(commandType);
}
}