智莺生活mysql模型库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

struct.go.tpl 310 B

6 months ago
6 months ago
6 months ago
1234567891011121314151617
  1. package {{.Models}}
  2. {{$ilen := len .Imports}}
  3. {{if gt $ilen 0}}
  4. import (
  5. {{range .Imports}}"{{.}}"{{end}}
  6. )
  7. {{end}}
  8. {{range .Tables}}
  9. type {{Mapper .Name}} struct {
  10. {{$table := .}}
  11. {{range .ColumnsSeq}}{{$col := $table.GetColumn .}} {{Mapper $col.Name}} {{Type $col}} {{Tag $table $col}}
  12. {{end}}
  13. }
  14. {{end}}