optimize unit test & add document

This commit is contained in:
anqiansong
2020-08-16 23:28:01 +08:00
parent 790b29b8eb
commit dbc034c9eb
46 changed files with 735 additions and 1855 deletions

View File

@@ -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,
}
}