!990 模块名称和表名称一样时,代码生成存在问题,如“shop”模块的“shop”表生成代码时shop都被移除了

Merge pull request !990 from 山野羡民/master
This commit is contained in:
芋道源码 2024-06-15 10:03:07 +00:00 committed by Gitee
commit 034cf3fabf
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 1 deletions

View File

@ -342,7 +342,8 @@ public class CodegenEngine {
// className 相关
// 去掉指定前缀 TestDictType 转换成 DictType. 因为在 create 等方法后不需要带上 Test 前缀
String simpleClassName = removePrefix(table.getClassName(), upperFirst(table.getModuleName()));
String simpleClassName = equalsAnyIgnoreCase(table.getClassName(), table.getModuleName()) ? table.getClassName()
: removePrefix(table.getClassName(), upperFirst(table.getModuleName()));
bindingMap.put("simpleClassName", simpleClassName);
bindingMap.put("simpleClassName_underlineCase", toUnderlineCase(simpleClassName)); // DictType 转换成 dict_type
bindingMap.put("classNameVar", lowerFirst(simpleClassName)); // DictType 转换成 dictType用于变量