mirror of
https://github.com/moshowgame/SpringBootCodeGenerator.git
synced 2025-12-26 13:52:39 +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) {
|
if (classCommentTmp!=null && classCommentTmp.trim().length()>0) {
|
||||||
classComment = classCommentTmp;
|
classComment = classCommentTmp;
|
||||||
|
}else{
|
||||||
|
//修复表备注为空问题
|
||||||
|
classComment = className;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
//修复表备注为空问题
|
||||||
|
classComment = className;
|
||||||
}
|
}
|
||||||
|
|
||||||
// field List
|
// field List
|
||||||
@ -124,6 +130,9 @@ public class TableParseUtil {
|
|||||||
commentTmp = commentTmp.substring(commentTmp.indexOf("'")+1, commentTmp.lastIndexOf("'"));
|
commentTmp = commentTmp.substring(commentTmp.indexOf("'")+1, commentTmp.lastIndexOf("'"));
|
||||||
}
|
}
|
||||||
fieldComment = commentTmp;
|
fieldComment = commentTmp;
|
||||||
|
}else{
|
||||||
|
//修复comment不存在导致报错的问题
|
||||||
|
fieldComment = columnName;
|
||||||
}
|
}
|
||||||
|
|
||||||
FieldInfo fieldInfo = new FieldInfo();
|
FieldInfo fieldInfo = new FieldInfo();
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* ${classInfo.classComment}
|
* ${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
|
@Controller
|
||||||
public class ConfController {
|
public class ConfController {
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* ${classInfo.classComment}
|
* ${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
|
@Component
|
||||||
public interface ${classInfo.className}Dao {
|
public interface ${classInfo.className}Dao {
|
||||||
|
|||||||
@ -21,7 +21,7 @@ import java.util.Date;
|
|||||||
@Data
|
@Data
|
||||||
@Table(name="${classInfo.tableName}")
|
@Table(name="${classInfo.tableName}")
|
||||||
public class ${classInfo.className} implements Serializable {
|
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>
|
<#if classInfo.fieldList?exists && classInfo.fieldList?size gt 0>
|
||||||
<#list classInfo.fieldList as fieldItem >
|
<#list classInfo.fieldList as fieldItem >
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import java.util.Date;
|
|||||||
/**
|
/**
|
||||||
* ${classInfo.classComment}
|
* ${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 {
|
public class ${classInfo.className} implements Serializable {
|
||||||
private static final long serialVersionUID = 42L;
|
private static final long serialVersionUID = 42L;
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* ${classInfo.classComment}
|
* ${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 {
|
public interface ${classInfo.className}Service {
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* ${classInfo.classComment}
|
* ${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
|
@Service
|
||||||
public class ${classInfo.className}ServiceImpl implements ${classInfo.className}Service {
|
public class ${classInfo.className}ServiceImpl implements ${classInfo.className}Service {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user