From 4788c3a7a1b564e719c8543e57cecd4aeba97fc3 Mon Sep 17 00:00:00 2001 From: czyt Date: Thu, 12 Oct 2023 15:10:31 +0800 Subject: [PATCH] fix template --- cmd/kilot/kilot.go | 2 +- .../kratos/mongo/internal/templates/odm_data_layer_logic.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/kilot/kilot.go b/cmd/kilot/kilot.go index eb84622..d89c0f0 100644 --- a/cmd/kilot/kilot.go +++ b/cmd/kilot/kilot.go @@ -22,7 +22,7 @@ func main() { }, }, Name: "kilot", - Version: "0.1.18", + Version: "0.1.19", EnableBashCompletion: true, Commands: []*cli.Command{ { diff --git a/cmd/kilot/kratos/mongo/internal/templates/odm_data_layer_logic.tpl b/cmd/kilot/kratos/mongo/internal/templates/odm_data_layer_logic.tpl index 299dcac..331b8d9 100644 --- a/cmd/kilot/kratos/mongo/internal/templates/odm_data_layer_logic.tpl +++ b/cmd/kilot/kratos/mongo/internal/templates/odm_data_layer_logic.tpl @@ -78,7 +78,7 @@ func ({{.ModelIdentifier}} {{.ModelNameLowCase}}DataRepo) ReplaceOne{{.ModelName } func ({{.ModelIdentifier}} {{.ModelNameLowCase}}DataRepo) ReplaceOne{{.ModelName}}ById(ctx context.Context, id string, data *{{.BizPkg}}.{{.ModelName}}, opts ...*options.ReplaceOptions) (result *mongo.UpdateResult, err error) { - recordId, err := t.model.PrepareID(id) + recordId, err := {{.ModelIdentifier}}.model.PrepareID(id) if err != nil { return nil, err }