forked from dyf/fys-Multi-tenant
提交2
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user