Skip to content

Commit

Permalink
fix: 修复代码生成 text 类型数据的长度校验时,数值显示为 65,535 的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Feb 22, 2024
1 parent 17fc526 commit 8026f66
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package top.charles7c.continew.admin.tool.model.entity;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import cn.hutool.db.meta.Column;
import cn.hutool.setting.dialect.Props;
Expand Down Expand Up @@ -76,7 +77,7 @@ public class FieldConfigDO implements Serializable {
* 列大小
*/
@Schema(description = "列大小", example = "255")
private Long columnSize;
private String columnSize;

/**
* 字段名称
Expand Down Expand Up @@ -146,7 +147,7 @@ public FieldConfigDO(@NonNull Column column) {
this.setTableName(column.getTableName());
this.setColumnName(column.getName());
this.setColumnType(StrUtil.splitToArray(column.getTypeName(), StringConstants.SPACE)[0].toLowerCase());
this.setColumnSize(column.getSize());
this.setColumnSize(Convert.toStr(column.getSize()));
this.setComment(column.getComment());
this.setIsRequired(!column.isPk() && !column.isNullable());
this.setShowInList(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.file.FileNameUtil;
Expand Down Expand Up @@ -149,7 +150,7 @@ public List<FieldConfigDO> listFieldConfig(String tableName, Boolean requireSync
String columnType = StrUtil.splitToArray(column.getTypeName(), StringConstants.SPACE)[0]
.toLowerCase();
fieldConfig.setColumnType(columnType);
fieldConfig.setColumnSize(column.getSize());
fieldConfig.setColumnSize(Convert.toStr(column.getSize()));
fieldConfig.setComment(column.getComment());
} else {
// 新增字段配置
Expand Down

0 comments on commit 8026f66

Please sign in to comment.