From fcb092cecec243ae13590832bf535290966b19ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Sun, 14 Apr 2024 21:56:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql2go/parser.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 }