diff --git a/src/main/java/com/muyu/domain/DataStructure.java b/src/main/java/com/muyu/domain/DataStructure.java index 664028b..df260eb 100644 --- a/src/main/java/com/muyu/domain/DataStructure.java +++ b/src/main/java/com/muyu/domain/DataStructure.java @@ -1,5 +1,6 @@ package com.muyu.domain; +import com.muyu.enums.DataType; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -16,9 +17,20 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @NoArgsConstructor public class DataStructure { - - private String name; - private Object type; + /** + * 字段名 + */ + private String key; + /** + * 字段类型 + */ + private String type; + /** + * 描述 + */ private String label; - private Object value; + /** + * 值 + */ + private DataType value; } diff --git a/src/main/java/com/muyu/enums/DataType.java b/src/main/java/com/muyu/enums/DataType.java new file mode 100644 index 0000000..3571cfa --- /dev/null +++ b/src/main/java/com/muyu/enums/DataType.java @@ -0,0 +1,59 @@ +package com.muyu.enums; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @Author WangXin + * @Data 2024/8/28 + * @Description 数据类型枚举 + * @Version 1.0.0 + */ +public enum DataType { + + STRING( + new String[]{"char", "varchar", "text", "mediumtext", "longtext", "longblob"}, + String.class + ), + INTEGER( + new String[]{"int", "tinyint"}, + Integer.class + ), + DATE( + new String[]{"date", "datetime","timestamp"}, + Date.class + ), + BIG_DECIMAL( + new String[]{"decimal", "double", "float"}, + BigDecimal.class + ), + LONG( + new String[]{"bigint"}, + Long.class + ); + + private String[] sourceType; + + private Class targetType; + + DataType(String[] sourceType, Class targetType) { + this.sourceType = sourceType; + this.targetType = targetType; + } + + public String[] getSourceType() { + return sourceType; + } + + public void setSourceType(String[] sourceType) { + this.sourceType = sourceType; + } + + public Class getTargetType() { + return targetType; + } + + public void setTargetType(Class targetType) { + this.targetType = targetType; + } +}