|
|
@@ -0,0 +1,84 @@
|
|
|
+package org.jetlinks.community.device.entity;
|
|
|
+
|
|
|
+import io.swagger.v3.oas.annotations.media.Schema;
|
|
|
+import lombok.Data;
|
|
|
+import org.hswebframework.ezorm.rdb.mapping.annotation.ColumnType;
|
|
|
+import org.hswebframework.web.validator.CreateGroup;
|
|
|
+import org.jetlinks.community.device.enums.GeoType;
|
|
|
+
|
|
|
+import javax.persistence.Column;
|
|
|
+import javax.persistence.Index;
|
|
|
+import javax.persistence.Table;
|
|
|
+import javax.validation.constraints.NotBlank;
|
|
|
+import java.io.Serializable;
|
|
|
+import java.sql.JDBCType;
|
|
|
+import java.util.*;
|
|
|
+/**
|
|
|
+ * @author lifang
|
|
|
+ * @version 1.0.0
|
|
|
+ * @ClassName GeoEntity.java
|
|
|
+ * @Description TODO
|
|
|
+ * @createTime 2021年09月27日 10:54:00
|
|
|
+ */
|
|
|
+@Data
|
|
|
+@Table(name = "geo")
|
|
|
+public class GeoEntity {
|
|
|
+
|
|
|
+ @Column(length = 64, nullable = false, updatable = false)
|
|
|
+ @Schema(description = "地图信息")
|
|
|
+ private String type;
|
|
|
+
|
|
|
+ @Column(name = "gemoetry")
|
|
|
+ @NotBlank(message = "地图信息不为空", groups = CreateGroup.class)
|
|
|
+ @ColumnType(jdbcType = JDBCType.CLOB,javaType = Geometry.class)
|
|
|
+ @Schema(description = "地图信息")
|
|
|
+ private Geometry geometry;
|
|
|
+
|
|
|
+ @Column(name="properties")
|
|
|
+ @NotBlank(message = "实体属性不能为空", groups = CreateGroup.class)
|
|
|
+ @ColumnType(jdbcType = JDBCType.CLOB,javaType = Property.class)
|
|
|
+ @Schema(description = "实体属性")
|
|
|
+ private Property properties;
|
|
|
+
|
|
|
+
|
|
|
+ @Data
|
|
|
+ public static class Geometry implements Serializable {
|
|
|
+ private GeoType type;
|
|
|
+ private List<Object> coordinates;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Data
|
|
|
+ public static class Property implements Serializable{
|
|
|
+
|
|
|
+ private String id;
|
|
|
+
|
|
|
+ private String name;
|
|
|
+
|
|
|
+ private String objectId;
|
|
|
+
|
|
|
+ private String objectType;
|
|
|
+
|
|
|
+ private List<String > acroutes;
|
|
|
+
|
|
|
+ private String adcode;
|
|
|
+
|
|
|
+ private List<String > center;
|
|
|
+
|
|
|
+ private List<String > centroid;
|
|
|
+
|
|
|
+ private int childrenNum;
|
|
|
+
|
|
|
+ private Map<String,Object> parent;
|
|
|
+
|
|
|
+ private String parentId;
|
|
|
+
|
|
|
+ private String deviceName;
|
|
|
+
|
|
|
+ private String from;
|
|
|
+
|
|
|
+ private String productId;
|
|
|
+
|
|
|
+ private String productName;
|
|
|
+ }
|
|
|
+}
|