Browse Source

Merge pull request #5382 from nieqiurong/fix_5363

增加一个自定义配置项兼容项.
qmdx 2 năm trước cách đây
mục cha
commit
bfa82e03eb

+ 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);