提交 f19d799d authored 作者: ww1xhqc's avatar ww1xhqc

model layer 更新详细信息,字段修改

上级 21c81f3f
......@@ -28,7 +28,6 @@ public class ColumnInfo extends BaseEntity {
* 是否primary key, 0是,1否
*/
@ApiModelProperty("是否主键")
@Column(name = "primary_key")
private Integer primaryKey;
@ApiModelProperty("列名")
......
package com.tykj.workflowcore.model_layer.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
......@@ -9,13 +11,19 @@ import lombok.Data;
* @Date 2021/3/1 9:58
* @Version 1.0
*/
@ApiModel("列信息")
@Data
public class ColumnVO {
private String filedType;
@ApiModelProperty("是否主键")
private Integer primaryKey = 1;
@ApiModelProperty("字段类型")
private String fieldType;
@ApiModelProperty("字段名")
private String fieldName;
private String filedDescription;
private Integer filedLength;
private Integer primaryKey=1;
@ApiModelProperty("中文描述")
private String fieldDescription;
@ApiModelProperty("字段长度,有默认值")
private Integer fieldLength;
}
......@@ -50,6 +50,8 @@ public class TableInfo extends BaseEntity implements Serializable {
@ApiModelProperty("执行人(保留字段)")
private String reviser;
@ApiModelProperty("父表名称")
private String parentTable;
@Lob
@ApiModelProperty("表对应hbm.xml")
......
......@@ -2,6 +2,8 @@ package com.tykj.workflowcore.model_layer.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
......@@ -13,11 +15,19 @@ import java.util.List;
* @Date 2021/3/1 9:56
* @Version 1.0
*/
@ApiModel("表信息")
@Data
public class TableVO {
@ApiModelProperty("中文描述")
private String modelTitle;
@ApiModelProperty("表名")
private String modelName;
@ApiModelProperty("模型类型")
private Integer modelType;
@ApiModelProperty("父表名称")
private String parentTable;
@ApiModelProperty("列数组")
private List<ColumnVO> dataList;
}
......@@ -128,9 +128,9 @@ public class ModelImpl implements ModelService {
for (ColumnVO columnVO : dataList) {
ColumnInfo columnInfo = new ColumnInfo();
columnInfo.setName(columnVO.getFieldName());
columnInfo.setType(columnVO.getFiledType());
columnInfo.setLength(columnVO.getFiledLength());
columnInfo.setCnName(columnVO.getFiledDescription());
columnInfo.setType(columnVO.getFieldType());
columnInfo.setLength(columnVO.getFieldLength());
columnInfo.setCnName(columnVO.getFieldDescription());
columnInfo.setDbName(tableInfo.getCnName());
columnInfo.setDbId(tableInfo.getId());
columnInfoDao.save(columnInfo);
......@@ -264,7 +264,7 @@ public class ModelImpl implements ModelService {
if (declaredField.isAnnotationPresent(javax.persistence.Id.class)){
columnVO.setPrimaryKey(0);
}
columnVO.setFiledType(getTypeName(genericType.toString()));
columnVO.setFieldType(getTypeName(genericType.toString()));
columnVO.setFieldName(getClassName(declaredField.toString()));
//获得属性中文描述
......@@ -278,9 +278,9 @@ public class ModelImpl implements ModelService {
apiModelPropertyDocument.append(annotation.example() + "|");
}
columnVO.setFiledDescription(apiModelPropertyDocument.toString());
columnVO.setFieldDescription(apiModelPropertyDocument.toString());
} else {
columnVO.setFiledDescription("无描述");
columnVO.setFieldDescription("无描述");
}
list.add(columnVO);
}
......@@ -297,9 +297,9 @@ public class ModelImpl implements ModelService {
for (ColumnVO columnVO : dataList) {
ColumnInfo columnInfo = new ColumnInfo();
columnInfo.setName(columnVO.getFieldName());
columnInfo.setType(columnVO.getFiledType());
columnInfo.setLength(columnVO.getFiledLength());
columnInfo.setCnName(columnVO.getFiledDescription());
columnInfo.setType(columnVO.getFieldType());
columnInfo.setLength(columnVO.getFieldLength());
columnInfo.setCnName(columnVO.getFieldDescription());
columnInfo.setPrimaryKey(columnVO.getPrimaryKey());
//暂定 简单类型
if ("class java.lang.String".equals(genericType.toString())){
......
......@@ -47,7 +47,7 @@ public class CreatTableUtil {
" </id>";
for (ColumnVO columnVO : dataList) {
xmlMapping +=
" <property type=\"" + columnVO.getFiledType() + "\" name=\"" + columnVO.getFieldName() +
" <property type=\"" + columnVO.getFieldType() + "\" name=\"" + columnVO.getFieldName() +
"\" column=\"" + columnVO.getFieldName() + "\"/>\n";
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论