Просмотр исходного кода

feat(infra): 为 codegen 服务添加简单类名的大小写变量

- 在 CodegenEngine 中添加 lowercase 和 uppercase 版本的 simpleClassName
- 新增 lowsimpleClassName 和 upsimpleClassName 变量,分别存储小写和大写版本的简单类名
zrd 3 месяцев назад
Родитель
Сommit
073b25514f

+ 2 - 0
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java

@@ -459,6 +459,8 @@ public class CodegenEngine {
         String simpleClassName = equalsAnyIgnoreCase(table.getClassName(), table.getModuleName()) ? table.getClassName()
                 : removePrefix(table.getClassName(), upperFirst(table.getModuleName()));
         bindingMap.put("simpleClassName", simpleClassName);
+        bindingMap.put("lowsimpleClassName", simpleClassName.toLowerCase());
+        bindingMap.put("upsimpleClassName", simpleClassName.toUpperCase());
         bindingMap.put("simpleClassName_underlineCase", toUnderlineCase(simpleClassName)); // 将 DictType 转换成 dict_type
         bindingMap.put("classNameVar", lowerFirst(simpleClassName)); // 将 DictType 转换成 dictType,用于变量
         // 将 DictType 转换成 dict-type