From 36be457be2805815911fe4e4c2a2e09d75fe68e3 Mon Sep 17 00:00:00 2001 From: Suomm <1474983351@qq.com> Date: Thu, 22 Jun 2023 13:04:15 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E5=8F=96=E6=B6=88=20append=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E9=87=8C=E9=9D=A2=E4=BD=BF=E7=94=A8=E5=8A=A0?= =?UTF-8?q?=E5=8F=B7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatisflex/codegen/entity/Column.java | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/entity/Column.java b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/entity/Column.java index af87d4d8..fee791eb 100644 --- a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/entity/Column.java +++ b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/entity/Column.java @@ -139,10 +139,9 @@ public class Column { if (StringUtil.isBlank(comment)) { return ""; } else { - StringBuilder sb = new StringBuilder("/**\n") - .append(" * ").append(comment).append("\n") - .append(" */"); - return sb.toString(); + return "/**\n" + + " * " + comment + "\n" + + " */"; } } @@ -163,19 +162,19 @@ public class Column { annotations.append("keyType = KeyType.Auto"); needComma = true; } else if (columnConfig.getKeyType() != null) { - annotations.append("keyType = KeyType." + columnConfig.getKeyType().name()); + annotations.append("keyType = KeyType.").append(columnConfig.getKeyType().name()); needComma = true; } if (columnConfig.getKeyValue() != null) { addComma(annotations, needComma); - annotations.append("value = \"" + columnConfig.getKeyValue() + "\""); + annotations.append("value = \"").append(columnConfig.getKeyValue()).append("\""); needComma = true; } if (columnConfig.getKeyBefore() != null) { addComma(annotations, needComma); - annotations.append("before = " + columnConfig.getKeyBefore()); + annotations.append("before = ").append(columnConfig.getKeyBefore()); } if (annotations.length() == 4) { @@ -199,43 +198,43 @@ public class Column { annotations.append("@Column("); boolean needComma = false; if (needGenColumnAnnotation) { - annotations.append("value = \"" + name + "\""); + annotations.append("value = \"").append(name).append("\""); needComma = true; } if (columnConfig.getOnInsertValue() != null) { addComma(annotations, needComma); - annotations.append("onInsertValue = \"" + columnConfig.getOnInsertValue() + "\""); + annotations.append("onInsertValue = \"").append(columnConfig.getOnInsertValue()).append("\""); needComma = true; } if (columnConfig.getOnUpdateValue() != null) { addComma(annotations, needComma); - annotations.append("onUpdateValue = \"" + columnConfig.getOnUpdateValue() + "\""); + annotations.append("onUpdateValue = \"").append(columnConfig.getOnUpdateValue()).append("\""); needComma = true; } if (columnConfig.getLarge() != null) { addComma(annotations, needComma); - annotations.append("isLarge = " + columnConfig.getLarge()); + annotations.append("isLarge = ").append(columnConfig.getLarge()); needComma = true; } if (columnConfig.getLogicDelete() != null) { addComma(annotations, needComma); - annotations.append("isLogicDelete = " + columnConfig.getLogicDelete()); + annotations.append("isLogicDelete = ").append(columnConfig.getLogicDelete()); needComma = true; } if (columnConfig.getVersion() != null) { addComma(annotations, needComma); - annotations.append("version = " + columnConfig.getVersion()); + annotations.append("version = ").append(columnConfig.getVersion()); needComma = true; } if (columnConfig.getJdbcType() != null) { addComma(annotations, needComma); - annotations.append("jdbcType = JdbcType." + columnConfig.getJdbcType().name()); + annotations.append("jdbcType = JdbcType.").append(columnConfig.getJdbcType().name()); needComma = true; } if (columnConfig.getTypeHandler() != null) { addComma(annotations, needComma); - annotations.append("typeHandler = " + columnConfig.getTypeHandler().getSimpleName() + ".class"); + annotations.append("typeHandler = ").append(columnConfig.getTypeHandler().getSimpleName()).append(".class"); needComma = true; } if (Boolean.TRUE.equals(columnConfig.getTenantId())) { @@ -247,7 +246,7 @@ public class Column { //@ColumnMask 注解 if (columnConfig.getMask() != null) { - annotations.append("@ColumnMask(\"" + columnConfig.getMask() + "\")"); + annotations.append("@ColumnMask(\"").append(columnConfig.getMask()).append("\")"); } String result = annotations.toString();