fix:优化业务名称生成逻辑
- 在移除表注释中的"表"字后,增加 trim 操作去除前后空格- 提高了代码生成的准确性和美观性
This commit is contained in:
@@ -80,7 +80,7 @@ public class GenConfigServiceImpl extends ServiceImpl<GenConfigMapper, GenConfig
|
|||||||
|
|
||||||
String tableComment = tableMetadata.getTableComment();
|
String tableComment = tableMetadata.getTableComment();
|
||||||
if (StrUtil.isNotBlank(tableComment)) {
|
if (StrUtil.isNotBlank(tableComment)) {
|
||||||
genConfig.setBusinessName(tableComment.replace("表", ""));
|
genConfig.setBusinessName(tableComment.replace("表", "").trim());
|
||||||
}
|
}
|
||||||
// 实体类名 = 表名去掉前缀后转驼峰,前缀默认为下划线分割的第一个元素
|
// 实体类名 = 表名去掉前缀后转驼峰,前缀默认为下划线分割的第一个元素
|
||||||
String entityName = StrUtil.toCamelCase(StrUtil.removePrefix(tableName, tableName.split("_")[0]));
|
String entityName = StrUtil.toCamelCase(StrUtil.removePrefix(tableName, tableName.split("_")[0]));
|
||||||
|
|||||||
Reference in New Issue
Block a user