【功能新增】IoT:增加 IotDeviceOnlineMessageConsumer,处理设备自动上线
This commit is contained in:
@@ -15,7 +15,9 @@ public enum IotDeviceMessageIdentifierEnum {
|
||||
PROPERTY_REPORT("report"),
|
||||
|
||||
STATE_ONLINE("online"),
|
||||
STATE_OFFLINE("offline");
|
||||
STATE_OFFLINE("offline"),
|
||||
|
||||
SERVICE_REPLY_SUFFIX("_reply");
|
||||
|
||||
|
||||
/**
|
||||
|
@@ -15,7 +15,8 @@ public enum IotDeviceMessageTypeEnum implements ArrayValuable<String> {
|
||||
|
||||
STATE("state"), // 设备状态
|
||||
PROPERTY("property"), // 设备属性
|
||||
EVENT("event"); // 设备事件
|
||||
EVENT("event"), // 设备事件
|
||||
SERVICE("service"); // 设备服务
|
||||
|
||||
public static final String[] ARRAYS = Arrays.stream(values()).map(IotDeviceMessageTypeEnum::getType).toArray(String[]::new);
|
||||
|
||||
|
@@ -35,4 +35,8 @@ public enum IotDeviceStateEnum implements ArrayValuable<Integer> {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
public static boolean isOnline(Integer state) {
|
||||
return ONLINE.getState().equals(state);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user