|
|
@@ -0,0 +1,41 @@
|
|
|
+package com.yunfeiyun.agmp.iot.common.enums;
|
|
|
+
|
|
|
+public enum EnumIrrigationRecord {
|
|
|
+
|
|
|
+ STATUS_RUNNING("0", "灌溉进行中"),
|
|
|
+ STATUS_FINISHED("1", "灌溉已完成"),
|
|
|
+ MODE_MANUAL("0", "手动"),
|
|
|
+ MODE_AUTO("1", "自动");
|
|
|
+
|
|
|
+ private final String code;
|
|
|
+ private final String name;
|
|
|
+
|
|
|
+ EnumIrrigationRecord(String code, String name) {
|
|
|
+ this.code = code;
|
|
|
+ this.name = name;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getCode()
|
|
|
+ {
|
|
|
+ return code;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getName()
|
|
|
+ {
|
|
|
+ return name;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据code查找
|
|
|
+ * @param code 枚举code
|
|
|
+ * @return 枚举对象
|
|
|
+ */
|
|
|
+ public static EnumIrrigationRecord findEnumByCode(String code) {
|
|
|
+ for (EnumIrrigationRecord item : EnumIrrigationRecord.values()) {
|
|
|
+ if (item.getCode().equals(code)) {
|
|
|
+ return item;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+}
|