Add wiki Generator page.
This commit is contained in:
parent
b3ec1139b5
commit
3516d2861c
5 changed files with 298 additions and 13 deletions
|
|
@ -26,6 +26,8 @@ import (
|
|||
"github.com/go-jet/jet"
|
||||
)
|
||||
|
||||
var {{camelize .Name}} = new{{.GoStructName}}()
|
||||
|
||||
type {{.GoStructName}} struct {
|
||||
jet.Table
|
||||
|
||||
|
|
@ -37,7 +39,14 @@ type {{.GoStructName}} struct {
|
|||
AllColumns jet.ColumnList
|
||||
}
|
||||
|
||||
var {{camelize .Name}} = new{{.GoStructName}}()
|
||||
// creates new {{.GoStructName}} with assigned alias
|
||||
func (a *{{.GoStructName}}) AS(alias string) *{{.GoStructName}} {
|
||||
aliasTable := new{{.GoStructName}}()
|
||||
|
||||
aliasTable.Table.AS(alias)
|
||||
|
||||
return aliasTable
|
||||
}
|
||||
|
||||
func new{{.GoStructName}}() *{{.GoStructName}} {
|
||||
var (
|
||||
|
|
@ -58,14 +67,6 @@ func new{{.GoStructName}}() *{{.GoStructName}} {
|
|||
}
|
||||
}
|
||||
|
||||
func (a *{{.GoStructName}}) AS(alias string) *{{.GoStructName}} {
|
||||
aliasTable := new{{.GoStructName}}()
|
||||
|
||||
aliasTable.Table.AS(alias)
|
||||
|
||||
return aliasTable
|
||||
}
|
||||
|
||||
`
|
||||
|
||||
var dataModelTemplate = `package model
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue