diff --git a/sql2go/parser.go b/sql2go/parser.go index 5ee2bfa..8fbe5fa 100644 --- a/sql2go/parser.go +++ b/sql2go/parser.go @@ -21,9 +21,9 @@ const ( // TableColumnTpl 每个字段的模版 TableColumnTpl = " {FIELD} string `json:\"{JSON_TAG}\"`" // TableColumnDescTpl 字段描述 - TableColumnDescTpl = " {FIELD}: \"{JSON_TAG}\"`" + TableColumnDescTpl = " {FIELD}: \"{JSON_TAG}\"" // TableColumnCommentTpl 字段描述 - TableColumnCommentTpl = " \"{JSON_TAG}\": \"{FIELD_COMMENT}\"`" + TableColumnCommentTpl = " \"{JSON_TAG}\": \"{FIELD_COMMENT}\"" ) // BasicTableInfo ... @@ -79,6 +79,7 @@ func ParseCreateTableSql(sql string) (*BasicTableInfo, error) { columnDefined, _, getColumnFunc := generateTableColumnDefined(basic.ModelStructName, r.TableSpec.Columns) basic.ColumnDescDefined = columnDefined basic.ModelStruct += getColumnFunc + basic.ModelStruct = basic.ColumnDefined + `\n` + basic.ModelStruct return basic, nil }