Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[错误报告]: 官方文档自定义DTO/VO的示例代码跑不通 #6694

Open
3 tasks done
Lxdtiancai0812 opened this issue Feb 10, 2025 · 1 comment
Open
3 tasks done
Labels

Comments

@Lxdtiancai0812
Copy link

确认

  • 我使用的版本是最新版, 并且使用插件确认过项目里无依赖版本冲突
  • 我已经在 issue 中搜索过, 确认问题没有被提出过
  • 我已经修改标题, 将标题中的 描述 替换为遇到的问题

当前程序版本

3.5.10.1

问题描述

官网文档中描述,自定义配置模版需要继承FreemarkerTemplateEngine并重写outputCustomFile方法,FreemarkerTemplateEngine并没有这个方法,只有FreemarkerTemplateEngine的父类AbstractTemplateEngine才有这个方法,其次,文档中这行String otherPath = this.getPathInfo(OutputFile.other); 现在这个版本跟本没有other这个枚举值。尝试重写AbstractTemplateEngine的outputCustomFile方法也不行,里面的outputFile的入参按照官网文档写的也不行

详细堆栈日志

@nieqiurong
Copy link
Contributor

直接这样就行.

FastAutoGenerator.create(url, username, password).injectionConfig(builder -> {
    builder.customFile(new CustomFile.Builder().fileName("DTO.java").templatePath("templates/dto.java.vm").packageName("dto").build());
})

nieqiurong added a commit to baomidou/mybatis-plus-doc that referenced this issue Feb 10, 2025
@nieqiurong nieqiurong added the doc label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants