feat(ReverseEngine):给生成的文件添加表注释,当表注释不为空的时候会在import下面生成该注释信息

This commit is contained in:
huangzj
2020-05-26 09:12:17 +08:00
parent e9502e1ac8
commit f74ba73d29
4 changed files with 17 additions and 9 deletions
+3 -3
View File
@@ -154,9 +154,9 @@ func dbReverse(path string, tableName string, dbName string, db *sql.DB) {
if nil == cms {
log.Println("没有查到数据库字段信息略过")
}
fms, hasTime := buildFieldMessage(cms) //创建字段名和类型的映射
w := bufio.NewWriter(file) //进行文件的操作
content := cg.GenerateFileContent(path, tableName, fms, hasTime, tagKey) //拼go文件
fms, hasTime := buildFieldMessage(cms) //创建字段名和类型的映射
w := bufio.NewWriter(file) //进行文件的操作
content := cg.GenerateFileContent(path, tableName, fms, hasTime, tagKey, tableComment) //拼go文件
_, err := w.WriteString(content)
checkError(err, "写入出错了:")
fErr, cErr := w.Flush(), file.Close()