【功能新增】IoT:增加 IotDeviceOnlineMessageConsumer,处理设备自动上线

This commit is contained in:
YunaiV
2025-01-29 19:09:21 +08:00
parent 7fe4dd2368
commit eb74f753a8
5 changed files with 118 additions and 2 deletions

View File

@@ -15,7 +15,9 @@ public enum IotDeviceMessageIdentifierEnum {
PROPERTY_REPORT("report"),
STATE_ONLINE("online"),
STATE_OFFLINE("offline");
STATE_OFFLINE("offline"),
SERVICE_REPLY_SUFFIX("_reply");
/**

View File

@@ -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);

View File

@@ -35,4 +35,8 @@ public enum IotDeviceStateEnum implements ArrayValuable<Integer> {
return ARRAYS;
}
public static boolean isOnline(Integer state) {
return ONLINE.getState().equals(state);
}
}