Skip to content

Commit 02e3e67

Browse files
author
hewei
committed
issues#81: 修正全局注释配置不生效的问题
1 parent c2746d9 commit 02e3e67

File tree

5 files changed

+191
-111
lines changed

5 files changed

+191
-111
lines changed

src/main/java/com/itfsw/mybatis/generator/plugins/utils/BasePlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ public void setContext(Context context) {
6868
if (cfg == null || cfg.getProperty(CommentPlugin.PRO_TEMPLATE) == null) {
6969
if (context.getCommentGenerator() instanceof DefaultCommentGenerator) {
7070
// 使用默认模板引擎
71-
commentGenerator = new TemplateCommentGenerator("default-comment.ftl", true);
71+
commentGenerator = new TemplateCommentGenerator(context, "default-comment.ftl", true);
7272
} else {
7373
// 用户自定义
7474
commentGenerator = context.getCommentGenerator();
7575
}
7676
} else {
77-
TemplateCommentGenerator templateCommentGenerator = new TemplateCommentGenerator(cfg.getProperty(CommentPlugin.PRO_TEMPLATE), false);
77+
TemplateCommentGenerator templateCommentGenerator = new TemplateCommentGenerator(context, cfg.getProperty(CommentPlugin.PRO_TEMPLATE), false);
7878

7979
// ITFSW 插件使用的注释生成器
8080
commentGenerator = templateCommentGenerator;

0 commit comments

Comments
 (0)