聂秋荣 7 years ago
parent
commit
14ab63aac8

+ 2 - 2
mybatis-plus-generate/src/main/resources/templates/controller.java.ftl

@@ -25,7 +25,7 @@ import ${superControllerClassPackage};
 <#else>
 @Controller
 </#if>
-@RequestMapping("<#if package.ModuleName??>/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle??>)${controllerMappingHyphen??}<#else>${table.entityPath}</#if>")
+@RequestMapping("<#if package.ModuleName??>/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if>")
 <#if kotlin>
 class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}()</#if>
 <#else>
@@ -36,4 +36,4 @@ public class ${table.controllerName} {
 
 }
 </#if>
-</#if>
+</#if>

+ 3 - 6
mybatis-plus-generate/src/main/resources/templates/entity.java.ftl

@@ -39,14 +39,13 @@ public class ${entity} implements Serializable {
 </#if>
 
     private static final long serialVersionUID = 1L;
-
 <#-- ----------  BEGIN 字段循环遍历  ---------->
 <#list table.fields as field>
 <#if field.keyFlag>
 <#assign keyPropertyName="${field.propertyName}"/>
 </#if>
 
-<#if field.comment??>
+<#if field.comment!?length gt 0>
     /**
      * ${field.comment}
      */
@@ -55,12 +54,11 @@ public class ${entity} implements Serializable {
 <#-- 主键 -->
 <#if field.keyIdentityFlag>
     @TableId(value = "${field.name}", type = IdType.AUTO)
-<#elseif idType!>
+<#elseif idType??>
     @TableId(value = "${field.name}", type = IdType.${idType})
 <#elseif field.convert>
     @TableId("${field.name}")
 </#if>
-
 <#-- 普通字段 -->
 <#elseif field.fill??>
 <#-- -----   存在字段填充设置   ----->
@@ -81,7 +79,6 @@ public class ${entity} implements Serializable {
     @TableLogic
 </#if>
     private ${field.propertyType} ${field.propertyName};
-
 </#list>
 <#------------  END 字段循环遍历  ---------->
 
@@ -111,7 +108,7 @@ public class ${entity} implements Serializable {
 
 <#if entityColumnConstant>
 <#list table.fields as field>
-    public static final String ${field.name.toUpperCase()} = "${field.name}";
+    public static final String ${field.name?upper_case} = "${field.name}";
 
 </#list>
 </#if>

+ 2 - 1
mybatis-plus-generate/src/main/resources/templates/entity.kt.ftl

@@ -28,7 +28,8 @@ class ${entity} : Serializable {
 <#if field.keyFlag>
     <#assign keyPropertyName="${field.propertyName}"/>
 </#if>
-<#if field.comment??>
+
+<#if field.comment!?length gt 0>
     /**
      * ${field.comment}
      */