fix:优化业务名称生成逻辑

- 在移除表注释中的"表"字后,增加 trim 操作去除前后空格- 提高了代码生成的准确性和美观性
This commit is contained in:
Ky10
2024-10-28 19:14:59 +08:00
parent 017a15aa33
commit 864006aec3

View File

@@ -80,7 +80,7 @@ public class GenConfigServiceImpl extends ServiceImpl<GenConfigMapper, GenConfig
String tableComment = tableMetadata.getTableComment();
if (StrUtil.isNotBlank(tableComment)) {
genConfig.setBusinessName(tableComment.replace("", ""));
genConfig.setBusinessName(tableComment.replace("", "").trim());
}
// 实体类名 = 表名去掉前缀后转驼峰,前缀默认为下划线分割的第一个元素
String entityName = StrUtil.toCamelCase(StrUtil.removePrefix(tableName, tableName.split("_")[0]));