mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-09 16:10:00 +08:00
optimize unit test & add document
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
package template
|
||||
|
||||
var New = `
|
||||
func New{{.upperStartCamelObject}}Model(conn sqlx.SqlConn, c cache.CacheConf, table string) *{{.upperStartCamelObject}}Model {
|
||||
func New{{.upperStartCamelObject}}Model(conn sqlx.SqlConn,{{if .withCache}} c cache.CacheConf,{{end}} table string) *{{.upperStartCamelObject}}Model {
|
||||
return &{{.upperStartCamelObject}}Model{
|
||||
CachedConn: sqlc.NewConn(conn, c),
|
||||
{{if .withCache}}CachedConn: sqlc.NewConn(conn, c){{else}}conn:conn{{end}},
|
||||
table: table,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user