struct.go.template 416 B

1234567891011121314151617
  1. package domain
  2. import (
  3. "fmt"
  4. "time"
  5. )
  6. {{range .}}
  7. // {{.AaBbName}} {{.Comment}}
  8. type {{.AaBbName}} struct {
  9. {{range .MColumns}} {{.AaBbName}} {{.TypeName}} `{{if eq .IsKey false}}xorm:"{{.Name}}"{{end}} json:"{{.AaBbName}}"`
  10. {{end}}}
  11. func (receiver {{.AaBbName}}) String() string {
  12. return fmt.Sprint("{{.AaBbName}}{", {{range .MColumns}}"{{.AaBbName}}:", receiver.{{.AaBbName}},{{end}} "}")
  13. }
  14. {{end}}