Explorar el Código

增加图片地址和协议名称

zhou-hao hace 5 años
padre
commit
eb9a002f6f

+ 7 - 3
jetlinks-manager/device-manager/src/main/java/org/jetlinks/community/device/entity/DeviceInstanceEntity.java

@@ -49,10 +49,14 @@ public class DeviceInstanceEntity extends GenericEntity<String> implements Recor
     private String describe;
 
     @Comment("产品id")
-    @Column(name = "product_id", length = 32)
+    @Column(name = "product_id", length = 64)
     @NotBlank(message = "产品ID不能为空", groups = CreateGroup.class)
     private String productId;
 
+    @Comment("图片地址")
+    @Column(name = "photo_url", length = 1024)
+    private String photoUrl;
+
     @Comment("产品名称")
     @Column(name = "product_name")
     @NotBlank(message = "产品名称不能为空", groups = CreateGroup.class)
@@ -89,11 +93,11 @@ public class DeviceInstanceEntity extends GenericEntity<String> implements Recor
     @Column(name = "registry_time")
     private Long registryTime;
 
-    @Column(name = "org_id", length = 32)
+    @Column(name = "org_id", length = 64)
     @Comment("所属机构id")
     private String orgId;
 
-    @Column(name = "parent_id", length = 32)
+    @Column(name = "parent_id", length = 64)
     @Comment("父级设备ID")
     private String parentId;
 

+ 14 - 2
jetlinks-manager/device-manager/src/main/java/org/jetlinks/community/device/entity/DeviceProductEntity.java

@@ -40,9 +40,13 @@ public class DeviceProductEntity extends GenericEntity<String> implements Record
     private String name;
 
     @Comment("所属项目")
-    @Column(name = "project_id",length = 32)
+    @Column(name = "project_id",length = 64)
     private String projectId;
 
+    @Comment("图片地址")
+    @Column(name = "photo_url", length = 1024)
+    private String photoUrl;
+
     @Comment("项目名称")
     @Column(name = "project_name")
     private String projectName;
@@ -52,9 +56,13 @@ public class DeviceProductEntity extends GenericEntity<String> implements Record
     private String describe;
 
     @Comment("分类ID")
-    @Column(name = "classified_id")
+    @Column(name = "classified_id",length = 64)
     private String classifiedId;
 
+    @Column
+    @Comment("分类名称")
+    private String classifiedName;
+
     @Comment("消息协议: Alink,JetLinks")
     @Column(name = "message_protocol")
     @NotBlank(message = "消息协议不能为空",groups = CreateGroup.class)
@@ -63,6 +71,10 @@ public class DeviceProductEntity extends GenericEntity<String> implements Record
     })
     private String messageProtocol;
 
+    @Column
+    @Comment("协议名称")
+    private String protocolName;
+
     @Comment("协议元数据")
     @Column(name = "metadata")
     @ColumnType(jdbcType = JDBCType.CLOB)

+ 8 - 1
jetlinks-manager/device-manager/src/main/java/org/jetlinks/community/device/response/DeviceDetail.java

@@ -27,9 +27,15 @@ public class DeviceDetail {
     //设备名称
     private String name;
 
+    //设备图片
+    private String photoUrl;
+
     //消息协议标识
     private String protocol;
 
+    //协议名称
+    private String protocolName;
+
     //通信协议
     private String transport;
 
@@ -132,10 +138,11 @@ public class DeviceDetail {
         }
         setProtocol(productEntity.getMessageProtocol());
         setTransport(productEntity.getTransportProtocol());
-
+        setPhotoUrl(productEntity.getPhotoUrl());
         setProductId(productEntity.getId());
         setProductName(productEntity.getName());
         setDeviceType(productEntity.getDeviceType());
+        setProtocolName(productEntity.getProtocolName());
         return this;
     }