mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-26 11:28:46 +08:00
6e57f6c527
* make variable declaration more concise * add model interface * optimize interface methods * fix: go test failed * warp returns * optimize
11 lines
328 B
Go
11 lines
328 B
Go
package template
|
|
|
|
var New = `
|
|
func New{{.upperStartCamelObject}}Model(conn sqlx.SqlConn{{if .withCache}}, c cache.CacheConf{{end}}) {{.upperStartCamelObject}}Model {
|
|
return &default{{.upperStartCamelObject}}Model{
|
|
{{if .withCache}}CachedConn: sqlc.NewConn(conn, c){{else}}conn:conn{{end}},
|
|
table: "{{.table}}",
|
|
}
|
|
}
|
|
`
|