mirror of
https://github.com/moshowgame/SpringBootCodeGenerator.git
synced 2025-12-26 05:48:33 +08:00
fix up the bug when column or table has not comment
This commit is contained in:
parent
4603270887
commit
01932b628d
@ -59,7 +59,13 @@ public class TableParseUtil {
|
||||
}
|
||||
if (classCommentTmp!=null && classCommentTmp.trim().length()>0) {
|
||||
classComment = classCommentTmp;
|
||||
}else{
|
||||
//修复表备注为空问题
|
||||
classComment = className;
|
||||
}
|
||||
}else{
|
||||
//修复表备注为空问题
|
||||
classComment = className;
|
||||
}
|
||||
|
||||
// field List
|
||||
@ -124,6 +130,9 @@ public class TableParseUtil {
|
||||
commentTmp = commentTmp.substring(commentTmp.indexOf("'")+1, commentTmp.lastIndexOf("'"));
|
||||
}
|
||||
fieldComment = commentTmp;
|
||||
}else{
|
||||
//修复comment不存在导致报错的问题
|
||||
fieldComment = columnName;
|
||||
}
|
||||
|
||||
FieldInfo fieldInfo = new FieldInfo();
|
||||
|
||||
@ -11,7 +11,7 @@ import java.util.Map;
|
||||
/**
|
||||
* ${classInfo.classComment}
|
||||
*
|
||||
* Created by xuxueli on '${.now?string('yyyy-MM-dd HH:mm:ss')}'.
|
||||
* Created by by-health on '${.now?string('yyyy-MM-dd HH:mm:ss')}'.
|
||||
*/
|
||||
@Controller
|
||||
public class ConfController {
|
||||
|
||||
@ -6,7 +6,7 @@ import java.util.List;
|
||||
/**
|
||||
* ${classInfo.classComment}
|
||||
*
|
||||
* Created by xuxueli on '${.now?string('yyyy-MM-dd HH:mm:ss')}'.
|
||||
* Created by by-health on '${.now?string('yyyy-MM-dd HH:mm:ss')}'.
|
||||
*/
|
||||
@Component
|
||||
public interface ${classInfo.className}Dao {
|
||||
|
||||
@ -21,7 +21,7 @@ import java.util.Date;
|
||||
@Data
|
||||
@Table(name="${classInfo.tableName}")
|
||||
public class ${classInfo.className} implements Serializable {
|
||||
private static final long serialVersionUID = 42L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||
<#list classInfo.fieldList as fieldItem >
|
||||
|
||||
@ -13,7 +13,7 @@ import java.util.Date;
|
||||
/**
|
||||
* ${classInfo.classComment}
|
||||
*
|
||||
* Created by xuxueli on '${.now?string('yyyy-MM-dd HH:mm:ss')}'.
|
||||
* Created by by-health on '${.now?string('yyyy-MM-dd HH:mm:ss')}'.
|
||||
*/
|
||||
public class ${classInfo.className} implements Serializable {
|
||||
private static final long serialVersionUID = 42L;
|
||||
|
||||
@ -3,7 +3,7 @@ import java.util.Map;
|
||||
/**
|
||||
* ${classInfo.classComment}
|
||||
*
|
||||
* Created by xuxueli on '${.now?string('yyyy-MM-dd HH:mm:ss')}'.
|
||||
* Created by by-health on '${.now?string('yyyy-MM-dd HH:mm:ss')}'.
|
||||
*/
|
||||
public interface ${classInfo.className}Service {
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ import java.util.Map;
|
||||
/**
|
||||
* ${classInfo.classComment}
|
||||
*
|
||||
* Created by xuxueli on '${.now?string('yyyy-MM-dd HH:mm:ss')}'.
|
||||
* Created by by-health on '${.now?string('yyyy-MM-dd HH:mm:ss')}'.
|
||||
*/
|
||||
@Service
|
||||
public class ${classInfo.className}ServiceImpl implements ${classInfo.className}Service {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user