fix: model generation bug on with cache (#1743)
* fix: model generation bug on with cache * chore: refine template * chore: fix test failure
This commit is contained in:
@@ -8,9 +8,14 @@ import (
|
||||
|
||||
// ModelCustom defines a template for extension
|
||||
const ModelCustom = `package {{.pkg}}
|
||||
|
||||
{{if .withCache}}
|
||||
import (
|
||||
"github.com/zeromicro/go-zero/core/stores/cache"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
{{else}}
|
||||
import "github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
|
||||
{{end}}
|
||||
var _ {{.upperStartCamelObject}}Model = (*custom{{.upperStartCamelObject}}Model)(nil)
|
||||
|
||||
type (
|
||||
|
||||
Reference in New Issue
Block a user