From a95e68ce70063bb16f95bf839372a4145b7606d8 Mon Sep 17 00:00:00 2001 From: zigzag Date: Tue, 31 Jan 2023 20:08:19 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix=20=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yupi/sqlfather/core/model/enums/FieldTypeEnum.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/yupi/sqlfather/core/model/enums/FieldTypeEnum.java b/src/main/java/com/yupi/sqlfather/core/model/enums/FieldTypeEnum.java index 8998ccf..2a0df74 100644 --- a/src/main/java/com/yupi/sqlfather/core/model/enums/FieldTypeEnum.java +++ b/src/main/java/com/yupi/sqlfather/core/model/enums/FieldTypeEnum.java @@ -3,6 +3,8 @@ import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; + +import cn.hutool.core.text.CharSequenceUtil; import org.apache.commons.lang3.StringUtils; /** @@ -70,7 +72,8 @@ public static FieldTypeEnum getEnumByValue(String value) { return null; } for (FieldTypeEnum mockTypeEnum : FieldTypeEnum.values()) { - if (mockTypeEnum.value.equals(value)) { + // 字段类型匹配时忽略长度 + if (mockTypeEnum.value.equals(value.replaceFirst("[(]\\d+[)]", CharSequenceUtil.EMPTY))) { return mockTypeEnum; } } From 057fe26416d3e395024801796680e50ccf3648f7 Mon Sep 17 00:00:00 2001 From: zigzag Date: Tue, 31 Jan 2023 20:50:47 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix=20=E5=AD=97=E6=AE=B5=E6=97=A0=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E6=97=B6Typescript=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/templates/typescript_type.ftl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/resources/templates/typescript_type.ftl b/src/main/resources/templates/typescript_type.ftl index 5499fe8..d414627 100644 --- a/src/main/resources/templates/typescript_type.ftl +++ b/src/main/resources/templates/typescript_type.ftl @@ -5,7 +5,9 @@ interface ${className} { <#-- 循环生成字段 ----------> <#list fieldList as field> + <#if field.comment!?length gt 0> // ${field.comment} + ${field.fieldName}: ${field.typescriptType}; } From 1f1ed19a3d58085bb95f47ffa86cea69342e5b90 Mon Sep 17 00:00:00 2001 From: zigzag Date: Tue, 31 Jan 2023 21:11:53 +0800 Subject: [PATCH 3/3] =?UTF-8?q?Revert=20"fix=20=E5=AD=97=E6=AE=B5=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a95e68ce70063bb16f95bf839372a4145b7606d8. --- .../com/yupi/sqlfather/core/model/enums/FieldTypeEnum.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/com/yupi/sqlfather/core/model/enums/FieldTypeEnum.java b/src/main/java/com/yupi/sqlfather/core/model/enums/FieldTypeEnum.java index 2a0df74..8998ccf 100644 --- a/src/main/java/com/yupi/sqlfather/core/model/enums/FieldTypeEnum.java +++ b/src/main/java/com/yupi/sqlfather/core/model/enums/FieldTypeEnum.java @@ -3,8 +3,6 @@ import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; - -import cn.hutool.core.text.CharSequenceUtil; import org.apache.commons.lang3.StringUtils; /** @@ -72,8 +70,7 @@ public static FieldTypeEnum getEnumByValue(String value) { return null; } for (FieldTypeEnum mockTypeEnum : FieldTypeEnum.values()) { - // 字段类型匹配时忽略长度 - if (mockTypeEnum.value.equals(value.replaceFirst("[(]\\d+[)]", CharSequenceUtil.EMPTY))) { + if (mockTypeEnum.value.equals(value)) { return mockTypeEnum; } }