dengbiao 4 mesi fa
parent
commit
4d5445e675
2 ha cambiato i file con 24 aggiunte e 0 eliminazioni
  1. +7
    -0
      etc/db_tpl/config
  2. +17
    -0
      etc/db_tpl/struct.go.tpl

+ 7
- 0
etc/db_tpl/config Vedi File

@@ -0,0 +1,7 @@
lang=go
genJson=1
prefix=cos_
ignoreColumnsJSON=
created=
updated=
deleted=

+ 17
- 0
etc/db_tpl/struct.go.tpl Vedi 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}}


Caricamento…
Annulla
Salva