new.go 328 B

12345678910
  1. package template
  2. var New = `
  3. func New{{.upperStartCamelObject}}Model(conn sqlx.SqlConn{{if .withCache}}, c cache.CacheConf{{end}}) {{.upperStartCamelObject}}Model {
  4. return &default{{.upperStartCamelObject}}Model{
  5. {{if .withCache}}CachedConn: sqlc.NewConn(conn, c){{else}}conn:conn{{end}},
  6. table: "{{.table}}",
  7. }
  8. }
  9. `