fix: 修改自动生成代码的存放路径

This commit is contained in:
weihongyang 2022-06-21 15:52:06 +08:00
parent 111473f057
commit 7b1365b5cd
2 changed files with 4 additions and 4 deletions

View File

@ -48,8 +48,8 @@ public class CodeGenerator {
}) })
.packageConfig(builder -> { .packageConfig(builder -> {
//设置父包名 //设置父包名
builder.parent("com.cnbm") builder.parent("com.cnbm.generator")
.moduleName("generator") .moduleName("code")
.service("service") .service("service")
.serviceImpl("service.impl") .serviceImpl("service.impl")
.entity("entity") .entity("entity")

View File

@ -24,10 +24,10 @@ public class EnhanceVelocityTemplateEngine extends VelocityTemplateEngine {
customFile.forEach((key, value) -> { customFile.forEach((key, value) -> {
String fileName = ""; String fileName = "";
if ("DTO".equals(key)) { if ("DTO".equals(key)) {
fileName = String.format((path+ File.separator +"src/main/java/com/cnbm/generator"+ File.separator + "dto" + File.separator + entityName + "%s" + ".java"), key); fileName = String.format((path+ File.separator +"src/main/java/com/cnbm/generator/code"+ File.separator + "dto" + File.separator + entityName + "%s" + ".java"), key);
} }
if ("Excel".equals(key)) { if ("Excel".equals(key)) {
fileName = String.format((path+ File.separator +"src/main/java/com/cnbm/generator"+ File.separator + "excel" + File.separator + entityName + "%s" + ".java"), key); fileName = String.format((path+ File.separator +"src/main/java/com/cnbm/generator/code"+ File.separator + "excel" + File.separator + entityName + "%s" + ".java"), key);
} }
this.outputFile(new File(fileName), objectMap, value); this.outputFile(new File(fileName), objectMap, value);
}); });