Browse Source

!60 增加kotlin的entity自定义模板
Merge pull request !60 from ℛℴℊℭℜ_ℓℴ/master

青苗 7 years ago
parent
commit
8e95b1d0cd

+ 8 - 1
mybatis-plus-generator/src/main/java/com/baomidou/mybatisplus/generator/config/TemplateConfig.java

@@ -27,6 +27,8 @@ public class TemplateConfig {
 
 
     private String entity = ConstVal.TEMPLATE_ENTITY_JAVA;
     private String entity = ConstVal.TEMPLATE_ENTITY_JAVA;
 
 
+    private String entityKt = ConstVal.TEMPLATE_ENTITY_KT;
+
     private String service = ConstVal.TEMPLATE_SERVICE;
     private String service = ConstVal.TEMPLATE_SERVICE;
 
 
     private String serviceImpl = ConstVal.TEMPLATE_SERVICE_IMPL;
     private String serviceImpl = ConstVal.TEMPLATE_SERVICE_IMPL;
@@ -38,7 +40,12 @@ public class TemplateConfig {
     private String controller = ConstVal.TEMPLATE_CONTROLLER;
     private String controller = ConstVal.TEMPLATE_CONTROLLER;
 
 
     public String getEntity(boolean kotlin) {
     public String getEntity(boolean kotlin) {
-        return kotlin ? ConstVal.TEMPLATE_ENTITY_KT : entity;
+        return kotlin ? entityKt : entity;
+    }
+
+    public TemplateConfig setEntityKt(String entityKt) {
+        this.entityKt = entityKt;
+        return this;
     }
     }
 
 
     public TemplateConfig setEntity(String entity) {
     public TemplateConfig setEntity(String entity) {