From 7991d6858650800e4775bd063c34c83f965cd145 Mon Sep 17 00:00:00 2001 From: chaocloud <840558273@qq.com> Date: Wed, 24 Nov 2021 15:05:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=B7=A5=E5=85=B7java=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/tool/service/codegen/impl/ToolCodegenEngine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/tool/service/codegen/impl/ToolCodegenEngine.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/tool/service/codegen/impl/ToolCodegenEngine.java index 94b114f94..44c95603f 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/tool/service/codegen/impl/ToolCodegenEngine.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/tool/service/codegen/impl/ToolCodegenEngine.java @@ -191,7 +191,7 @@ public class ToolCodegenEngine { } private static String javaFilePath(String path) { - return "java/${basePackage}/${table.moduleName}/" + path + ".java"; + return "java/${basePackage}/modules/${table.moduleName}/" + path + ".java"; } private static String vueTemplatePath(String path) { From b66d84535490824a27a75875218c5f678f177a78 Mon Sep 17 00:00:00 2001 From: chaocloud <840558273@qq.com> Date: Wed, 24 Nov 2021 15:08:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=B7=A5=E5=85=B7=EF=BC=8C=E5=BD=93=E8=A1=A8?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C=E6=A0=B9?= =?UTF-8?q?=E6=8D=AESQL=E5=AF=BC=E5=85=A5=E5=A4=B1=E8=B4=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tool/service/codegen/impl/ToolCodegenSQLParser.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/tool/service/codegen/impl/ToolCodegenSQLParser.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/tool/service/codegen/impl/ToolCodegenSQLParser.java index bb664a1d5..d9f253881 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/tool/service/codegen/impl/ToolCodegenSQLParser.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/tool/service/codegen/impl/ToolCodegenSQLParser.java @@ -64,10 +64,17 @@ public class ToolCodegenSQLParser { private static ToolSchemaTableDO parseTable(SQLCreateTableStatement statement) { return ToolSchemaTableDO.builder() .tableName(statement.getTableSource().getTableName(true)) - .tableComment(((SQLCharExpr) statement.getComment()).getText()) + .tableComment(getCommentText(statement)) .build(); } + private static String getCommentText(SQLCreateTableStatement statement) { + if (statement == null || statement.getComment() == null) { + return ""; + } + return ((SQLCharExpr) statement.getComment()).getText(); + } + private static List parseColumns(SQLCreateTableStatement statement) { List columns = new ArrayList<>(); statement.getTableElementList().forEach(element -> parseColumn(columns, element));