【代码优化】IOT: ThingModel
This commit is contained in:
@@ -10,7 +10,7 @@ import lombok.Getter;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotProductThingModelAccessModeEnum {
|
||||
public enum IotThingModelAccessModeEnum {
|
||||
|
||||
READ_ONLY("r"),
|
||||
READ_WRITE("rw");
|
@@ -10,7 +10,7 @@ import lombok.Getter;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotProductThingModelParamDirectionEnum {
|
||||
public enum IotThingModelParamDirectionEnum {
|
||||
|
||||
INPUT("input"), // 输入参数
|
||||
OUTPUT("output"); // 输出参数
|
@@ -10,7 +10,7 @@ import lombok.Getter;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotProductThingModelServiceCallTypeEnum {
|
||||
public enum IotThingModelServiceCallTypeEnum {
|
||||
|
||||
ASYNC("async"), // 异步调用
|
||||
SYNC("sync"); // 同步调用
|
@@ -10,7 +10,7 @@ import lombok.Getter;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotProductThingModelServiceEventTypeEnum {
|
||||
public enum IotThingModelServiceEventTypeEnum {
|
||||
|
||||
INFO("info"), // 信息
|
||||
ALERT("alert"), // 告警
|
@@ -13,13 +13,13 @@ import java.util.Arrays;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum IotProductThingModelTypeEnum implements IntArrayValuable {
|
||||
public enum IotThingModelTypeEnum implements IntArrayValuable {
|
||||
|
||||
PROPERTY(1, "属性"),
|
||||
SERVICE(2, "服务"),
|
||||
EVENT(3, "事件");
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotProductThingModelTypeEnum::getType).toArray();
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotThingModelTypeEnum::getType).toArray();
|
||||
|
||||
/**
|
||||
* 类型
|
||||
@@ -30,8 +30,8 @@ public enum IotProductThingModelTypeEnum implements IntArrayValuable {
|
||||
*/
|
||||
private final String description;
|
||||
|
||||
public static IotProductThingModelTypeEnum valueOfType(Integer type) {
|
||||
for (IotProductThingModelTypeEnum value : values()) {
|
||||
public static IotThingModelTypeEnum valueOfType(Integer type) {
|
||||
for (IotThingModelTypeEnum value : values()) {
|
||||
if (value.getType().equals(type)) {
|
||||
return value;
|
||||
}
|
Reference in New Issue
Block a user