修改数据结构,并添加数据类型枚举
parent
8721f7a8be
commit
8a3a6d3162
|
@ -1,5 +1,6 @@
|
||||||
package com.muyu.domain;
|
package com.muyu.domain;
|
||||||
|
|
||||||
|
import com.muyu.enums.DataType;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -16,9 +17,20 @@ import lombok.NoArgsConstructor;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class DataStructure {
|
public class DataStructure {
|
||||||
|
/**
|
||||||
private String name;
|
* 字段名
|
||||||
private Object type;
|
*/
|
||||||
|
private String key;
|
||||||
|
/**
|
||||||
|
* 字段类型
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
private String label;
|
private String label;
|
||||||
private Object value;
|
/**
|
||||||
|
* 值
|
||||||
|
*/
|
||||||
|
private DataType value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue