This website works better with JavaScript.
Home
Explore
Help
Sign In
zhimeng
/
model
Watch
2
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
2
Wiki
Activity
Browse Source
updatwe
master
dengbiao
4 months ago
parent
dde162209c
commit
4d5445e675
2 changed files
with
24 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+7
-0
etc/db_tpl/config
+17
-0
etc/db_tpl/struct.go.tpl
+ 7
- 0
etc/db_tpl/config
View File
@@ -0,0 +1,7 @@
lang=go
genJson=1
prefix=cos_
ignoreColumnsJSON=
created=
updated=
deleted=
+ 17
- 0
etc/db_tpl/struct.go.tpl
View File
@@ -0,0 +1,17 @@
package {{.Models}}
{{$ilen := len .Imports}}
{{if gt $ilen 0}}
import (
{{range .Imports}}"{{.}}"{{end}}
)
{{end}}
{{range .Tables}}
type {{Mapper .Name}} struct {
{{$table := .}}
{{range .ColumnsSeq}}{{$col := $table.GetColumn .}} {{Mapper $col.Name}} {{Type $col}} {{Tag $table $col}}
{{end}}
}
{{end}}
Write
Preview
Loading…
Cancel
Save