Skip to content

Commit e97c6c1

Browse files
author
moshowgame
committed
修复包含comment关键字时注释无法识别的问题。(感谢@1nchaos的反馈)
1 parent 808da25 commit e97c6c1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
|更新日期|更新内容|
2929
|-|-|
30-
|20200517|1.代码重构!异常处理优化,Freemarker相关工具类优化,简化模板生成部分,通过template.json来配置需要生成的模板,不需要配置java文件。|
30+
|20200517|1.代码重构!异常处理优化,Freemarker相关工具类优化,简化模板生成部分,通过template.json来配置需要生成的模板,不需要配置java文件。 2.修复包含comment关键字时注释无法识别的问题。(感谢@1nchaos的反馈)|
3131
|20200503|1.优化对特殊字符的处理,对于包含#和$等特殊字符的,在模板使用井和¥代替便可,escapeString方法会自动处理<br> 2.优化mybatisplus实体类相关(感谢@chunchengmeigui的反馈) 3.修优化对所有类型的判断(感谢@cnlw的反馈) 4.移除swagger-entity,该功能已经包含在‘swagger-ui’的下拉选项中 5.升级hutool和lombok版本|
3232
|20200306|1.提交一套layuimini+mybatisplus的模板. 2.修复mybatisplus一些相关问题. |
3333
|20200206|1.新增历史记录功能,自动保存最近生成的对象 2.新增swagger开关选项和修复@Column带name参数(感谢@liuyu-struggle的建议) 3.去除mybatis模板中的方括号[]和修改模板里的类注释样式(感谢@gaohanghang的PR)|

generator-web/src/main/java/com/softdev/system/generator/util/TableParseUtil.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,13 @@ else if (columnLine.contains(" int") || columnLine.contains(" smallint")) {
263263
fieldComment=columnName;
264264
while(columnCommentMatcher.find()){
265265
String columnCommentTmp = columnCommentMatcher.group();
266-
System.out.println(columnCommentTmp);
266+
//System.out.println(columnCommentTmp);
267267
fieldComment = tableSql.substring(tableSql.indexOf(columnCommentTmp)+columnCommentTmp.length()).trim();
268268
fieldComment = fieldComment.substring(0,fieldComment.indexOf("`")).trim();
269269
}
270-
}else if (columnLine.contains("comment")) {
271-
String commentTmp = columnLine.substring(columnLine.indexOf("comment")+7).trim();
270+
}else if (columnLine.contains(" comment")) {
271+
//20200518 zhengkai 修复包含comment关键字的问题
272+
String commentTmp = columnLine.substring(columnLine.lastIndexOf("comment")+7).trim();
272273
// '用户ID',
273274
if (commentTmp.contains("`") || commentTmp.indexOf("`")!=commentTmp.lastIndexOf("`")) {
274275
commentTmp = commentTmp.substring(commentTmp.indexOf("`")+1, commentTmp.lastIndexOf("`"));

0 commit comments

Comments
 (0)