Commit 1a17e5ecb884fd88de5bf3161ed7ad2f98672a5e
Committed by
Gitee
!39 生成代码类名称不以模块名开头simpleClassName为空
Merge pull request !39 from 夜丶点缀了一个人的落寞/protection-lxm
Showing
1 changed file
with
2 additions
and
2 deletions
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/tool/service/codegen/impl/ToolCodegenEngine.java
| ... | ... | @@ -150,8 +150,8 @@ public class ToolCodegenEngine { |
| 150 | 150 | bindingMap.put("simpleModuleName", simpleModuleName); // 将 system 转成 sys |
| 151 | 151 | bindingMap.put("simpleModuleName_upperFirst", upperFirst(simpleModuleName)); // 将 sys 转成 Sys |
| 152 | 152 | // className 相关 |
| 153 | - String simpleClassName = subAfter(table.getClassName(), upperFirst(simpleModuleName) | |
| 154 | - , false); // 将 TestDictType 转换成 DictType. 因为在 create 等方法后,不需要带上 Test 前缀 | |
| 153 | + // 去掉指定前缀 将 TestDictType 转换成 DictType. 因为在 create 等方法后,不需要带上 Test 前缀 | |
| 154 | + String simpleClassName = removePrefix(table.getClassName(), upperFirst(simpleModuleName)); | |
| 155 | 155 | bindingMap.put("simpleClassName", simpleClassName); |
| 156 | 156 | bindingMap.put("simpleClassName_underlineCase", toUnderlineCase(simpleClassName)); // 将 DictType 转换成 dict_type |
| 157 | 157 | bindingMap.put("classNameVar", lowerFirst(simpleClassName)); // 将 DictType 转换成 dictType,用于变量 | ... | ... |