@@ -1,9 +1,11 @@
|
||||
package cn.iocoder.yudao.module.iot.enums.thingmodel;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
// TODO @puhui999:加个 ArrayValuable
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* IoT 数据定义的数据类型枚举类
|
||||
*
|
||||
@@ -11,7 +13,7 @@ import lombok.Getter;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotDataSpecsDataTypeEnum {
|
||||
public enum IotDataSpecsDataTypeEnum implements ArrayValuable<String> {
|
||||
|
||||
INT("int"),
|
||||
FLOAT("float"),
|
||||
@@ -23,6 +25,13 @@ public enum IotDataSpecsDataTypeEnum {
|
||||
STRUCT("struct"),
|
||||
ARRAY("array");
|
||||
|
||||
public static final String[] ARRAYS = Arrays.stream(values()).map(IotDataSpecsDataTypeEnum::getDataType).toArray(String[]::new);
|
||||
|
||||
private final String dataType;
|
||||
|
||||
@Override
|
||||
public String[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,9 +1,11 @@
|
||||
package cn.iocoder.yudao.module.iot.enums.thingmodel;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
// TODO @puhui999:加个 ArrayValuable
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* IOT 产品物模型属性读取类型枚举
|
||||
*
|
||||
@@ -11,11 +13,18 @@ import lombok.Getter;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotThingModelAccessModeEnum {
|
||||
public enum IotThingModelAccessModeEnum implements ArrayValuable<String> {
|
||||
|
||||
READ_ONLY("r"),
|
||||
READ_WRITE("rw");
|
||||
|
||||
public static final String[] ARRAYS = Arrays.stream(values()).map(IotThingModelAccessModeEnum::getMode).toArray(String[]::new);
|
||||
|
||||
private final String mode;
|
||||
|
||||
@Override
|
||||
public String[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,9 +1,12 @@
|
||||
package cn.iocoder.yudao.module.iot.enums.thingmodel;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
// TODO @puhui999:加个 ArrayValuable
|
||||
import java.util.Arrays;
|
||||
|
||||
|
||||
/**
|
||||
* IOT 产品物模型参数是输入参数还是输出参数枚举
|
||||
*
|
||||
@@ -11,11 +14,18 @@ import lombok.Getter;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotThingModelParamDirectionEnum {
|
||||
public enum IotThingModelParamDirectionEnum implements ArrayValuable<String> {
|
||||
|
||||
INPUT("input"), // 输入参数
|
||||
OUTPUT("output"); // 输出参数
|
||||
|
||||
public static final String[] ARRAYS = Arrays.stream(values()).map(IotThingModelParamDirectionEnum::getDirection).toArray(String[]::new);
|
||||
|
||||
private final String direction;
|
||||
|
||||
@Override
|
||||
public String[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,9 +1,11 @@
|
||||
package cn.iocoder.yudao.module.iot.enums.thingmodel;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
// TODO @puhui999:加个 ArrayValuable
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* IOT 产品物模型服务调用方式枚举
|
||||
*
|
||||
@@ -11,11 +13,18 @@ import lombok.Getter;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotThingModelServiceCallTypeEnum {
|
||||
public enum IotThingModelServiceCallTypeEnum implements ArrayValuable<String> {
|
||||
|
||||
ASYNC("async"), // 异步调用
|
||||
SYNC("sync"); // 同步调用
|
||||
|
||||
public static final String[] ARRAYS = Arrays.stream(values()).map(IotThingModelServiceCallTypeEnum::getType).toArray(String[]::new);
|
||||
|
||||
private final String type;
|
||||
|
||||
@Override
|
||||
public String[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,9 +1,11 @@
|
||||
package cn.iocoder.yudao.module.iot.enums.thingmodel;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
// TODO @puhui999:加个 ArrayValuable
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* IOT 产品物模型事件类型枚举
|
||||
*
|
||||
@@ -11,12 +13,19 @@ import lombok.Getter;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotThingModelServiceEventTypeEnum {
|
||||
public enum IotThingModelServiceEventTypeEnum implements ArrayValuable<String> {
|
||||
|
||||
INFO("info"), // 信息
|
||||
ALERT("alert"), // 告警
|
||||
ERROR("error"); // 故障
|
||||
|
||||
public static final String[] ARRAYS = Arrays.stream(values()).map(IotThingModelServiceEventTypeEnum::getType).toArray(String[]::new);
|
||||
|
||||
private final String type;
|
||||
|
||||
@Override
|
||||
public String[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user