修改className移除前缀方法

This commit is contained in:
liu xm 2021-08-06 07:27:17 +08:00
parent 6143930a96
commit de31664917

View File

@ -150,8 +150,8 @@ public class ToolCodegenEngine {
bindingMap.put("simpleModuleName", simpleModuleName); // system 转成 sys bindingMap.put("simpleModuleName", simpleModuleName); // system 转成 sys
bindingMap.put("simpleModuleName_upperFirst", upperFirst(simpleModuleName)); // sys 转成 Sys bindingMap.put("simpleModuleName_upperFirst", upperFirst(simpleModuleName)); // sys 转成 Sys
// className 相关 // className 相关
String simpleClassName = subAfter(table.getClassName(), upperFirst(simpleModuleName) // 去掉指定前缀 TestDictType 转换成 DictType. 因为在 create 等方法后不需要带上 Test 前缀
, false); // TestDictType 转换成 DictType. 因为在 create 等方法后不需要带上 Test 前缀 String simpleClassName = removePrefix(table.getClassName(), upperFirst(simpleModuleName));
bindingMap.put("simpleClassName", simpleClassName); bindingMap.put("simpleClassName", simpleClassName);
bindingMap.put("simpleClassName_underlineCase", toUnderlineCase(simpleClassName)); // DictType 转换成 dict_type bindingMap.put("simpleClassName_underlineCase", toUnderlineCase(simpleClassName)); // DictType 转换成 dict_type
bindingMap.put("classNameVar", lowerFirst(simpleClassName)); // DictType 转换成 dictType用于变量 bindingMap.put("classNameVar", lowerFirst(simpleClassName)); // DictType 转换成 dictType用于变量