|
|
@@ -0,0 +1,47 @@
|
|
|
+package com.yunfeiyun.agmp.iot.common.enums;
|
|
|
+
|
|
|
+
|
|
|
+public enum IotDeviceDelStatusEnum {
|
|
|
+ NOT_DELETE("0", "未删除"),
|
|
|
+ DELETE("1", "已删除");
|
|
|
+
|
|
|
+ private String code;
|
|
|
+ private String name;
|
|
|
+
|
|
|
+ private IotDeviceDelStatusEnum(String code, String name) {
|
|
|
+ this.code = code;
|
|
|
+ this.name = name;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static String getNameByCode(String name) {
|
|
|
+ for (IotDeviceDelStatusEnum item : IotDeviceDelStatusEnum.values()) {
|
|
|
+ if (item.code.equals(name)) {
|
|
|
+ return item.name;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "未知类型";
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getCode() {
|
|
|
+ return code;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getName() {
|
|
|
+ return name;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据code查找
|
|
|
+ *
|
|
|
+ * @param code 枚举code
|
|
|
+ * @return 枚举对象
|
|
|
+ */
|
|
|
+ public static IotDeviceDelStatusEnum findEnumByCode(String code) {
|
|
|
+ for (IotDeviceDelStatusEnum item : IotDeviceDelStatusEnum.values()) {
|
|
|
+ if (item.getCode().equals(code)) {
|
|
|
+ return item;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+}
|