Browse Source

新增 创建设备基础信息接口

zhaiyifei 1 year ago
parent
commit
3e1840940d

+ 2 - 0
src/main/java/com/yunfeiyun/agmp/iot/common/domain/IotDeviceconn.java

@@ -27,6 +27,8 @@ public class IotDeviceconn extends IotBaseEntity
 
     private String devclassBid;
 
+    private String firmBid;
+
     /** 连接类型 */
     @Excel(name = "连接类型")
     private String devconnType;

+ 47 - 0
src/main/java/com/yunfeiyun/agmp/iot/common/enums/IotDeviceDelStatusEnum.java

@@ -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;
+    }
+}

+ 51 - 0
src/main/java/com/yunfeiyun/agmp/iot/common/enums/IotDeviceStatusTypeEnum.java

@@ -0,0 +1,51 @@
+package com.yunfeiyun.agmp.iot.common.enums;
+
+
+public enum IotDeviceStatusTypeEnum {
+
+    OFFLINE("0", "离线"),
+    ONLINE("1", "在线"),
+
+    FAILURE("2", "故障"),
+    WAIT_ACTIVATE("3", "待激活");
+
+    private String code;
+    private String name;
+
+    private IotDeviceStatusTypeEnum(String code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public static String getNameByCode(String name) {
+        for (IotDeviceStatusTypeEnum item : IotDeviceStatusTypeEnum.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 IotDeviceStatusTypeEnum findEnumByCode(String code) {
+        for (IotDeviceStatusTypeEnum item : IotDeviceStatusTypeEnum.values()) {
+            if (item.getCode().equals(code)) {
+                return item;
+            }
+        }
+        return null;
+    }
+}