|
@@ -1,6 +1,8 @@
|
|
|
package com.yunfeiyun.agmp.iot.common.enums;
|
|
package com.yunfeiyun.agmp.iot.common.enums;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+import com.yunfeiyun.agmp.iot.common.constant.devicetype.IotDeviceDictEnum;
|
|
|
|
|
+
|
|
|
public enum IotDeviceconnTypeEnum {
|
|
public enum IotDeviceconnTypeEnum {
|
|
|
|
|
|
|
|
COMMON("0", "通用"),
|
|
COMMON("0", "通用"),
|
|
@@ -14,9 +16,9 @@ public enum IotDeviceconnTypeEnum {
|
|
|
this.name = name;
|
|
this.name = name;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static String getNameByCode(String devtypeBid) {
|
|
|
|
|
|
|
+ public static String getNameByCode(String name) {
|
|
|
for (IotDeviceconnTypeEnum iotDeviceconnTypeEnum : IotDeviceconnTypeEnum.values()) {
|
|
for (IotDeviceconnTypeEnum iotDeviceconnTypeEnum : IotDeviceconnTypeEnum.values()) {
|
|
|
- if (iotDeviceconnTypeEnum.code.equals(devtypeBid)) {
|
|
|
|
|
|
|
+ if (iotDeviceconnTypeEnum.code.equals(name)) {
|
|
|
return iotDeviceconnTypeEnum.name;
|
|
return iotDeviceconnTypeEnum.name;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -30,4 +32,19 @@ public enum IotDeviceconnTypeEnum {
|
|
|
public String getName() {
|
|
public String getName() {
|
|
|
return name;
|
|
return name;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据code查找
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param code 枚举code
|
|
|
|
|
+ * @return 枚举对象
|
|
|
|
|
+ */
|
|
|
|
|
+ public static IotDeviceconnTypeEnum findEnumByCode(String code) {
|
|
|
|
|
+ for (IotDeviceconnTypeEnum item : IotDeviceconnTypeEnum .values()) {
|
|
|
|
|
+ if (item.getCode().equals(code)) {
|
|
|
|
|
+ return item;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|