Browse Source

updatwe

master
dengbiao 4 months ago
parent
commit
4d5445e675
2 changed files with 24 additions and 0 deletions
  1. +7
    -0
      etc/db_tpl/config
  2. +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}}


Loading…
Cancel
Save