Jelajahi Sumber

修复文件生成错误.

nieqiurong@163.com 7 tahun lalu
induk
melakukan
693fb2076d

+ 2 - 2
mybatis-plus-generate/build.gradle

@@ -1,7 +1,7 @@
 dependencies {
 	compile project(":mybatis-plus-support")
-	provided rootProject.ext.dependencies["velocity"]
-	provided rootProject.ext.dependencies["freemarker"]
+	optional rootProject.ext.dependencies["velocity"]
+    optional rootProject.ext.dependencies["freemarker"]
 	testCompile rootProject.ext.dependencies["sqlserver"]
 	testCompile rootProject.ext.dependencies["postgresql"]
 	testCompile rootProject.ext.dependencies["oracle"]

+ 2 - 2
mybatis-plus-generate/src/main/java/com/baomidou/mybatisplus/generator/engine/AbstractTemplateEngine.java

@@ -84,10 +84,10 @@ public abstract class AbstractTemplateEngine {
                 String controllerFile = String.format((pathInfo.get(ConstVal.CONTROLLER_PATH) + File.separator + tableInfo.getControllerName() + this.suffixJavaOrKt()), entityName);
                 TemplateConfig template = this.getConfigBuilder().getTemplate();
                 if (this.isCreate(entityFile)) {
-                    this.writer(objectMap, this.templateFilePath(template.getEntity(this.getConfigBuilder().getGlobalConfig().isKotlin())), mapperFile);
+                    this.writer(objectMap, this.templateFilePath(template.getEntity(this.getConfigBuilder().getGlobalConfig().isKotlin())), entityFile);
                 }
                 if (this.isCreate(mapperFile)) {
-                    this.writer(objectMap, this.templateFilePath(template.getMapper()), entityFile);
+                    this.writer(objectMap, this.templateFilePath(template.getMapper()), mapperFile);
                 }
                 if (this.isCreate(xmlFile)) {
                     this.writer(objectMap, this.templateFilePath(template.getXml()), xmlFile);