mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-09 20:57:21 +08:00
fix(generator): 修复 columnSize 类型错误,兼容无注释字段配置
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
|
||||
package top.continew.admin.generator.model.entity;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.db.meta.Column;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
@@ -83,7 +82,7 @@ public class FieldConfigDO implements Serializable {
|
||||
* 列大小
|
||||
*/
|
||||
@Schema(description = "列大小", example = "255")
|
||||
private String columnSize;
|
||||
private Long columnSize;
|
||||
|
||||
/**
|
||||
* 字段名称
|
||||
@@ -165,7 +164,7 @@ public class FieldConfigDO implements Serializable {
|
||||
this.setTableName(column.getTableName());
|
||||
this.setColumnName(column.getName());
|
||||
this.setColumnType(column.getTypeName());
|
||||
this.setColumnSize(Convert.toStr(column.getSize()));
|
||||
this.setColumnSize(column.getSize());
|
||||
this.setComment(column.getComment());
|
||||
this.setIsRequired(!column.isPk() && !column.isNullable());
|
||||
this.setShowInList(true);
|
||||
@@ -182,4 +181,8 @@ public class FieldConfigDO implements Serializable {
|
||||
String[] arr = StrUtil.splitToArray(columnType, StringConstants.SPACE);
|
||||
this.columnType = arr.length > 1 ? arr[0].toLowerCase() : columnType.toLowerCase();
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = StrUtil.nullToDefault(comment, StringConstants.EMPTY);
|
||||
}
|
||||
}
|
||||
|
@@ -18,7 +18,6 @@ package top.continew.admin.generator.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.ClassUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@@ -157,7 +156,7 @@ public class GeneratorServiceImpl implements GeneratorService {
|
||||
// 更新已有字段配置
|
||||
if (null != fieldConfig.getCreateTime()) {
|
||||
fieldConfig.setColumnType(column.getTypeName());
|
||||
fieldConfig.setColumnSize(Convert.toStr(column.getSize()));
|
||||
fieldConfig.setColumnSize(column.getSize());
|
||||
}
|
||||
String fieldType = typeMappingEntrySet.stream()
|
||||
.filter(entry -> entry.getValue().contains(fieldConfig.getColumnType()))
|
||||
|
@@ -18,7 +18,7 @@ import { Message } from '@arco-design/web-vue'
|
||||
import { useWindowSize } from '@vueuse/core'
|
||||
import { get${classNamePrefix}, add${classNamePrefix}, update${classNamePrefix} } from '@/apis/${apiModuleName}/${apiName}'
|
||||
import { type Columns, GiForm, type Options } from '@/components/GiForm'
|
||||
import { useForm } from '@/hooks'
|
||||
import { useResetReactive } from '@/hooks'
|
||||
import { useDict } from '@/hooks/app'
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -41,7 +41,7 @@ const options: Options = {
|
||||
btns: { hide: true },
|
||||
}
|
||||
|
||||
const { form, resetForm } = useForm({
|
||||
const [form, resetForm] = useResetReactive({
|
||||
// todo 待补充
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user