You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
490 B
Go
30 lines
490 B
Go
package template
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/zeromicro/go-zero/tools/goctl/util"
|
|
)
|
|
|
|
// ModelGen defines a template for model
|
|
var ModelGen = fmt.Sprintf(`%s
|
|
|
|
package {{.pkg}}
|
|
{{.imports}}
|
|
{{.vars}}
|
|
{{.types}}
|
|
{{.new}}
|
|
{{.insert}}
|
|
{{.find}}
|
|
{{.update}}
|
|
{{.delete}}
|
|
{{.extraMethod}}
|
|
`, util.DoNotEditHead)
|
|
|
|
// ModelCustom defines a template for extension
|
|
var ModelCustom = fmt.Sprintf(`package {{.pkg}}
|
|
type {{.upperStartCamelObject}}Model interface {
|
|
{{.lowerStartCamelObject}}Model
|
|
}
|
|
`)
|