diff --git a/img.png b/img.png new file mode 100644 index 000000000..0e0c73ca1 Binary files /dev/null and b/img.png differ 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) { 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)); diff --git a/更新日志.md b/更新日志.md index 14f95b04f..3aadf5bec 100644 --- a/更新日志.md +++ b/更新日志.md @@ -33,7 +33,8 @@ ### 🐞 Bug Fixes -* 【修复】通知和字典查询权限 Bug +* 【修复】通知和字典查询权限 +* 【修复】代码生成器的 Java 类路径缺少 modules 目录的 Bug ### 🔨 Dependency Upgrades