Quellcode durchsuchen

增加一个自定义配置项兼容项.

https://github.com/baomidou/mybatis-plus/issues/5363
nieqiurong vor 2 Jahren
Ursprung
Commit
469a84e881

+ 2 - 0
mybatis-plus-generator/src/main/java/com/baomidou/mybatisplus/generator/config/InjectionConfig.java

@@ -77,6 +77,8 @@ public class InjectionConfig {
     public void beforeOutputFile(TableInfo tableInfo, Map<String, Object> objectMap) {
         if (!customMap.isEmpty()) {
             objectMap.putAll(customMap);
+            //增加一个兼容兼容取值,推荐还是直接取值外置key即可,例如abc取值${abc}而不需要${cfg.abc}
+            objectMap.put("cfg", customMap);
         }
         if (null != beforeOutputFileBiConsumer) {
             beforeOutputFileBiConsumer.accept(tableInfo, objectMap);