From e71008e92219e9f93b51c58dca95b0c60e442455 Mon Sep 17 00:00:00 2001 From: John Guo Date: Thu, 26 Dec 2024 10:16:13 +0800 Subject: [PATCH] up --- .../testdata/gendao/generated_user/dao/internal/table_user.go | 4 ++-- .../generated_user_field_mapping/dao/internal/table_user.go | 4 ++-- .../gendao/generated_user_sqlite3/dao/internal/table_user.go | 4 ++-- .../generated_user_type_mapping/dao/internal/table_user.go | 4 ++-- .../cmd/testdata/issue/3749/dao/internal/table_user.go | 4 ++-- cmd/gf/internal/consts/consts_gen_dao_template_dao.go | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cmd/gf/internal/cmd/testdata/gendao/generated_user/dao/internal/table_user.go b/cmd/gf/internal/cmd/testdata/gendao/generated_user/dao/internal/table_user.go index efe2d4fff76..ea8bec0c63a 100644 --- a/cmd/gf/internal/cmd/testdata/gendao/generated_user/dao/internal/table_user.go +++ b/cmd/gf/internal/cmd/testdata/gendao/generated_user/dao/internal/table_user.go @@ -73,11 +73,11 @@ func (dao *TableUserDao) Group() string { // Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. func (dao *TableUserDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table).Safe().Ctx(ctx) + model := dao.DB().Model(dao.table) for _, handler := range dao.handlers { model = handler(model) } - return model + return model.Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. diff --git a/cmd/gf/internal/cmd/testdata/gendao/generated_user_field_mapping/dao/internal/table_user.go b/cmd/gf/internal/cmd/testdata/gendao/generated_user_field_mapping/dao/internal/table_user.go index efe2d4fff76..ea8bec0c63a 100644 --- a/cmd/gf/internal/cmd/testdata/gendao/generated_user_field_mapping/dao/internal/table_user.go +++ b/cmd/gf/internal/cmd/testdata/gendao/generated_user_field_mapping/dao/internal/table_user.go @@ -73,11 +73,11 @@ func (dao *TableUserDao) Group() string { // Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. func (dao *TableUserDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table).Safe().Ctx(ctx) + model := dao.DB().Model(dao.table) for _, handler := range dao.handlers { model = handler(model) } - return model + return model.Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. diff --git a/cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/dao/internal/table_user.go b/cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/dao/internal/table_user.go index b83cc9d39be..6bdfc918360 100644 --- a/cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/dao/internal/table_user.go +++ b/cmd/gf/internal/cmd/testdata/gendao/generated_user_sqlite3/dao/internal/table_user.go @@ -71,11 +71,11 @@ func (dao *TableUserDao) Group() string { // Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. func (dao *TableUserDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table).Safe().Ctx(ctx) + model := dao.DB().Model(dao.table) for _, handler := range dao.handlers { model = handler(model) } - return model + return model.Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. diff --git a/cmd/gf/internal/cmd/testdata/gendao/generated_user_type_mapping/dao/internal/table_user.go b/cmd/gf/internal/cmd/testdata/gendao/generated_user_type_mapping/dao/internal/table_user.go index efe2d4fff76..ea8bec0c63a 100644 --- a/cmd/gf/internal/cmd/testdata/gendao/generated_user_type_mapping/dao/internal/table_user.go +++ b/cmd/gf/internal/cmd/testdata/gendao/generated_user_type_mapping/dao/internal/table_user.go @@ -73,11 +73,11 @@ func (dao *TableUserDao) Group() string { // Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. func (dao *TableUserDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table).Safe().Ctx(ctx) + model := dao.DB().Model(dao.table) for _, handler := range dao.handlers { model = handler(model) } - return model + return model.Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. diff --git a/cmd/gf/internal/cmd/testdata/issue/3749/dao/internal/table_user.go b/cmd/gf/internal/cmd/testdata/issue/3749/dao/internal/table_user.go index 00de02a4549..9a3958bc9ef 100644 --- a/cmd/gf/internal/cmd/testdata/issue/3749/dao/internal/table_user.go +++ b/cmd/gf/internal/cmd/testdata/issue/3749/dao/internal/table_user.go @@ -73,11 +73,11 @@ func (dao *TableUserDao) Group() string { // Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. func (dao *TableUserDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table).Safe().Ctx(ctx) + model := dao.DB().Model(dao.table) for _, handler := range dao.handlers { model = handler(model) } - return model + return model.Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. diff --git a/cmd/gf/internal/consts/consts_gen_dao_template_dao.go b/cmd/gf/internal/consts/consts_gen_dao_template_dao.go index e8cd2bf6d54..d1a82bc03d2 100644 --- a/cmd/gf/internal/consts/consts_gen_dao_template_dao.go +++ b/cmd/gf/internal/consts/consts_gen_dao_template_dao.go @@ -120,11 +120,11 @@ func (dao *{{.TplTableNameCamelCase}}Dao) Group() string { // Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. func (dao *{{.TplTableNameCamelCase}}Dao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table).Safe().Ctx(ctx) + model := dao.DB().Model(dao.table) for _, handler := range dao.handlers { model = handler(model) } - return model + return model.Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f.