Jelajahi Sumber

修复Freemarker生成Kotlin类的常量错误.

https://github.com/baomidou/mybatis-plus/issues/2021
聂秋秋 5 tahun lalu
induk
melakukan
3611d9affe

+ 1 - 1
build.gradle

@@ -3,7 +3,7 @@ import java.text.SimpleDateFormat
 buildscript {
     repositories {
         maven { url "https://maven.aliyun.com/nexus/content/groups/public" }
-        maven { url "http://maven.aliyun.com/nexus/content/repositories/gradle-plugin" }
+        maven { url "https://maven.aliyun.com/nexus/content/repositories/gradle-plugin" }
         mavenCentral()
         maven { url "https://plugins.gradle.org/m2/" }
     }

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

@@ -19,7 +19,7 @@ import io.swagger.annotations.ApiModelProperty;
 @TableName("${table.name}")
 </#if>
 <#if swagger2>
-    @ApiModel(value="${entity}对象", description="${table.comment!}")
+@ApiModel(value="${entity}对象", description="${table.comment!}")
 </#if>
 <#if superEntityClass??>
 class ${entity} : ${superEntityClass}<#if activeRecord><${entity}></#if> {
@@ -85,7 +85,7 @@ class ${entity} : Serializable {
     companion object {
 <#list table.fields as field>
 
-        const val ${field.name.toUpperCase()} : String = "${field.name}"
+        const val ${field.name?upper_case} : String = "${field.name}"
 
 </#list>
     }