File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,15 @@ func (b *QueryStructMeta) StructComment() string {
161161 return `mapped from object`
162162}
163163
164+ // QueryStructComment query struct comment
165+ func (b * QueryStructMeta ) QueryStructComment () string {
166+ if b .TableComment != "" {
167+ return fmt .Sprintf (`// %s %s` , b .QueryStructName , b .TableComment )
168+ }
169+
170+ return ``
171+ }
172+
164173// ReviseDIYMethod check diy method duplication name
165174func (b * QueryStructMeta ) ReviseDIYMethod () error {
166175 var duplicateMethodName []string
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package template
33const (
44 // TableQueryStruct table query struct
55 TableQueryStruct = createMethod + `
6- // {{.QueryStructName}} {{.StructComment }}
6+ {{.QueryStructComment }}
77 type {{.QueryStructName}} struct {
88 {{.QueryStructName}}Do
99 ` + fields + `
@@ -12,7 +12,7 @@ const (
1212
1313 // TableQueryStructWithContext table query struct with context
1414 TableQueryStructWithContext = createMethod + `
15- // {{.QueryStructName}} {{.StructComment }}
15+ {{.QueryStructComment }}
1616 type {{.QueryStructName}} struct {
1717 {{.QueryStructName}}Do {{.QueryStructName}}Do
1818 ` + fields + `
You can’t perform that action at this time.
0 commit comments