feat(goctl): generate mongo model with cache prefix (#4907)

This commit is contained in:
Haiwei Zhang
2025-06-07 20:54:33 +08:00
committed by GitHub
parent 7969e0ca38
commit 0140fd417b
5 changed files with 9 additions and 1 deletions

View File

@@ -13,7 +13,7 @@ import (
"go.mongodb.org/mongo-driver/mongo"
)
{{if .Cache}}var prefix{{.Type}}CacheKey = "cache:{{.lowerType}}:"{{end}}
{{if .Cache}}var prefix{{.Type}}CacheKey = "{{if .Prefix}}{{.Prefix}}:{{end}}cache:{{.lowerType}}:"{{end}}
type {{.lowerType}}Model interface{
Insert(ctx context.Context,data *{{.Type}}) error