|
|
@@ -3,6 +3,7 @@ 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.api.crud.entity.GenericEntity;
|
|
|
import org.hswebframework.web.validator.CreateGroup;
|
|
|
import org.jetlinks.community.device.enums.GeoType;
|
|
|
|
|
|
@@ -10,40 +11,42 @@ import javax.persistence.Column;
|
|
|
import javax.persistence.Index;
|
|
|
import javax.persistence.Table;
|
|
|
import javax.validation.constraints.NotBlank;
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
import java.io.Serializable;
|
|
|
import java.sql.JDBCType;
|
|
|
import java.util.*;
|
|
|
/**
|
|
|
* @author lifang
|
|
|
* @version 1.0.0
|
|
|
- * @ClassName GeoEntity.java
|
|
|
+ * @ClassName GeoFeature.java
|
|
|
* @Description TODO
|
|
|
* @createTime 2021年09月27日 10:54:00
|
|
|
*/
|
|
|
@Data
|
|
|
@Table(name = "geo")
|
|
|
-public class GeoEntity {
|
|
|
+public class GeoEntity implements Serializable{
|
|
|
|
|
|
- @Column(length = 64, nullable = false, updatable = false)
|
|
|
- @Schema(description = "地图信息")
|
|
|
+ @Column(name = "type")
|
|
|
+ @NotNull(message = "类型不为空", groups = CreateGroup.class)
|
|
|
+ @Schema(description = "类型")
|
|
|
private String type;
|
|
|
|
|
|
@Column(name = "gemoetry")
|
|
|
- @NotBlank(message = "地图信息不为空", groups = CreateGroup.class)
|
|
|
- @ColumnType(jdbcType = JDBCType.CLOB,javaType = Geometry.class)
|
|
|
+ @NotNull(message = "地图信息不为空", groups = CreateGroup.class)
|
|
|
+ @ColumnType(jdbcType = JDBCType.VARCHAR,javaType = Geometry.class)
|
|
|
@Schema(description = "地图信息")
|
|
|
private Geometry geometry;
|
|
|
|
|
|
@Column(name="properties")
|
|
|
- @NotBlank(message = "实体属性不能为空", groups = CreateGroup.class)
|
|
|
- @ColumnType(jdbcType = JDBCType.CLOB,javaType = Property.class)
|
|
|
+ @NotNull(message = "实体属性不能为空", groups = CreateGroup.class)
|
|
|
+ @ColumnType(jdbcType = JDBCType.VARCHAR,javaType = Property.class)
|
|
|
@Schema(description = "实体属性")
|
|
|
private Property properties;
|
|
|
|
|
|
|
|
|
@Data
|
|
|
public static class Geometry implements Serializable {
|
|
|
- private GeoType type;
|
|
|
+ private String type;
|
|
|
private List<Object> coordinates;
|
|
|
}
|
|
|
|