From 0ad79c4f27816fd276a84c32af0ba996579e4adb Mon Sep 17 00:00:00 2001 From: hxt Date: Thu, 17 Jul 2025 20:25:50 +0800 Subject: [PATCH] =?UTF-8?q?ci(drone):=20=E6=B7=BB=E5=8A=A0=20Go=20?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=92=8C=E6=9E=84=E5=BB=BA=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 restore cache 和 rebuild cache 步骤中添加了 go-mod-cache 和 go --- internal/dao/internal/epic_artifact_info.go | 42 +++---- .../dao/internal/epic_gvg_attack_teams.go | 42 +++---- .../epic_gvg_defense_attack_mapping.go | 42 +++---- .../dao/internal/epic_gvg_defense_teams.go | 42 +++---- internal/dao/internal/epic_hero_info.go | 114 +++++++++--------- internal/dao/internal/epic_hero_user_build.go | 42 +++---- internal/dao/internal/epic_i_18_n_mappings.go | 42 +++---- internal/dao/internal/fribble_hero_set.go | 42 +++---- internal/dao/internal/gear_set_info.go | 42 +++---- internal/dao/internal/infra_api_access_log.go | 42 +++---- internal/dao/internal/infra_api_error_log.go | 42 +++---- internal/dao/internal/infra_codegen_column.go | 42 +++---- internal/dao/internal/infra_codegen_table.go | 42 +++---- internal/dao/internal/infra_config.go | 42 +++---- .../dao/internal/infra_data_source_config.go | 42 +++---- internal/dao/internal/infra_file.go | 42 +++---- internal/dao/internal/infra_file_config.go | 42 +++---- internal/dao/internal/infra_file_content.go | 42 +++---- internal/dao/internal/infra_job.go | 42 +++---- internal/dao/internal/infra_job_log.go | 42 +++---- internal/dao/internal/qrtz_blob_triggers.go | 42 +++---- internal/dao/internal/qrtz_calendars.go | 42 +++---- internal/dao/internal/qrtz_cron_triggers.go | 42 +++---- internal/dao/internal/qrtz_fired_triggers.go | 42 +++---- internal/dao/internal/qrtz_job_details.go | 42 +++---- internal/dao/internal/qrtz_locks.go | 42 +++---- .../dao/internal/qrtz_paused_trigger_grps.go | 42 +++---- internal/dao/internal/qrtz_scheduler_state.go | 42 +++---- internal/dao/internal/qrtz_simple_triggers.go | 42 +++---- .../dao/internal/qrtz_simprop_triggers.go | 42 +++---- internal/dao/internal/qrtz_triggers.go | 42 +++---- internal/dao/internal/system_dept.go | 42 +++---- internal/dao/internal/system_dict_data.go | 42 +++---- internal/dao/internal/system_dict_type.go | 42 +++---- internal/dao/internal/system_login_log.go | 42 +++---- internal/dao/internal/system_mail_account.go | 42 +++---- internal/dao/internal/system_mail_log.go | 42 +++---- internal/dao/internal/system_mail_template.go | 42 +++---- internal/dao/internal/system_menu.go | 42 +++---- internal/dao/internal/system_notice.go | 42 +++---- .../dao/internal/system_notify_message.go | 42 +++---- .../dao/internal/system_notify_template.go | 42 +++---- .../internal/system_oauth_2_access_token.go | 42 +++---- .../dao/internal/system_oauth_2_approve.go | 42 +++---- .../dao/internal/system_oauth_2_client.go | 42 +++---- internal/dao/internal/system_oauth_2_code.go | 42 +++---- .../internal/system_oauth_2_refresh_token.go | 42 +++---- internal/dao/internal/system_operate_log.go | 42 +++---- internal/dao/internal/system_post.go | 42 +++---- internal/dao/internal/system_role.go | 42 +++---- internal/dao/internal/system_role_menu.go | 42 +++---- internal/dao/internal/system_sms_channel.go | 42 +++---- internal/dao/internal/system_sms_code.go | 42 +++---- internal/dao/internal/system_sms_log.go | 42 +++---- internal/dao/internal/system_sms_template.go | 42 +++---- internal/dao/internal/system_social_client.go | 42 +++---- internal/dao/internal/system_social_user.go | 42 +++---- .../dao/internal/system_social_user_bind.go | 42 +++---- internal/dao/internal/system_tenant.go | 42 +++---- .../dao/internal/system_tenant_package.go | 42 +++---- internal/dao/internal/system_user_post.go | 42 +++---- internal/dao/internal/system_user_role.go | 42 +++---- internal/dao/internal/system_users.go | 42 +++---- .../dao/internal/yudao_demo_01_contact.go | 42 +++---- .../dao/internal/yudao_demo_02_category.go | 42 +++---- internal/dao/internal/yudao_demo_03_course.go | 42 +++---- internal/dao/internal/yudao_demo_03_grade.go | 42 +++---- .../dao/internal/yudao_demo_03_student.go | 42 +++---- internal/logic/cron/cron.go | 40 +++--- internal/logic/cron/third_party_sync.go | 87 ++++++++++--- internal/logic/cron/third_party_sync_test.go | 9 ++ internal/logic/hero/hero.go | 4 + internal/logic/i18n/i18n.go | 3 +- internal/model/do/epic_hero_info.go | 38 +++--- internal/model/entity/epic_hero_info.go | 36 +++--- 75 files changed, 1400 insertions(+), 1745 deletions(-) diff --git a/internal/dao/internal/epic_artifact_info.go b/internal/dao/internal/epic_artifact_info.go index f20baff..e3df147 100644 --- a/internal/dao/internal/epic_artifact_info.go +++ b/internal/dao/internal/epic_artifact_info.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// EpicArtifactInfoDao is the data access object for the table epic_artifact_info. +// EpicArtifactInfoDao is the data access object for table epic_artifact_info. type EpicArtifactInfoDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns EpicArtifactInfoColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns EpicArtifactInfoColumns // columns contains all the column names of Table for convenient usage. } -// EpicArtifactInfoColumns defines and stores column names for the table epic_artifact_info. +// EpicArtifactInfoColumns defines and stores column names for table epic_artifact_info. type EpicArtifactInfoColumns struct { Id string // 文件编号 ArtifactName string // 配置编号 @@ -38,7 +37,7 @@ type EpicArtifactInfoColumns struct { ImageUrl string // 图片地址 } -// epicArtifactInfoColumns holds the columns for the table epic_artifact_info. +// epicArtifactInfoColumns holds the columns for table epic_artifact_info. var epicArtifactInfoColumns = EpicArtifactInfoColumns{ Id: "id", ArtifactName: "artifact_name", @@ -58,49 +57,44 @@ var epicArtifactInfoColumns = EpicArtifactInfoColumns{ } // NewEpicArtifactInfoDao creates and returns a new DAO object for table data access. -func NewEpicArtifactInfoDao(handlers ...gdb.ModelHandler) *EpicArtifactInfoDao { +func NewEpicArtifactInfoDao() *EpicArtifactInfoDao { return &EpicArtifactInfoDao{ - group: "default", - table: "epic_artifact_info", - columns: epicArtifactInfoColumns, - handlers: handlers, + group: "default", + table: "epic_artifact_info", + columns: epicArtifactInfoColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *EpicArtifactInfoDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *EpicArtifactInfoDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *EpicArtifactInfoDao) Columns() EpicArtifactInfoColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *EpicArtifactInfoDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *EpicArtifactInfoDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *EpicArtifactInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/epic_gvg_attack_teams.go b/internal/dao/internal/epic_gvg_attack_teams.go index 3b09acf..d350ee5 100644 --- a/internal/dao/internal/epic_gvg_attack_teams.go +++ b/internal/dao/internal/epic_gvg_attack_teams.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// EpicGvgAttackTeamsDao is the data access object for the table epic_gvg_attack_teams. +// EpicGvgAttackTeamsDao is the data access object for table epic_gvg_attack_teams. type EpicGvgAttackTeamsDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns EpicGvgAttackTeamsColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns EpicGvgAttackTeamsColumns // columns contains all the column names of Table for convenient usage. } -// EpicGvgAttackTeamsColumns defines and stores column names for the table epic_gvg_attack_teams. +// EpicGvgAttackTeamsColumns defines and stores column names for table epic_gvg_attack_teams. type EpicGvgAttackTeamsColumns struct { Id string // id AttackHeroes string // 进攻角色 @@ -30,7 +29,7 @@ type EpicGvgAttackTeamsColumns struct { Deleted string // 是否删除 } -// epicGvgAttackTeamsColumns holds the columns for the table epic_gvg_attack_teams. +// epicGvgAttackTeamsColumns holds the columns for table epic_gvg_attack_teams. var epicGvgAttackTeamsColumns = EpicGvgAttackTeamsColumns{ Id: "id", AttackHeroes: "attack_heroes", @@ -42,49 +41,44 @@ var epicGvgAttackTeamsColumns = EpicGvgAttackTeamsColumns{ } // NewEpicGvgAttackTeamsDao creates and returns a new DAO object for table data access. -func NewEpicGvgAttackTeamsDao(handlers ...gdb.ModelHandler) *EpicGvgAttackTeamsDao { +func NewEpicGvgAttackTeamsDao() *EpicGvgAttackTeamsDao { return &EpicGvgAttackTeamsDao{ - group: "default", - table: "epic_gvg_attack_teams", - columns: epicGvgAttackTeamsColumns, - handlers: handlers, + group: "default", + table: "epic_gvg_attack_teams", + columns: epicGvgAttackTeamsColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *EpicGvgAttackTeamsDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *EpicGvgAttackTeamsDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *EpicGvgAttackTeamsDao) Columns() EpicGvgAttackTeamsColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *EpicGvgAttackTeamsDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *EpicGvgAttackTeamsDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *EpicGvgAttackTeamsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/epic_gvg_defense_attack_mapping.go b/internal/dao/internal/epic_gvg_defense_attack_mapping.go index 56769ad..fa4973c 100644 --- a/internal/dao/internal/epic_gvg_defense_attack_mapping.go +++ b/internal/dao/internal/epic_gvg_defense_attack_mapping.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// EpicGvgDefenseAttackMappingDao is the data access object for the table epic_gvg_defense_attack_mapping. +// EpicGvgDefenseAttackMappingDao is the data access object for table epic_gvg_defense_attack_mapping. type EpicGvgDefenseAttackMappingDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns EpicGvgDefenseAttackMappingColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns EpicGvgDefenseAttackMappingColumns // columns contains all the column names of Table for convenient usage. } -// EpicGvgDefenseAttackMappingColumns defines and stores column names for the table epic_gvg_defense_attack_mapping. +// EpicGvgDefenseAttackMappingColumns defines and stores column names for table epic_gvg_defense_attack_mapping. type EpicGvgDefenseAttackMappingColumns struct { Id string // id DefenseId string // 防守阵容 @@ -36,7 +35,7 @@ type EpicGvgDefenseAttackMappingColumns struct { Deleted string // 是否删除 } -// epicGvgDefenseAttackMappingColumns holds the columns for the table epic_gvg_defense_attack_mapping. +// epicGvgDefenseAttackMappingColumns holds the columns for table epic_gvg_defense_attack_mapping. var epicGvgDefenseAttackMappingColumns = EpicGvgDefenseAttackMappingColumns{ Id: "id", DefenseId: "defense_id", @@ -54,49 +53,44 @@ var epicGvgDefenseAttackMappingColumns = EpicGvgDefenseAttackMappingColumns{ } // NewEpicGvgDefenseAttackMappingDao creates and returns a new DAO object for table data access. -func NewEpicGvgDefenseAttackMappingDao(handlers ...gdb.ModelHandler) *EpicGvgDefenseAttackMappingDao { +func NewEpicGvgDefenseAttackMappingDao() *EpicGvgDefenseAttackMappingDao { return &EpicGvgDefenseAttackMappingDao{ - group: "default", - table: "epic_gvg_defense_attack_mapping", - columns: epicGvgDefenseAttackMappingColumns, - handlers: handlers, + group: "default", + table: "epic_gvg_defense_attack_mapping", + columns: epicGvgDefenseAttackMappingColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *EpicGvgDefenseAttackMappingDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *EpicGvgDefenseAttackMappingDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *EpicGvgDefenseAttackMappingDao) Columns() EpicGvgDefenseAttackMappingColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *EpicGvgDefenseAttackMappingDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *EpicGvgDefenseAttackMappingDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *EpicGvgDefenseAttackMappingDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/epic_gvg_defense_teams.go b/internal/dao/internal/epic_gvg_defense_teams.go index 9ed63f1..c3b625b 100644 --- a/internal/dao/internal/epic_gvg_defense_teams.go +++ b/internal/dao/internal/epic_gvg_defense_teams.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// EpicGvgDefenseTeamsDao is the data access object for the table epic_gvg_defense_teams. +// EpicGvgDefenseTeamsDao is the data access object for table epic_gvg_defense_teams. type EpicGvgDefenseTeamsDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns EpicGvgDefenseTeamsColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns EpicGvgDefenseTeamsColumns // columns contains all the column names of Table for convenient usage. } -// EpicGvgDefenseTeamsColumns defines and stores column names for the table epic_gvg_defense_teams. +// EpicGvgDefenseTeamsColumns defines and stores column names for table epic_gvg_defense_teams. type EpicGvgDefenseTeamsColumns struct { Id string // id DefenseHeroes string // 防守角色 @@ -30,7 +29,7 @@ type EpicGvgDefenseTeamsColumns struct { Deleted string // 是否删除 } -// epicGvgDefenseTeamsColumns holds the columns for the table epic_gvg_defense_teams. +// epicGvgDefenseTeamsColumns holds the columns for table epic_gvg_defense_teams. var epicGvgDefenseTeamsColumns = EpicGvgDefenseTeamsColumns{ Id: "id", DefenseHeroes: "defense_heroes", @@ -42,49 +41,44 @@ var epicGvgDefenseTeamsColumns = EpicGvgDefenseTeamsColumns{ } // NewEpicGvgDefenseTeamsDao creates and returns a new DAO object for table data access. -func NewEpicGvgDefenseTeamsDao(handlers ...gdb.ModelHandler) *EpicGvgDefenseTeamsDao { +func NewEpicGvgDefenseTeamsDao() *EpicGvgDefenseTeamsDao { return &EpicGvgDefenseTeamsDao{ - group: "default", - table: "epic_gvg_defense_teams", - columns: epicGvgDefenseTeamsColumns, - handlers: handlers, + group: "default", + table: "epic_gvg_defense_teams", + columns: epicGvgDefenseTeamsColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *EpicGvgDefenseTeamsDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *EpicGvgDefenseTeamsDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *EpicGvgDefenseTeamsDao) Columns() EpicGvgDefenseTeamsColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *EpicGvgDefenseTeamsDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *EpicGvgDefenseTeamsDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *EpicGvgDefenseTeamsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/epic_hero_info.go b/internal/dao/internal/epic_hero_info.go index d2c35c6..3738a80 100644 --- a/internal/dao/internal/epic_hero_info.go +++ b/internal/dao/internal/epic_hero_info.go @@ -11,100 +11,98 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// EpicHeroInfoDao is the data access object for the table epic_hero_info. +// EpicHeroInfoDao is the data access object for table epic_hero_info. type EpicHeroInfoDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns EpicHeroInfoColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns EpicHeroInfoColumns // columns contains all the column names of Table for convenient usage. } -// EpicHeroInfoColumns defines and stores column names for the table epic_hero_info. +// EpicHeroInfoColumns defines and stores column names for table epic_hero_info. type EpicHeroInfoColumns struct { - Id string // 文件编号 - HeroName string // 配置编号 - HeroCode string // 文件名 - HeroAttrLv60 string // 文件路径 - Creator string // 创建者 - CreateTime string // 创建时间 - Updater string // 更新者 - UpdateTime string // 更新时间 - Deleted string // 是否删除 - NickName string // 配置编号 - Rarity string // 配置编号 - Role string // 配置编号 - Zodiac string // 配置编号 - HeadImgUrl string // 配置编号 - Attribute string // 配置编号 - Remark string // 配置编号 - RawJson string // 原始json + Id string // 文件编号 + HeroName string // 配置编号 + HeroCode string // 文件名 + HeroAttrLv60 string // 文件路径 + Creator string // 创建者 + CreateTime string // 创建时间 + Updater string // 更新者 + UpdateTime string // 更新时间 + Deleted string // 是否删除 + NickName string // 配置编号 + Rarity string // 配置编号 + Role string // 配置编号 + Zodiac string // 配置编号 + HeadImgUrl string // 配置编号 + Attribute string // 配置编号 + Remark string // 配置编号 + RawJson string // 原始json + SetContentJson string // 配装json数据 + SetUpdateTime string // 配装更新时间 } -// epicHeroInfoColumns holds the columns for the table epic_hero_info. +// epicHeroInfoColumns holds the columns for table epic_hero_info. var epicHeroInfoColumns = EpicHeroInfoColumns{ - Id: "id", - HeroName: "hero_name", - HeroCode: "hero_code", - HeroAttrLv60: "hero_attr_lv60", - Creator: "creator", - CreateTime: "create_time", - Updater: "updater", - UpdateTime: "update_time", - Deleted: "deleted", - NickName: "nick_name", - Rarity: "rarity", - Role: "role", - Zodiac: "zodiac", - HeadImgUrl: "head_img_url", - Attribute: "attribute", - Remark: "remark", - RawJson: "raw_json", + Id: "id", + HeroName: "hero_name", + HeroCode: "hero_code", + HeroAttrLv60: "hero_attr_lv60", + Creator: "creator", + CreateTime: "create_time", + Updater: "updater", + UpdateTime: "update_time", + Deleted: "deleted", + NickName: "nick_name", + Rarity: "rarity", + Role: "role", + Zodiac: "zodiac", + HeadImgUrl: "head_img_url", + Attribute: "attribute", + Remark: "remark", + RawJson: "raw_json", + SetContentJson: "set_content_json", + SetUpdateTime: "set_update_time", } // NewEpicHeroInfoDao creates and returns a new DAO object for table data access. -func NewEpicHeroInfoDao(handlers ...gdb.ModelHandler) *EpicHeroInfoDao { +func NewEpicHeroInfoDao() *EpicHeroInfoDao { return &EpicHeroInfoDao{ - group: "default", - table: "epic_hero_info", - columns: epicHeroInfoColumns, - handlers: handlers, + group: "default", + table: "epic_hero_info", + columns: epicHeroInfoColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *EpicHeroInfoDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *EpicHeroInfoDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *EpicHeroInfoDao) Columns() EpicHeroInfoColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *EpicHeroInfoDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *EpicHeroInfoDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *EpicHeroInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/epic_hero_user_build.go b/internal/dao/internal/epic_hero_user_build.go index 618b697..de47130 100644 --- a/internal/dao/internal/epic_hero_user_build.go +++ b/internal/dao/internal/epic_hero_user_build.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// EpicHeroUserBuildDao is the data access object for the table epic_hero_user_build. +// EpicHeroUserBuildDao is the data access object for table epic_hero_user_build. type EpicHeroUserBuildDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns EpicHeroUserBuildColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns EpicHeroUserBuildColumns // columns contains all the column names of Table for convenient usage. } -// EpicHeroUserBuildColumns defines and stores column names for the table epic_hero_user_build. +// EpicHeroUserBuildColumns defines and stores column names for table epic_hero_user_build. type EpicHeroUserBuildColumns struct { Id string // 文件编号 ArtifactCode string // 配置编号 @@ -34,7 +33,7 @@ type EpicHeroUserBuildColumns struct { Deleted string // 是否删除 } -// epicHeroUserBuildColumns holds the columns for the table epic_hero_user_build. +// epicHeroUserBuildColumns holds the columns for table epic_hero_user_build. var epicHeroUserBuildColumns = EpicHeroUserBuildColumns{ Id: "id", ArtifactCode: "artifact_code", @@ -50,49 +49,44 @@ var epicHeroUserBuildColumns = EpicHeroUserBuildColumns{ } // NewEpicHeroUserBuildDao creates and returns a new DAO object for table data access. -func NewEpicHeroUserBuildDao(handlers ...gdb.ModelHandler) *EpicHeroUserBuildDao { +func NewEpicHeroUserBuildDao() *EpicHeroUserBuildDao { return &EpicHeroUserBuildDao{ - group: "default", - table: "epic_hero_user_build", - columns: epicHeroUserBuildColumns, - handlers: handlers, + group: "default", + table: "epic_hero_user_build", + columns: epicHeroUserBuildColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *EpicHeroUserBuildDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *EpicHeroUserBuildDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *EpicHeroUserBuildDao) Columns() EpicHeroUserBuildColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *EpicHeroUserBuildDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *EpicHeroUserBuildDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *EpicHeroUserBuildDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/epic_i_18_n_mappings.go b/internal/dao/internal/epic_i_18_n_mappings.go index 82c4cbc..444cfc2 100644 --- a/internal/dao/internal/epic_i_18_n_mappings.go +++ b/internal/dao/internal/epic_i_18_n_mappings.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// EpicI18NMappingsDao is the data access object for the table epic_i18n_mappings. +// EpicI18NMappingsDao is the data access object for table epic_i18n_mappings. type EpicI18NMappingsDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns EpicI18NMappingsColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns EpicI18NMappingsColumns // columns contains all the column names of Table for convenient usage. } -// EpicI18NMappingsColumns defines and stores column names for the table epic_i18n_mappings. +// EpicI18NMappingsColumns defines and stores column names for table epic_i18n_mappings. type EpicI18NMappingsColumns struct { Id string // 主键ID KeyName string // 英文key @@ -34,7 +33,7 @@ type EpicI18NMappingsColumns struct { Deleted string // 是否删除 } -// epicI18NMappingsColumns holds the columns for the table epic_i18n_mappings. +// epicI18NMappingsColumns holds the columns for table epic_i18n_mappings. var epicI18NMappingsColumns = EpicI18NMappingsColumns{ Id: "id", KeyName: "key_name", @@ -50,49 +49,44 @@ var epicI18NMappingsColumns = EpicI18NMappingsColumns{ } // NewEpicI18NMappingsDao creates and returns a new DAO object for table data access. -func NewEpicI18NMappingsDao(handlers ...gdb.ModelHandler) *EpicI18NMappingsDao { +func NewEpicI18NMappingsDao() *EpicI18NMappingsDao { return &EpicI18NMappingsDao{ - group: "default", - table: "epic_i18n_mappings", - columns: epicI18NMappingsColumns, - handlers: handlers, + group: "default", + table: "epic_i18n_mappings", + columns: epicI18NMappingsColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *EpicI18NMappingsDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *EpicI18NMappingsDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *EpicI18NMappingsDao) Columns() EpicI18NMappingsColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *EpicI18NMappingsDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *EpicI18NMappingsDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *EpicI18NMappingsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/fribble_hero_set.go b/internal/dao/internal/fribble_hero_set.go index 8366b9a..5b120de 100644 --- a/internal/dao/internal/fribble_hero_set.go +++ b/internal/dao/internal/fribble_hero_set.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// FribbleHeroSetDao is the data access object for the table fribble_hero_set. +// FribbleHeroSetDao is the data access object for table fribble_hero_set. type FribbleHeroSetDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns FribbleHeroSetColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns FribbleHeroSetColumns // columns contains all the column names of Table for convenient usage. } -// FribbleHeroSetColumns defines and stores column names for the table fribble_hero_set. +// FribbleHeroSetColumns defines and stores column names for table fribble_hero_set. type FribbleHeroSetColumns struct { Id string // 文件编号 HeroCode string // 配置编号 @@ -33,7 +32,7 @@ type FribbleHeroSetColumns struct { SuccessGet string // } -// fribbleHeroSetColumns holds the columns for the table fribble_hero_set. +// fribbleHeroSetColumns holds the columns for table fribble_hero_set. var fribbleHeroSetColumns = FribbleHeroSetColumns{ Id: "id", HeroCode: "hero_code", @@ -48,49 +47,44 @@ var fribbleHeroSetColumns = FribbleHeroSetColumns{ } // NewFribbleHeroSetDao creates and returns a new DAO object for table data access. -func NewFribbleHeroSetDao(handlers ...gdb.ModelHandler) *FribbleHeroSetDao { +func NewFribbleHeroSetDao() *FribbleHeroSetDao { return &FribbleHeroSetDao{ - group: "default", - table: "fribble_hero_set", - columns: fribbleHeroSetColumns, - handlers: handlers, + group: "default", + table: "fribble_hero_set", + columns: fribbleHeroSetColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *FribbleHeroSetDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *FribbleHeroSetDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *FribbleHeroSetDao) Columns() FribbleHeroSetColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *FribbleHeroSetDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *FribbleHeroSetDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *FribbleHeroSetDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/gear_set_info.go b/internal/dao/internal/gear_set_info.go index ac1b652..17ce58d 100644 --- a/internal/dao/internal/gear_set_info.go +++ b/internal/dao/internal/gear_set_info.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// GearSetInfoDao is the data access object for the table gear_set_info. +// GearSetInfoDao is the data access object for table gear_set_info. type GearSetInfoDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns GearSetInfoColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns GearSetInfoColumns // columns contains all the column names of Table for convenient usage. } -// GearSetInfoColumns defines and stores column names for the table gear_set_info. +// GearSetInfoColumns defines and stores column names for table gear_set_info. type GearSetInfoColumns struct { Id string // 装备ID Level string // 装备等级 @@ -46,7 +45,7 @@ type GearSetInfoColumns struct { TenantId string // 租户编号 } -// gearSetInfoColumns holds the columns for the table gear_set_info. +// gearSetInfoColumns holds the columns for table gear_set_info. var gearSetInfoColumns = GearSetInfoColumns{ Id: "id", Level: "level", @@ -74,49 +73,44 @@ var gearSetInfoColumns = GearSetInfoColumns{ } // NewGearSetInfoDao creates and returns a new DAO object for table data access. -func NewGearSetInfoDao(handlers ...gdb.ModelHandler) *GearSetInfoDao { +func NewGearSetInfoDao() *GearSetInfoDao { return &GearSetInfoDao{ - group: "default", - table: "gear_set_info", - columns: gearSetInfoColumns, - handlers: handlers, + group: "default", + table: "gear_set_info", + columns: gearSetInfoColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *GearSetInfoDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *GearSetInfoDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *GearSetInfoDao) Columns() GearSetInfoColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *GearSetInfoDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *GearSetInfoDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *GearSetInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/infra_api_access_log.go b/internal/dao/internal/infra_api_access_log.go index 97240c1..d4a60bc 100644 --- a/internal/dao/internal/infra_api_access_log.go +++ b/internal/dao/internal/infra_api_access_log.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// InfraApiAccessLogDao is the data access object for the table infra_api_access_log. +// InfraApiAccessLogDao is the data access object for table infra_api_access_log. type InfraApiAccessLogDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns InfraApiAccessLogColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns InfraApiAccessLogColumns // columns contains all the column names of Table for convenient usage. } -// InfraApiAccessLogColumns defines and stores column names for the table infra_api_access_log. +// InfraApiAccessLogColumns defines and stores column names for table infra_api_access_log. type InfraApiAccessLogColumns struct { Id string // 日志主键 TraceId string // 链路追踪编号 @@ -48,7 +47,7 @@ type InfraApiAccessLogColumns struct { TenantId string // 租户编号 } -// infraApiAccessLogColumns holds the columns for the table infra_api_access_log. +// infraApiAccessLogColumns holds the columns for table infra_api_access_log. var infraApiAccessLogColumns = InfraApiAccessLogColumns{ Id: "id", TraceId: "trace_id", @@ -78,49 +77,44 @@ var infraApiAccessLogColumns = InfraApiAccessLogColumns{ } // NewInfraApiAccessLogDao creates and returns a new DAO object for table data access. -func NewInfraApiAccessLogDao(handlers ...gdb.ModelHandler) *InfraApiAccessLogDao { +func NewInfraApiAccessLogDao() *InfraApiAccessLogDao { return &InfraApiAccessLogDao{ - group: "default", - table: "infra_api_access_log", - columns: infraApiAccessLogColumns, - handlers: handlers, + group: "default", + table: "infra_api_access_log", + columns: infraApiAccessLogColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *InfraApiAccessLogDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *InfraApiAccessLogDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *InfraApiAccessLogDao) Columns() InfraApiAccessLogColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *InfraApiAccessLogDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *InfraApiAccessLogDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *InfraApiAccessLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/infra_api_error_log.go b/internal/dao/internal/infra_api_error_log.go index 9bf8920..c301137 100644 --- a/internal/dao/internal/infra_api_error_log.go +++ b/internal/dao/internal/infra_api_error_log.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// InfraApiErrorLogDao is the data access object for the table infra_api_error_log. +// InfraApiErrorLogDao is the data access object for table infra_api_error_log. type InfraApiErrorLogDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns InfraApiErrorLogColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns InfraApiErrorLogColumns // columns contains all the column names of Table for convenient usage. } -// InfraApiErrorLogColumns defines and stores column names for the table infra_api_error_log. +// InfraApiErrorLogColumns defines and stores column names for table infra_api_error_log. type InfraApiErrorLogColumns struct { Id string // 编号 TraceId string // 链路追踪编号 @@ -51,7 +50,7 @@ type InfraApiErrorLogColumns struct { TenantId string // 租户编号 } -// infraApiErrorLogColumns holds the columns for the table infra_api_error_log. +// infraApiErrorLogColumns holds the columns for table infra_api_error_log. var infraApiErrorLogColumns = InfraApiErrorLogColumns{ Id: "id", TraceId: "trace_id", @@ -84,49 +83,44 @@ var infraApiErrorLogColumns = InfraApiErrorLogColumns{ } // NewInfraApiErrorLogDao creates and returns a new DAO object for table data access. -func NewInfraApiErrorLogDao(handlers ...gdb.ModelHandler) *InfraApiErrorLogDao { +func NewInfraApiErrorLogDao() *InfraApiErrorLogDao { return &InfraApiErrorLogDao{ - group: "default", - table: "infra_api_error_log", - columns: infraApiErrorLogColumns, - handlers: handlers, + group: "default", + table: "infra_api_error_log", + columns: infraApiErrorLogColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *InfraApiErrorLogDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *InfraApiErrorLogDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *InfraApiErrorLogDao) Columns() InfraApiErrorLogColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *InfraApiErrorLogDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *InfraApiErrorLogDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *InfraApiErrorLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/infra_codegen_column.go b/internal/dao/internal/infra_codegen_column.go index de2109d..27d92f2 100644 --- a/internal/dao/internal/infra_codegen_column.go +++ b/internal/dao/internal/infra_codegen_column.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// InfraCodegenColumnDao is the data access object for the table infra_codegen_column. +// InfraCodegenColumnDao is the data access object for table infra_codegen_column. type InfraCodegenColumnDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns InfraCodegenColumnColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns InfraCodegenColumnColumns // columns contains all the column names of Table for convenient usage. } -// InfraCodegenColumnColumns defines and stores column names for the table infra_codegen_column. +// InfraCodegenColumnColumns defines and stores column names for table infra_codegen_column. type InfraCodegenColumnColumns struct { Id string // 编号 TableId string // 表编号 @@ -46,7 +45,7 @@ type InfraCodegenColumnColumns struct { Deleted string // 是否删除 } -// infraCodegenColumnColumns holds the columns for the table infra_codegen_column. +// infraCodegenColumnColumns holds the columns for table infra_codegen_column. var infraCodegenColumnColumns = InfraCodegenColumnColumns{ Id: "id", TableId: "table_id", @@ -74,49 +73,44 @@ var infraCodegenColumnColumns = InfraCodegenColumnColumns{ } // NewInfraCodegenColumnDao creates and returns a new DAO object for table data access. -func NewInfraCodegenColumnDao(handlers ...gdb.ModelHandler) *InfraCodegenColumnDao { +func NewInfraCodegenColumnDao() *InfraCodegenColumnDao { return &InfraCodegenColumnDao{ - group: "default", - table: "infra_codegen_column", - columns: infraCodegenColumnColumns, - handlers: handlers, + group: "default", + table: "infra_codegen_column", + columns: infraCodegenColumnColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *InfraCodegenColumnDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *InfraCodegenColumnDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *InfraCodegenColumnDao) Columns() InfraCodegenColumnColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *InfraCodegenColumnDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *InfraCodegenColumnDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *InfraCodegenColumnDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/infra_codegen_table.go b/internal/dao/internal/infra_codegen_table.go index 5940e07..0577a5a 100644 --- a/internal/dao/internal/infra_codegen_table.go +++ b/internal/dao/internal/infra_codegen_table.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// InfraCodegenTableDao is the data access object for the table infra_codegen_table. +// InfraCodegenTableDao is the data access object for table infra_codegen_table. type InfraCodegenTableDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns InfraCodegenTableColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns InfraCodegenTableColumns // columns contains all the column names of Table for convenient usage. } -// InfraCodegenTableColumns defines and stores column names for the table infra_codegen_table. +// InfraCodegenTableColumns defines and stores column names for table infra_codegen_table. type InfraCodegenTableColumns struct { Id string // 编号 DataSourceConfigId string // 数据源配置的编号 @@ -47,7 +46,7 @@ type InfraCodegenTableColumns struct { Deleted string // 是否删除 } -// infraCodegenTableColumns holds the columns for the table infra_codegen_table. +// infraCodegenTableColumns holds the columns for table infra_codegen_table. var infraCodegenTableColumns = InfraCodegenTableColumns{ Id: "id", DataSourceConfigId: "data_source_config_id", @@ -76,49 +75,44 @@ var infraCodegenTableColumns = InfraCodegenTableColumns{ } // NewInfraCodegenTableDao creates and returns a new DAO object for table data access. -func NewInfraCodegenTableDao(handlers ...gdb.ModelHandler) *InfraCodegenTableDao { +func NewInfraCodegenTableDao() *InfraCodegenTableDao { return &InfraCodegenTableDao{ - group: "default", - table: "infra_codegen_table", - columns: infraCodegenTableColumns, - handlers: handlers, + group: "default", + table: "infra_codegen_table", + columns: infraCodegenTableColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *InfraCodegenTableDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *InfraCodegenTableDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *InfraCodegenTableDao) Columns() InfraCodegenTableColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *InfraCodegenTableDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *InfraCodegenTableDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *InfraCodegenTableDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/infra_config.go b/internal/dao/internal/infra_config.go index 5cab566..366a6a1 100644 --- a/internal/dao/internal/infra_config.go +++ b/internal/dao/internal/infra_config.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// InfraConfigDao is the data access object for the table infra_config. +// InfraConfigDao is the data access object for table infra_config. type InfraConfigDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns InfraConfigColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns InfraConfigColumns // columns contains all the column names of Table for convenient usage. } -// InfraConfigColumns defines and stores column names for the table infra_config. +// InfraConfigColumns defines and stores column names for table infra_config. type InfraConfigColumns struct { Id string // 参数主键 Category string // 参数分组 @@ -36,7 +35,7 @@ type InfraConfigColumns struct { Deleted string // 是否删除 } -// infraConfigColumns holds the columns for the table infra_config. +// infraConfigColumns holds the columns for table infra_config. var infraConfigColumns = InfraConfigColumns{ Id: "id", Category: "category", @@ -54,49 +53,44 @@ var infraConfigColumns = InfraConfigColumns{ } // NewInfraConfigDao creates and returns a new DAO object for table data access. -func NewInfraConfigDao(handlers ...gdb.ModelHandler) *InfraConfigDao { +func NewInfraConfigDao() *InfraConfigDao { return &InfraConfigDao{ - group: "default", - table: "infra_config", - columns: infraConfigColumns, - handlers: handlers, + group: "default", + table: "infra_config", + columns: infraConfigColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *InfraConfigDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *InfraConfigDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *InfraConfigDao) Columns() InfraConfigColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *InfraConfigDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *InfraConfigDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *InfraConfigDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/infra_data_source_config.go b/internal/dao/internal/infra_data_source_config.go index 9e7ebb4..b16cdfd 100644 --- a/internal/dao/internal/infra_data_source_config.go +++ b/internal/dao/internal/infra_data_source_config.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// InfraDataSourceConfigDao is the data access object for the table infra_data_source_config. +// InfraDataSourceConfigDao is the data access object for table infra_data_source_config. type InfraDataSourceConfigDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns InfraDataSourceConfigColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns InfraDataSourceConfigColumns // columns contains all the column names of Table for convenient usage. } -// InfraDataSourceConfigColumns defines and stores column names for the table infra_data_source_config. +// InfraDataSourceConfigColumns defines and stores column names for table infra_data_source_config. type InfraDataSourceConfigColumns struct { Id string // 主键编号 Name string // 参数名称 @@ -33,7 +32,7 @@ type InfraDataSourceConfigColumns struct { Deleted string // 是否删除 } -// infraDataSourceConfigColumns holds the columns for the table infra_data_source_config. +// infraDataSourceConfigColumns holds the columns for table infra_data_source_config. var infraDataSourceConfigColumns = InfraDataSourceConfigColumns{ Id: "id", Name: "name", @@ -48,49 +47,44 @@ var infraDataSourceConfigColumns = InfraDataSourceConfigColumns{ } // NewInfraDataSourceConfigDao creates and returns a new DAO object for table data access. -func NewInfraDataSourceConfigDao(handlers ...gdb.ModelHandler) *InfraDataSourceConfigDao { +func NewInfraDataSourceConfigDao() *InfraDataSourceConfigDao { return &InfraDataSourceConfigDao{ - group: "default", - table: "infra_data_source_config", - columns: infraDataSourceConfigColumns, - handlers: handlers, + group: "default", + table: "infra_data_source_config", + columns: infraDataSourceConfigColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *InfraDataSourceConfigDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *InfraDataSourceConfigDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *InfraDataSourceConfigDao) Columns() InfraDataSourceConfigColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *InfraDataSourceConfigDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *InfraDataSourceConfigDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *InfraDataSourceConfigDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/infra_file.go b/internal/dao/internal/infra_file.go index 52d2450..4110dc9 100644 --- a/internal/dao/internal/infra_file.go +++ b/internal/dao/internal/infra_file.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// InfraFileDao is the data access object for the table infra_file. +// InfraFileDao is the data access object for table infra_file. type InfraFileDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns InfraFileColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns InfraFileColumns // columns contains all the column names of Table for convenient usage. } -// InfraFileColumns defines and stores column names for the table infra_file. +// InfraFileColumns defines and stores column names for table infra_file. type InfraFileColumns struct { Id string // 文件编号 ConfigId string // 配置编号 @@ -35,7 +34,7 @@ type InfraFileColumns struct { Deleted string // 是否删除 } -// infraFileColumns holds the columns for the table infra_file. +// infraFileColumns holds the columns for table infra_file. var infraFileColumns = InfraFileColumns{ Id: "id", ConfigId: "config_id", @@ -52,49 +51,44 @@ var infraFileColumns = InfraFileColumns{ } // NewInfraFileDao creates and returns a new DAO object for table data access. -func NewInfraFileDao(handlers ...gdb.ModelHandler) *InfraFileDao { +func NewInfraFileDao() *InfraFileDao { return &InfraFileDao{ - group: "default", - table: "infra_file", - columns: infraFileColumns, - handlers: handlers, + group: "default", + table: "infra_file", + columns: infraFileColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *InfraFileDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *InfraFileDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *InfraFileDao) Columns() InfraFileColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *InfraFileDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *InfraFileDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *InfraFileDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/infra_file_config.go b/internal/dao/internal/infra_file_config.go index de216e7..0dae19c 100644 --- a/internal/dao/internal/infra_file_config.go +++ b/internal/dao/internal/infra_file_config.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// InfraFileConfigDao is the data access object for the table infra_file_config. +// InfraFileConfigDao is the data access object for table infra_file_config. type InfraFileConfigDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns InfraFileConfigColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns InfraFileConfigColumns // columns contains all the column names of Table for convenient usage. } -// InfraFileConfigColumns defines and stores column names for the table infra_file_config. +// InfraFileConfigColumns defines and stores column names for table infra_file_config. type InfraFileConfigColumns struct { Id string // 编号 Name string // 配置名 @@ -34,7 +33,7 @@ type InfraFileConfigColumns struct { Deleted string // 是否删除 } -// infraFileConfigColumns holds the columns for the table infra_file_config. +// infraFileConfigColumns holds the columns for table infra_file_config. var infraFileConfigColumns = InfraFileConfigColumns{ Id: "id", Name: "name", @@ -50,49 +49,44 @@ var infraFileConfigColumns = InfraFileConfigColumns{ } // NewInfraFileConfigDao creates and returns a new DAO object for table data access. -func NewInfraFileConfigDao(handlers ...gdb.ModelHandler) *InfraFileConfigDao { +func NewInfraFileConfigDao() *InfraFileConfigDao { return &InfraFileConfigDao{ - group: "default", - table: "infra_file_config", - columns: infraFileConfigColumns, - handlers: handlers, + group: "default", + table: "infra_file_config", + columns: infraFileConfigColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *InfraFileConfigDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *InfraFileConfigDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *InfraFileConfigDao) Columns() InfraFileConfigColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *InfraFileConfigDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *InfraFileConfigDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *InfraFileConfigDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/infra_file_content.go b/internal/dao/internal/infra_file_content.go index 60308df..b3bd7c9 100644 --- a/internal/dao/internal/infra_file_content.go +++ b/internal/dao/internal/infra_file_content.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// InfraFileContentDao is the data access object for the table infra_file_content. +// InfraFileContentDao is the data access object for table infra_file_content. type InfraFileContentDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns InfraFileContentColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns InfraFileContentColumns // columns contains all the column names of Table for convenient usage. } -// InfraFileContentColumns defines and stores column names for the table infra_file_content. +// InfraFileContentColumns defines and stores column names for table infra_file_content. type InfraFileContentColumns struct { Id string // 编号 ConfigId string // 配置编号 @@ -32,7 +31,7 @@ type InfraFileContentColumns struct { Deleted string // 是否删除 } -// infraFileContentColumns holds the columns for the table infra_file_content. +// infraFileContentColumns holds the columns for table infra_file_content. var infraFileContentColumns = InfraFileContentColumns{ Id: "id", ConfigId: "config_id", @@ -46,49 +45,44 @@ var infraFileContentColumns = InfraFileContentColumns{ } // NewInfraFileContentDao creates and returns a new DAO object for table data access. -func NewInfraFileContentDao(handlers ...gdb.ModelHandler) *InfraFileContentDao { +func NewInfraFileContentDao() *InfraFileContentDao { return &InfraFileContentDao{ - group: "default", - table: "infra_file_content", - columns: infraFileContentColumns, - handlers: handlers, + group: "default", + table: "infra_file_content", + columns: infraFileContentColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *InfraFileContentDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *InfraFileContentDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *InfraFileContentDao) Columns() InfraFileContentColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *InfraFileContentDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *InfraFileContentDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *InfraFileContentDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/infra_job.go b/internal/dao/internal/infra_job.go index 638e969..7c1609a 100644 --- a/internal/dao/internal/infra_job.go +++ b/internal/dao/internal/infra_job.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// InfraJobDao is the data access object for the table infra_job. +// InfraJobDao is the data access object for table infra_job. type InfraJobDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns InfraJobColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns InfraJobColumns // columns contains all the column names of Table for convenient usage. } -// InfraJobColumns defines and stores column names for the table infra_job. +// InfraJobColumns defines and stores column names for table infra_job. type InfraJobColumns struct { Id string // 任务编号 Name string // 任务名称 @@ -37,7 +36,7 @@ type InfraJobColumns struct { Deleted string // 是否删除 } -// infraJobColumns holds the columns for the table infra_job. +// infraJobColumns holds the columns for table infra_job. var infraJobColumns = InfraJobColumns{ Id: "id", Name: "name", @@ -56,49 +55,44 @@ var infraJobColumns = InfraJobColumns{ } // NewInfraJobDao creates and returns a new DAO object for table data access. -func NewInfraJobDao(handlers ...gdb.ModelHandler) *InfraJobDao { +func NewInfraJobDao() *InfraJobDao { return &InfraJobDao{ - group: "default", - table: "infra_job", - columns: infraJobColumns, - handlers: handlers, + group: "default", + table: "infra_job", + columns: infraJobColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *InfraJobDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *InfraJobDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *InfraJobDao) Columns() InfraJobColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *InfraJobDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *InfraJobDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *InfraJobDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/infra_job_log.go b/internal/dao/internal/infra_job_log.go index f745504..5de1eb7 100644 --- a/internal/dao/internal/infra_job_log.go +++ b/internal/dao/internal/infra_job_log.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// InfraJobLogDao is the data access object for the table infra_job_log. +// InfraJobLogDao is the data access object for table infra_job_log. type InfraJobLogDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns InfraJobLogColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns InfraJobLogColumns // columns contains all the column names of Table for convenient usage. } -// InfraJobLogColumns defines and stores column names for the table infra_job_log. +// InfraJobLogColumns defines and stores column names for table infra_job_log. type InfraJobLogColumns struct { Id string // 日志编号 JobId string // 任务编号 @@ -38,7 +37,7 @@ type InfraJobLogColumns struct { Deleted string // 是否删除 } -// infraJobLogColumns holds the columns for the table infra_job_log. +// infraJobLogColumns holds the columns for table infra_job_log. var infraJobLogColumns = InfraJobLogColumns{ Id: "id", JobId: "job_id", @@ -58,49 +57,44 @@ var infraJobLogColumns = InfraJobLogColumns{ } // NewInfraJobLogDao creates and returns a new DAO object for table data access. -func NewInfraJobLogDao(handlers ...gdb.ModelHandler) *InfraJobLogDao { +func NewInfraJobLogDao() *InfraJobLogDao { return &InfraJobLogDao{ - group: "default", - table: "infra_job_log", - columns: infraJobLogColumns, - handlers: handlers, + group: "default", + table: "infra_job_log", + columns: infraJobLogColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *InfraJobLogDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *InfraJobLogDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *InfraJobLogDao) Columns() InfraJobLogColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *InfraJobLogDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *InfraJobLogDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *InfraJobLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/qrtz_blob_triggers.go b/internal/dao/internal/qrtz_blob_triggers.go index fd6f54d..7bbe8f8 100644 --- a/internal/dao/internal/qrtz_blob_triggers.go +++ b/internal/dao/internal/qrtz_blob_triggers.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// QrtzBlobTriggersDao is the data access object for the table qrtz_blob_triggers. +// QrtzBlobTriggersDao is the data access object for table qrtz_blob_triggers. type QrtzBlobTriggersDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns QrtzBlobTriggersColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns QrtzBlobTriggersColumns // columns contains all the column names of Table for convenient usage. } -// QrtzBlobTriggersColumns defines and stores column names for the table qrtz_blob_triggers. +// QrtzBlobTriggersColumns defines and stores column names for table qrtz_blob_triggers. type QrtzBlobTriggersColumns struct { SchedName string // TriggerName string // @@ -27,7 +26,7 @@ type QrtzBlobTriggersColumns struct { BlobData string // } -// qrtzBlobTriggersColumns holds the columns for the table qrtz_blob_triggers. +// qrtzBlobTriggersColumns holds the columns for table qrtz_blob_triggers. var qrtzBlobTriggersColumns = QrtzBlobTriggersColumns{ SchedName: "SCHED_NAME", TriggerName: "TRIGGER_NAME", @@ -36,49 +35,44 @@ var qrtzBlobTriggersColumns = QrtzBlobTriggersColumns{ } // NewQrtzBlobTriggersDao creates and returns a new DAO object for table data access. -func NewQrtzBlobTriggersDao(handlers ...gdb.ModelHandler) *QrtzBlobTriggersDao { +func NewQrtzBlobTriggersDao() *QrtzBlobTriggersDao { return &QrtzBlobTriggersDao{ - group: "default", - table: "qrtz_blob_triggers", - columns: qrtzBlobTriggersColumns, - handlers: handlers, + group: "default", + table: "qrtz_blob_triggers", + columns: qrtzBlobTriggersColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *QrtzBlobTriggersDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *QrtzBlobTriggersDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *QrtzBlobTriggersDao) Columns() QrtzBlobTriggersColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *QrtzBlobTriggersDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *QrtzBlobTriggersDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *QrtzBlobTriggersDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/qrtz_calendars.go b/internal/dao/internal/qrtz_calendars.go index 4de1abf..5d729cb 100644 --- a/internal/dao/internal/qrtz_calendars.go +++ b/internal/dao/internal/qrtz_calendars.go @@ -11,22 +11,21 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// QrtzCalendarsDao is the data access object for the table qrtz_calendars. +// QrtzCalendarsDao is the data access object for table qrtz_calendars. type QrtzCalendarsDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns QrtzCalendarsColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns QrtzCalendarsColumns // columns contains all the column names of Table for convenient usage. } -// QrtzCalendarsColumns defines and stores column names for the table qrtz_calendars. +// QrtzCalendarsColumns defines and stores column names for table qrtz_calendars. type QrtzCalendarsColumns struct { SchedName string // CalendarName string // Calendar string // } -// qrtzCalendarsColumns holds the columns for the table qrtz_calendars. +// qrtzCalendarsColumns holds the columns for table qrtz_calendars. var qrtzCalendarsColumns = QrtzCalendarsColumns{ SchedName: "SCHED_NAME", CalendarName: "CALENDAR_NAME", @@ -34,49 +33,44 @@ var qrtzCalendarsColumns = QrtzCalendarsColumns{ } // NewQrtzCalendarsDao creates and returns a new DAO object for table data access. -func NewQrtzCalendarsDao(handlers ...gdb.ModelHandler) *QrtzCalendarsDao { +func NewQrtzCalendarsDao() *QrtzCalendarsDao { return &QrtzCalendarsDao{ - group: "default", - table: "qrtz_calendars", - columns: qrtzCalendarsColumns, - handlers: handlers, + group: "default", + table: "qrtz_calendars", + columns: qrtzCalendarsColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *QrtzCalendarsDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *QrtzCalendarsDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *QrtzCalendarsDao) Columns() QrtzCalendarsColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *QrtzCalendarsDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *QrtzCalendarsDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *QrtzCalendarsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/qrtz_cron_triggers.go b/internal/dao/internal/qrtz_cron_triggers.go index c83e04b..45c1faa 100644 --- a/internal/dao/internal/qrtz_cron_triggers.go +++ b/internal/dao/internal/qrtz_cron_triggers.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// QrtzCronTriggersDao is the data access object for the table qrtz_cron_triggers. +// QrtzCronTriggersDao is the data access object for table qrtz_cron_triggers. type QrtzCronTriggersDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns QrtzCronTriggersColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns QrtzCronTriggersColumns // columns contains all the column names of Table for convenient usage. } -// QrtzCronTriggersColumns defines and stores column names for the table qrtz_cron_triggers. +// QrtzCronTriggersColumns defines and stores column names for table qrtz_cron_triggers. type QrtzCronTriggersColumns struct { SchedName string // TriggerName string // @@ -28,7 +27,7 @@ type QrtzCronTriggersColumns struct { TimeZoneId string // } -// qrtzCronTriggersColumns holds the columns for the table qrtz_cron_triggers. +// qrtzCronTriggersColumns holds the columns for table qrtz_cron_triggers. var qrtzCronTriggersColumns = QrtzCronTriggersColumns{ SchedName: "SCHED_NAME", TriggerName: "TRIGGER_NAME", @@ -38,49 +37,44 @@ var qrtzCronTriggersColumns = QrtzCronTriggersColumns{ } // NewQrtzCronTriggersDao creates and returns a new DAO object for table data access. -func NewQrtzCronTriggersDao(handlers ...gdb.ModelHandler) *QrtzCronTriggersDao { +func NewQrtzCronTriggersDao() *QrtzCronTriggersDao { return &QrtzCronTriggersDao{ - group: "default", - table: "qrtz_cron_triggers", - columns: qrtzCronTriggersColumns, - handlers: handlers, + group: "default", + table: "qrtz_cron_triggers", + columns: qrtzCronTriggersColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *QrtzCronTriggersDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *QrtzCronTriggersDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *QrtzCronTriggersDao) Columns() QrtzCronTriggersColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *QrtzCronTriggersDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *QrtzCronTriggersDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *QrtzCronTriggersDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/qrtz_fired_triggers.go b/internal/dao/internal/qrtz_fired_triggers.go index 8b17bf2..55b78b8 100644 --- a/internal/dao/internal/qrtz_fired_triggers.go +++ b/internal/dao/internal/qrtz_fired_triggers.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// QrtzFiredTriggersDao is the data access object for the table qrtz_fired_triggers. +// QrtzFiredTriggersDao is the data access object for table qrtz_fired_triggers. type QrtzFiredTriggersDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns QrtzFiredTriggersColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns QrtzFiredTriggersColumns // columns contains all the column names of Table for convenient usage. } -// QrtzFiredTriggersColumns defines and stores column names for the table qrtz_fired_triggers. +// QrtzFiredTriggersColumns defines and stores column names for table qrtz_fired_triggers. type QrtzFiredTriggersColumns struct { SchedName string // EntryId string // @@ -36,7 +35,7 @@ type QrtzFiredTriggersColumns struct { RequestsRecovery string // } -// qrtzFiredTriggersColumns holds the columns for the table qrtz_fired_triggers. +// qrtzFiredTriggersColumns holds the columns for table qrtz_fired_triggers. var qrtzFiredTriggersColumns = QrtzFiredTriggersColumns{ SchedName: "SCHED_NAME", EntryId: "ENTRY_ID", @@ -54,49 +53,44 @@ var qrtzFiredTriggersColumns = QrtzFiredTriggersColumns{ } // NewQrtzFiredTriggersDao creates and returns a new DAO object for table data access. -func NewQrtzFiredTriggersDao(handlers ...gdb.ModelHandler) *QrtzFiredTriggersDao { +func NewQrtzFiredTriggersDao() *QrtzFiredTriggersDao { return &QrtzFiredTriggersDao{ - group: "default", - table: "qrtz_fired_triggers", - columns: qrtzFiredTriggersColumns, - handlers: handlers, + group: "default", + table: "qrtz_fired_triggers", + columns: qrtzFiredTriggersColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *QrtzFiredTriggersDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *QrtzFiredTriggersDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *QrtzFiredTriggersDao) Columns() QrtzFiredTriggersColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *QrtzFiredTriggersDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *QrtzFiredTriggersDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *QrtzFiredTriggersDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/qrtz_job_details.go b/internal/dao/internal/qrtz_job_details.go index e7de9f6..ada1ee9 100644 --- a/internal/dao/internal/qrtz_job_details.go +++ b/internal/dao/internal/qrtz_job_details.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// QrtzJobDetailsDao is the data access object for the table qrtz_job_details. +// QrtzJobDetailsDao is the data access object for table qrtz_job_details. type QrtzJobDetailsDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns QrtzJobDetailsColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns QrtzJobDetailsColumns // columns contains all the column names of Table for convenient usage. } -// QrtzJobDetailsColumns defines and stores column names for the table qrtz_job_details. +// QrtzJobDetailsColumns defines and stores column names for table qrtz_job_details. type QrtzJobDetailsColumns struct { SchedName string // JobName string // @@ -33,7 +32,7 @@ type QrtzJobDetailsColumns struct { JobData string // } -// qrtzJobDetailsColumns holds the columns for the table qrtz_job_details. +// qrtzJobDetailsColumns holds the columns for table qrtz_job_details. var qrtzJobDetailsColumns = QrtzJobDetailsColumns{ SchedName: "SCHED_NAME", JobName: "JOB_NAME", @@ -48,49 +47,44 @@ var qrtzJobDetailsColumns = QrtzJobDetailsColumns{ } // NewQrtzJobDetailsDao creates and returns a new DAO object for table data access. -func NewQrtzJobDetailsDao(handlers ...gdb.ModelHandler) *QrtzJobDetailsDao { +func NewQrtzJobDetailsDao() *QrtzJobDetailsDao { return &QrtzJobDetailsDao{ - group: "default", - table: "qrtz_job_details", - columns: qrtzJobDetailsColumns, - handlers: handlers, + group: "default", + table: "qrtz_job_details", + columns: qrtzJobDetailsColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *QrtzJobDetailsDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *QrtzJobDetailsDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *QrtzJobDetailsDao) Columns() QrtzJobDetailsColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *QrtzJobDetailsDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *QrtzJobDetailsDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *QrtzJobDetailsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/qrtz_locks.go b/internal/dao/internal/qrtz_locks.go index 7ec200e..b6e9b6b 100644 --- a/internal/dao/internal/qrtz_locks.go +++ b/internal/dao/internal/qrtz_locks.go @@ -11,70 +11,64 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// QrtzLocksDao is the data access object for the table qrtz_locks. +// QrtzLocksDao is the data access object for table qrtz_locks. type QrtzLocksDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns QrtzLocksColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns QrtzLocksColumns // columns contains all the column names of Table for convenient usage. } -// QrtzLocksColumns defines and stores column names for the table qrtz_locks. +// QrtzLocksColumns defines and stores column names for table qrtz_locks. type QrtzLocksColumns struct { SchedName string // LockName string // } -// qrtzLocksColumns holds the columns for the table qrtz_locks. +// qrtzLocksColumns holds the columns for table qrtz_locks. var qrtzLocksColumns = QrtzLocksColumns{ SchedName: "SCHED_NAME", LockName: "LOCK_NAME", } // NewQrtzLocksDao creates and returns a new DAO object for table data access. -func NewQrtzLocksDao(handlers ...gdb.ModelHandler) *QrtzLocksDao { +func NewQrtzLocksDao() *QrtzLocksDao { return &QrtzLocksDao{ - group: "default", - table: "qrtz_locks", - columns: qrtzLocksColumns, - handlers: handlers, + group: "default", + table: "qrtz_locks", + columns: qrtzLocksColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *QrtzLocksDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *QrtzLocksDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *QrtzLocksDao) Columns() QrtzLocksColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *QrtzLocksDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *QrtzLocksDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *QrtzLocksDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/qrtz_paused_trigger_grps.go b/internal/dao/internal/qrtz_paused_trigger_grps.go index 59f8307..0dae9d4 100644 --- a/internal/dao/internal/qrtz_paused_trigger_grps.go +++ b/internal/dao/internal/qrtz_paused_trigger_grps.go @@ -11,70 +11,64 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// QrtzPausedTriggerGrpsDao is the data access object for the table qrtz_paused_trigger_grps. +// QrtzPausedTriggerGrpsDao is the data access object for table qrtz_paused_trigger_grps. type QrtzPausedTriggerGrpsDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns QrtzPausedTriggerGrpsColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns QrtzPausedTriggerGrpsColumns // columns contains all the column names of Table for convenient usage. } -// QrtzPausedTriggerGrpsColumns defines and stores column names for the table qrtz_paused_trigger_grps. +// QrtzPausedTriggerGrpsColumns defines and stores column names for table qrtz_paused_trigger_grps. type QrtzPausedTriggerGrpsColumns struct { SchedName string // TriggerGroup string // } -// qrtzPausedTriggerGrpsColumns holds the columns for the table qrtz_paused_trigger_grps. +// qrtzPausedTriggerGrpsColumns holds the columns for table qrtz_paused_trigger_grps. var qrtzPausedTriggerGrpsColumns = QrtzPausedTriggerGrpsColumns{ SchedName: "SCHED_NAME", TriggerGroup: "TRIGGER_GROUP", } // NewQrtzPausedTriggerGrpsDao creates and returns a new DAO object for table data access. -func NewQrtzPausedTriggerGrpsDao(handlers ...gdb.ModelHandler) *QrtzPausedTriggerGrpsDao { +func NewQrtzPausedTriggerGrpsDao() *QrtzPausedTriggerGrpsDao { return &QrtzPausedTriggerGrpsDao{ - group: "default", - table: "qrtz_paused_trigger_grps", - columns: qrtzPausedTriggerGrpsColumns, - handlers: handlers, + group: "default", + table: "qrtz_paused_trigger_grps", + columns: qrtzPausedTriggerGrpsColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *QrtzPausedTriggerGrpsDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *QrtzPausedTriggerGrpsDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *QrtzPausedTriggerGrpsDao) Columns() QrtzPausedTriggerGrpsColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *QrtzPausedTriggerGrpsDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *QrtzPausedTriggerGrpsDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *QrtzPausedTriggerGrpsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/qrtz_scheduler_state.go b/internal/dao/internal/qrtz_scheduler_state.go index ba09ca6..3884fc1 100644 --- a/internal/dao/internal/qrtz_scheduler_state.go +++ b/internal/dao/internal/qrtz_scheduler_state.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// QrtzSchedulerStateDao is the data access object for the table qrtz_scheduler_state. +// QrtzSchedulerStateDao is the data access object for table qrtz_scheduler_state. type QrtzSchedulerStateDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns QrtzSchedulerStateColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns QrtzSchedulerStateColumns // columns contains all the column names of Table for convenient usage. } -// QrtzSchedulerStateColumns defines and stores column names for the table qrtz_scheduler_state. +// QrtzSchedulerStateColumns defines and stores column names for table qrtz_scheduler_state. type QrtzSchedulerStateColumns struct { SchedName string // InstanceName string // @@ -27,7 +26,7 @@ type QrtzSchedulerStateColumns struct { CheckinInterval string // } -// qrtzSchedulerStateColumns holds the columns for the table qrtz_scheduler_state. +// qrtzSchedulerStateColumns holds the columns for table qrtz_scheduler_state. var qrtzSchedulerStateColumns = QrtzSchedulerStateColumns{ SchedName: "SCHED_NAME", InstanceName: "INSTANCE_NAME", @@ -36,49 +35,44 @@ var qrtzSchedulerStateColumns = QrtzSchedulerStateColumns{ } // NewQrtzSchedulerStateDao creates and returns a new DAO object for table data access. -func NewQrtzSchedulerStateDao(handlers ...gdb.ModelHandler) *QrtzSchedulerStateDao { +func NewQrtzSchedulerStateDao() *QrtzSchedulerStateDao { return &QrtzSchedulerStateDao{ - group: "default", - table: "qrtz_scheduler_state", - columns: qrtzSchedulerStateColumns, - handlers: handlers, + group: "default", + table: "qrtz_scheduler_state", + columns: qrtzSchedulerStateColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *QrtzSchedulerStateDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *QrtzSchedulerStateDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *QrtzSchedulerStateDao) Columns() QrtzSchedulerStateColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *QrtzSchedulerStateDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *QrtzSchedulerStateDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *QrtzSchedulerStateDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/qrtz_simple_triggers.go b/internal/dao/internal/qrtz_simple_triggers.go index db0d815..59e9a31 100644 --- a/internal/dao/internal/qrtz_simple_triggers.go +++ b/internal/dao/internal/qrtz_simple_triggers.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// QrtzSimpleTriggersDao is the data access object for the table qrtz_simple_triggers. +// QrtzSimpleTriggersDao is the data access object for table qrtz_simple_triggers. type QrtzSimpleTriggersDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns QrtzSimpleTriggersColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns QrtzSimpleTriggersColumns // columns contains all the column names of Table for convenient usage. } -// QrtzSimpleTriggersColumns defines and stores column names for the table qrtz_simple_triggers. +// QrtzSimpleTriggersColumns defines and stores column names for table qrtz_simple_triggers. type QrtzSimpleTriggersColumns struct { SchedName string // TriggerName string // @@ -29,7 +28,7 @@ type QrtzSimpleTriggersColumns struct { TimesTriggered string // } -// qrtzSimpleTriggersColumns holds the columns for the table qrtz_simple_triggers. +// qrtzSimpleTriggersColumns holds the columns for table qrtz_simple_triggers. var qrtzSimpleTriggersColumns = QrtzSimpleTriggersColumns{ SchedName: "SCHED_NAME", TriggerName: "TRIGGER_NAME", @@ -40,49 +39,44 @@ var qrtzSimpleTriggersColumns = QrtzSimpleTriggersColumns{ } // NewQrtzSimpleTriggersDao creates and returns a new DAO object for table data access. -func NewQrtzSimpleTriggersDao(handlers ...gdb.ModelHandler) *QrtzSimpleTriggersDao { +func NewQrtzSimpleTriggersDao() *QrtzSimpleTriggersDao { return &QrtzSimpleTriggersDao{ - group: "default", - table: "qrtz_simple_triggers", - columns: qrtzSimpleTriggersColumns, - handlers: handlers, + group: "default", + table: "qrtz_simple_triggers", + columns: qrtzSimpleTriggersColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *QrtzSimpleTriggersDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *QrtzSimpleTriggersDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *QrtzSimpleTriggersDao) Columns() QrtzSimpleTriggersColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *QrtzSimpleTriggersDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *QrtzSimpleTriggersDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *QrtzSimpleTriggersDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/qrtz_simprop_triggers.go b/internal/dao/internal/qrtz_simprop_triggers.go index b29a5e4..b339332 100644 --- a/internal/dao/internal/qrtz_simprop_triggers.go +++ b/internal/dao/internal/qrtz_simprop_triggers.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// QrtzSimpropTriggersDao is the data access object for the table qrtz_simprop_triggers. +// QrtzSimpropTriggersDao is the data access object for table qrtz_simprop_triggers. type QrtzSimpropTriggersDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns QrtzSimpropTriggersColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns QrtzSimpropTriggersColumns // columns contains all the column names of Table for convenient usage. } -// QrtzSimpropTriggersColumns defines and stores column names for the table qrtz_simprop_triggers. +// QrtzSimpropTriggersColumns defines and stores column names for table qrtz_simprop_triggers. type QrtzSimpropTriggersColumns struct { SchedName string // TriggerName string // @@ -37,7 +36,7 @@ type QrtzSimpropTriggersColumns struct { BoolProp2 string // } -// qrtzSimpropTriggersColumns holds the columns for the table qrtz_simprop_triggers. +// qrtzSimpropTriggersColumns holds the columns for table qrtz_simprop_triggers. var qrtzSimpropTriggersColumns = QrtzSimpropTriggersColumns{ SchedName: "SCHED_NAME", TriggerName: "TRIGGER_NAME", @@ -56,49 +55,44 @@ var qrtzSimpropTriggersColumns = QrtzSimpropTriggersColumns{ } // NewQrtzSimpropTriggersDao creates and returns a new DAO object for table data access. -func NewQrtzSimpropTriggersDao(handlers ...gdb.ModelHandler) *QrtzSimpropTriggersDao { +func NewQrtzSimpropTriggersDao() *QrtzSimpropTriggersDao { return &QrtzSimpropTriggersDao{ - group: "default", - table: "qrtz_simprop_triggers", - columns: qrtzSimpropTriggersColumns, - handlers: handlers, + group: "default", + table: "qrtz_simprop_triggers", + columns: qrtzSimpropTriggersColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *QrtzSimpropTriggersDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *QrtzSimpropTriggersDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *QrtzSimpropTriggersDao) Columns() QrtzSimpropTriggersColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *QrtzSimpropTriggersDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *QrtzSimpropTriggersDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *QrtzSimpropTriggersDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/qrtz_triggers.go b/internal/dao/internal/qrtz_triggers.go index b40b5c8..c80efff 100644 --- a/internal/dao/internal/qrtz_triggers.go +++ b/internal/dao/internal/qrtz_triggers.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// QrtzTriggersDao is the data access object for the table qrtz_triggers. +// QrtzTriggersDao is the data access object for table qrtz_triggers. type QrtzTriggersDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns QrtzTriggersColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns QrtzTriggersColumns // columns contains all the column names of Table for convenient usage. } -// QrtzTriggersColumns defines and stores column names for the table qrtz_triggers. +// QrtzTriggersColumns defines and stores column names for table qrtz_triggers. type QrtzTriggersColumns struct { SchedName string // TriggerName string // @@ -39,7 +38,7 @@ type QrtzTriggersColumns struct { JobData string // } -// qrtzTriggersColumns holds the columns for the table qrtz_triggers. +// qrtzTriggersColumns holds the columns for table qrtz_triggers. var qrtzTriggersColumns = QrtzTriggersColumns{ SchedName: "SCHED_NAME", TriggerName: "TRIGGER_NAME", @@ -60,49 +59,44 @@ var qrtzTriggersColumns = QrtzTriggersColumns{ } // NewQrtzTriggersDao creates and returns a new DAO object for table data access. -func NewQrtzTriggersDao(handlers ...gdb.ModelHandler) *QrtzTriggersDao { +func NewQrtzTriggersDao() *QrtzTriggersDao { return &QrtzTriggersDao{ - group: "default", - table: "qrtz_triggers", - columns: qrtzTriggersColumns, - handlers: handlers, + group: "default", + table: "qrtz_triggers", + columns: qrtzTriggersColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *QrtzTriggersDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *QrtzTriggersDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *QrtzTriggersDao) Columns() QrtzTriggersColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *QrtzTriggersDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *QrtzTriggersDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *QrtzTriggersDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_dept.go b/internal/dao/internal/system_dept.go index 6183de6..c37bc5d 100644 --- a/internal/dao/internal/system_dept.go +++ b/internal/dao/internal/system_dept.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemDeptDao is the data access object for the table system_dept. +// SystemDeptDao is the data access object for table system_dept. type SystemDeptDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemDeptColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemDeptColumns // columns contains all the column names of Table for convenient usage. } -// SystemDeptColumns defines and stores column names for the table system_dept. +// SystemDeptColumns defines and stores column names for table system_dept. type SystemDeptColumns struct { Id string // 部门id Name string // 部门名称 @@ -37,7 +36,7 @@ type SystemDeptColumns struct { TenantId string // 租户编号 } -// systemDeptColumns holds the columns for the table system_dept. +// systemDeptColumns holds the columns for table system_dept. var systemDeptColumns = SystemDeptColumns{ Id: "id", Name: "name", @@ -56,49 +55,44 @@ var systemDeptColumns = SystemDeptColumns{ } // NewSystemDeptDao creates and returns a new DAO object for table data access. -func NewSystemDeptDao(handlers ...gdb.ModelHandler) *SystemDeptDao { +func NewSystemDeptDao() *SystemDeptDao { return &SystemDeptDao{ - group: "default", - table: "system_dept", - columns: systemDeptColumns, - handlers: handlers, + group: "default", + table: "system_dept", + columns: systemDeptColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemDeptDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemDeptDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemDeptDao) Columns() SystemDeptColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemDeptDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemDeptDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemDeptDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_dict_data.go b/internal/dao/internal/system_dict_data.go index a9885d4..654ce33 100644 --- a/internal/dao/internal/system_dict_data.go +++ b/internal/dao/internal/system_dict_data.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemDictDataDao is the data access object for the table system_dict_data. +// SystemDictDataDao is the data access object for table system_dict_data. type SystemDictDataDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemDictDataColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemDictDataColumns // columns contains all the column names of Table for convenient usage. } -// SystemDictDataColumns defines and stores column names for the table system_dict_data. +// SystemDictDataColumns defines and stores column names for table system_dict_data. type SystemDictDataColumns struct { Id string // 字典编码 Sort string // 字典排序 @@ -37,7 +36,7 @@ type SystemDictDataColumns struct { Deleted string // 是否删除 } -// systemDictDataColumns holds the columns for the table system_dict_data. +// systemDictDataColumns holds the columns for table system_dict_data. var systemDictDataColumns = SystemDictDataColumns{ Id: "id", Sort: "sort", @@ -56,49 +55,44 @@ var systemDictDataColumns = SystemDictDataColumns{ } // NewSystemDictDataDao creates and returns a new DAO object for table data access. -func NewSystemDictDataDao(handlers ...gdb.ModelHandler) *SystemDictDataDao { +func NewSystemDictDataDao() *SystemDictDataDao { return &SystemDictDataDao{ - group: "default", - table: "system_dict_data", - columns: systemDictDataColumns, - handlers: handlers, + group: "default", + table: "system_dict_data", + columns: systemDictDataColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemDictDataDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemDictDataDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemDictDataDao) Columns() SystemDictDataColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemDictDataDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemDictDataDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemDictDataDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_dict_type.go b/internal/dao/internal/system_dict_type.go index 9564a2e..4e9d525 100644 --- a/internal/dao/internal/system_dict_type.go +++ b/internal/dao/internal/system_dict_type.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemDictTypeDao is the data access object for the table system_dict_type. +// SystemDictTypeDao is the data access object for table system_dict_type. type SystemDictTypeDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemDictTypeColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemDictTypeColumns // columns contains all the column names of Table for convenient usage. } -// SystemDictTypeColumns defines and stores column names for the table system_dict_type. +// SystemDictTypeColumns defines and stores column names for table system_dict_type. type SystemDictTypeColumns struct { Id string // 字典主键 Name string // 字典名称 @@ -34,7 +33,7 @@ type SystemDictTypeColumns struct { DeletedTime string // 删除时间 } -// systemDictTypeColumns holds the columns for the table system_dict_type. +// systemDictTypeColumns holds the columns for table system_dict_type. var systemDictTypeColumns = SystemDictTypeColumns{ Id: "id", Name: "name", @@ -50,49 +49,44 @@ var systemDictTypeColumns = SystemDictTypeColumns{ } // NewSystemDictTypeDao creates and returns a new DAO object for table data access. -func NewSystemDictTypeDao(handlers ...gdb.ModelHandler) *SystemDictTypeDao { +func NewSystemDictTypeDao() *SystemDictTypeDao { return &SystemDictTypeDao{ - group: "default", - table: "system_dict_type", - columns: systemDictTypeColumns, - handlers: handlers, + group: "default", + table: "system_dict_type", + columns: systemDictTypeColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemDictTypeDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemDictTypeDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemDictTypeDao) Columns() SystemDictTypeColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemDictTypeDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemDictTypeDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemDictTypeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_login_log.go b/internal/dao/internal/system_login_log.go index 412371e..299a665 100644 --- a/internal/dao/internal/system_login_log.go +++ b/internal/dao/internal/system_login_log.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemLoginLogDao is the data access object for the table system_login_log. +// SystemLoginLogDao is the data access object for table system_login_log. type SystemLoginLogDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemLoginLogColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemLoginLogColumns // columns contains all the column names of Table for convenient usage. } -// SystemLoginLogColumns defines and stores column names for the table system_login_log. +// SystemLoginLogColumns defines and stores column names for table system_login_log. type SystemLoginLogColumns struct { Id string // 访问ID LogType string // 日志类型 @@ -38,7 +37,7 @@ type SystemLoginLogColumns struct { TenantId string // 租户编号 } -// systemLoginLogColumns holds the columns for the table system_login_log. +// systemLoginLogColumns holds the columns for table system_login_log. var systemLoginLogColumns = SystemLoginLogColumns{ Id: "id", LogType: "log_type", @@ -58,49 +57,44 @@ var systemLoginLogColumns = SystemLoginLogColumns{ } // NewSystemLoginLogDao creates and returns a new DAO object for table data access. -func NewSystemLoginLogDao(handlers ...gdb.ModelHandler) *SystemLoginLogDao { +func NewSystemLoginLogDao() *SystemLoginLogDao { return &SystemLoginLogDao{ - group: "default", - table: "system_login_log", - columns: systemLoginLogColumns, - handlers: handlers, + group: "default", + table: "system_login_log", + columns: systemLoginLogColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemLoginLogDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemLoginLogDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemLoginLogDao) Columns() SystemLoginLogColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemLoginLogDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemLoginLogDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemLoginLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_mail_account.go b/internal/dao/internal/system_mail_account.go index b7f1580..d2ccfb6 100644 --- a/internal/dao/internal/system_mail_account.go +++ b/internal/dao/internal/system_mail_account.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemMailAccountDao is the data access object for the table system_mail_account. +// SystemMailAccountDao is the data access object for table system_mail_account. type SystemMailAccountDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemMailAccountColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemMailAccountColumns // columns contains all the column names of Table for convenient usage. } -// SystemMailAccountColumns defines and stores column names for the table system_mail_account. +// SystemMailAccountColumns defines and stores column names for table system_mail_account. type SystemMailAccountColumns struct { Id string // 主键 Mail string // 邮箱 @@ -36,7 +35,7 @@ type SystemMailAccountColumns struct { Deleted string // 是否删除 } -// systemMailAccountColumns holds the columns for the table system_mail_account. +// systemMailAccountColumns holds the columns for table system_mail_account. var systemMailAccountColumns = SystemMailAccountColumns{ Id: "id", Mail: "mail", @@ -54,49 +53,44 @@ var systemMailAccountColumns = SystemMailAccountColumns{ } // NewSystemMailAccountDao creates and returns a new DAO object for table data access. -func NewSystemMailAccountDao(handlers ...gdb.ModelHandler) *SystemMailAccountDao { +func NewSystemMailAccountDao() *SystemMailAccountDao { return &SystemMailAccountDao{ - group: "default", - table: "system_mail_account", - columns: systemMailAccountColumns, - handlers: handlers, + group: "default", + table: "system_mail_account", + columns: systemMailAccountColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemMailAccountDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemMailAccountDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemMailAccountDao) Columns() SystemMailAccountColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemMailAccountDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemMailAccountDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemMailAccountDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_mail_log.go b/internal/dao/internal/system_mail_log.go index 330c4f7..282fc12 100644 --- a/internal/dao/internal/system_mail_log.go +++ b/internal/dao/internal/system_mail_log.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemMailLogDao is the data access object for the table system_mail_log. +// SystemMailLogDao is the data access object for table system_mail_log. type SystemMailLogDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemMailLogColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemMailLogColumns // columns contains all the column names of Table for convenient usage. } -// SystemMailLogColumns defines and stores column names for the table system_mail_log. +// SystemMailLogColumns defines and stores column names for table system_mail_log. type SystemMailLogColumns struct { Id string // 编号 UserId string // 用户编号 @@ -44,7 +43,7 @@ type SystemMailLogColumns struct { Deleted string // 是否删除 } -// systemMailLogColumns holds the columns for the table system_mail_log. +// systemMailLogColumns holds the columns for table system_mail_log. var systemMailLogColumns = SystemMailLogColumns{ Id: "id", UserId: "user_id", @@ -70,49 +69,44 @@ var systemMailLogColumns = SystemMailLogColumns{ } // NewSystemMailLogDao creates and returns a new DAO object for table data access. -func NewSystemMailLogDao(handlers ...gdb.ModelHandler) *SystemMailLogDao { +func NewSystemMailLogDao() *SystemMailLogDao { return &SystemMailLogDao{ - group: "default", - table: "system_mail_log", - columns: systemMailLogColumns, - handlers: handlers, + group: "default", + table: "system_mail_log", + columns: systemMailLogColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemMailLogDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemMailLogDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemMailLogDao) Columns() SystemMailLogColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemMailLogDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemMailLogDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemMailLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_mail_template.go b/internal/dao/internal/system_mail_template.go index 8bc5b37..31be969 100644 --- a/internal/dao/internal/system_mail_template.go +++ b/internal/dao/internal/system_mail_template.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemMailTemplateDao is the data access object for the table system_mail_template. +// SystemMailTemplateDao is the data access object for table system_mail_template. type SystemMailTemplateDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemMailTemplateColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemMailTemplateColumns // columns contains all the column names of Table for convenient usage. } -// SystemMailTemplateColumns defines and stores column names for the table system_mail_template. +// SystemMailTemplateColumns defines and stores column names for table system_mail_template. type SystemMailTemplateColumns struct { Id string // 编号 Name string // 模板名称 @@ -38,7 +37,7 @@ type SystemMailTemplateColumns struct { Deleted string // 是否删除 } -// systemMailTemplateColumns holds the columns for the table system_mail_template. +// systemMailTemplateColumns holds the columns for table system_mail_template. var systemMailTemplateColumns = SystemMailTemplateColumns{ Id: "id", Name: "name", @@ -58,49 +57,44 @@ var systemMailTemplateColumns = SystemMailTemplateColumns{ } // NewSystemMailTemplateDao creates and returns a new DAO object for table data access. -func NewSystemMailTemplateDao(handlers ...gdb.ModelHandler) *SystemMailTemplateDao { +func NewSystemMailTemplateDao() *SystemMailTemplateDao { return &SystemMailTemplateDao{ - group: "default", - table: "system_mail_template", - columns: systemMailTemplateColumns, - handlers: handlers, + group: "default", + table: "system_mail_template", + columns: systemMailTemplateColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemMailTemplateDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemMailTemplateDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemMailTemplateDao) Columns() SystemMailTemplateColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemMailTemplateDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemMailTemplateDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemMailTemplateDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_menu.go b/internal/dao/internal/system_menu.go index 807b6e0..c513232 100644 --- a/internal/dao/internal/system_menu.go +++ b/internal/dao/internal/system_menu.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemMenuDao is the data access object for the table system_menu. +// SystemMenuDao is the data access object for table system_menu. type SystemMenuDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemMenuColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemMenuColumns // columns contains all the column names of Table for convenient usage. } -// SystemMenuColumns defines and stores column names for the table system_menu. +// SystemMenuColumns defines and stores column names for table system_menu. type SystemMenuColumns struct { Id string // 菜单ID Name string // 菜单名称 @@ -42,7 +41,7 @@ type SystemMenuColumns struct { Deleted string // 是否删除 } -// systemMenuColumns holds the columns for the table system_menu. +// systemMenuColumns holds the columns for table system_menu. var systemMenuColumns = SystemMenuColumns{ Id: "id", Name: "name", @@ -66,49 +65,44 @@ var systemMenuColumns = SystemMenuColumns{ } // NewSystemMenuDao creates and returns a new DAO object for table data access. -func NewSystemMenuDao(handlers ...gdb.ModelHandler) *SystemMenuDao { +func NewSystemMenuDao() *SystemMenuDao { return &SystemMenuDao{ - group: "default", - table: "system_menu", - columns: systemMenuColumns, - handlers: handlers, + group: "default", + table: "system_menu", + columns: systemMenuColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemMenuDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemMenuDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemMenuDao) Columns() SystemMenuColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemMenuDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemMenuDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemMenuDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_notice.go b/internal/dao/internal/system_notice.go index 85ce9b1..23055a9 100644 --- a/internal/dao/internal/system_notice.go +++ b/internal/dao/internal/system_notice.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemNoticeDao is the data access object for the table system_notice. +// SystemNoticeDao is the data access object for table system_notice. type SystemNoticeDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemNoticeColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemNoticeColumns // columns contains all the column names of Table for convenient usage. } -// SystemNoticeColumns defines and stores column names for the table system_notice. +// SystemNoticeColumns defines and stores column names for table system_notice. type SystemNoticeColumns struct { Id string // 公告ID Title string // 公告标题 @@ -34,7 +33,7 @@ type SystemNoticeColumns struct { TenantId string // 租户编号 } -// systemNoticeColumns holds the columns for the table system_notice. +// systemNoticeColumns holds the columns for table system_notice. var systemNoticeColumns = SystemNoticeColumns{ Id: "id", Title: "title", @@ -50,49 +49,44 @@ var systemNoticeColumns = SystemNoticeColumns{ } // NewSystemNoticeDao creates and returns a new DAO object for table data access. -func NewSystemNoticeDao(handlers ...gdb.ModelHandler) *SystemNoticeDao { +func NewSystemNoticeDao() *SystemNoticeDao { return &SystemNoticeDao{ - group: "default", - table: "system_notice", - columns: systemNoticeColumns, - handlers: handlers, + group: "default", + table: "system_notice", + columns: systemNoticeColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemNoticeDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemNoticeDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemNoticeDao) Columns() SystemNoticeColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemNoticeDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemNoticeDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemNoticeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_notify_message.go b/internal/dao/internal/system_notify_message.go index 12c66a3..6eb2e2e 100644 --- a/internal/dao/internal/system_notify_message.go +++ b/internal/dao/internal/system_notify_message.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemNotifyMessageDao is the data access object for the table system_notify_message. +// SystemNotifyMessageDao is the data access object for table system_notify_message. type SystemNotifyMessageDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemNotifyMessageColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemNotifyMessageColumns // columns contains all the column names of Table for convenient usage. } -// SystemNotifyMessageColumns defines and stores column names for the table system_notify_message. +// SystemNotifyMessageColumns defines and stores column names for table system_notify_message. type SystemNotifyMessageColumns struct { Id string // 用户ID UserId string // 用户id @@ -40,7 +39,7 @@ type SystemNotifyMessageColumns struct { TenantId string // 租户编号 } -// systemNotifyMessageColumns holds the columns for the table system_notify_message. +// systemNotifyMessageColumns holds the columns for table system_notify_message. var systemNotifyMessageColumns = SystemNotifyMessageColumns{ Id: "id", UserId: "user_id", @@ -62,49 +61,44 @@ var systemNotifyMessageColumns = SystemNotifyMessageColumns{ } // NewSystemNotifyMessageDao creates and returns a new DAO object for table data access. -func NewSystemNotifyMessageDao(handlers ...gdb.ModelHandler) *SystemNotifyMessageDao { +func NewSystemNotifyMessageDao() *SystemNotifyMessageDao { return &SystemNotifyMessageDao{ - group: "default", - table: "system_notify_message", - columns: systemNotifyMessageColumns, - handlers: handlers, + group: "default", + table: "system_notify_message", + columns: systemNotifyMessageColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemNotifyMessageDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemNotifyMessageDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemNotifyMessageDao) Columns() SystemNotifyMessageColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemNotifyMessageDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemNotifyMessageDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemNotifyMessageDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_notify_template.go b/internal/dao/internal/system_notify_template.go index c495800..6ec6505 100644 --- a/internal/dao/internal/system_notify_template.go +++ b/internal/dao/internal/system_notify_template.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemNotifyTemplateDao is the data access object for the table system_notify_template. +// SystemNotifyTemplateDao is the data access object for table system_notify_template. type SystemNotifyTemplateDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemNotifyTemplateColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemNotifyTemplateColumns // columns contains all the column names of Table for convenient usage. } -// SystemNotifyTemplateColumns defines and stores column names for the table system_notify_template. +// SystemNotifyTemplateColumns defines and stores column names for table system_notify_template. type SystemNotifyTemplateColumns struct { Id string // 主键 Name string // 模板名称 @@ -37,7 +36,7 @@ type SystemNotifyTemplateColumns struct { Deleted string // 是否删除 } -// systemNotifyTemplateColumns holds the columns for the table system_notify_template. +// systemNotifyTemplateColumns holds the columns for table system_notify_template. var systemNotifyTemplateColumns = SystemNotifyTemplateColumns{ Id: "id", Name: "name", @@ -56,49 +55,44 @@ var systemNotifyTemplateColumns = SystemNotifyTemplateColumns{ } // NewSystemNotifyTemplateDao creates and returns a new DAO object for table data access. -func NewSystemNotifyTemplateDao(handlers ...gdb.ModelHandler) *SystemNotifyTemplateDao { +func NewSystemNotifyTemplateDao() *SystemNotifyTemplateDao { return &SystemNotifyTemplateDao{ - group: "default", - table: "system_notify_template", - columns: systemNotifyTemplateColumns, - handlers: handlers, + group: "default", + table: "system_notify_template", + columns: systemNotifyTemplateColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemNotifyTemplateDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemNotifyTemplateDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemNotifyTemplateDao) Columns() SystemNotifyTemplateColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemNotifyTemplateDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemNotifyTemplateDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemNotifyTemplateDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_oauth_2_access_token.go b/internal/dao/internal/system_oauth_2_access_token.go index 10b0a5a..c53ebb1 100644 --- a/internal/dao/internal/system_oauth_2_access_token.go +++ b/internal/dao/internal/system_oauth_2_access_token.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemOauth2AccessTokenDao is the data access object for the table system_oauth2_access_token. +// SystemOauth2AccessTokenDao is the data access object for table system_oauth2_access_token. type SystemOauth2AccessTokenDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemOauth2AccessTokenColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemOauth2AccessTokenColumns // columns contains all the column names of Table for convenient usage. } -// SystemOauth2AccessTokenColumns defines and stores column names for the table system_oauth2_access_token. +// SystemOauth2AccessTokenColumns defines and stores column names for table system_oauth2_access_token. type SystemOauth2AccessTokenColumns struct { Id string // 编号 UserId string // 用户编号 @@ -38,7 +37,7 @@ type SystemOauth2AccessTokenColumns struct { TenantId string // 租户编号 } -// systemOauth2AccessTokenColumns holds the columns for the table system_oauth2_access_token. +// systemOauth2AccessTokenColumns holds the columns for table system_oauth2_access_token. var systemOauth2AccessTokenColumns = SystemOauth2AccessTokenColumns{ Id: "id", UserId: "user_id", @@ -58,49 +57,44 @@ var systemOauth2AccessTokenColumns = SystemOauth2AccessTokenColumns{ } // NewSystemOauth2AccessTokenDao creates and returns a new DAO object for table data access. -func NewSystemOauth2AccessTokenDao(handlers ...gdb.ModelHandler) *SystemOauth2AccessTokenDao { +func NewSystemOauth2AccessTokenDao() *SystemOauth2AccessTokenDao { return &SystemOauth2AccessTokenDao{ - group: "default", - table: "system_oauth2_access_token", - columns: systemOauth2AccessTokenColumns, - handlers: handlers, + group: "default", + table: "system_oauth2_access_token", + columns: systemOauth2AccessTokenColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemOauth2AccessTokenDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemOauth2AccessTokenDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemOauth2AccessTokenDao) Columns() SystemOauth2AccessTokenColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemOauth2AccessTokenDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemOauth2AccessTokenDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemOauth2AccessTokenDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_oauth_2_approve.go b/internal/dao/internal/system_oauth_2_approve.go index 99fba67..4834b50 100644 --- a/internal/dao/internal/system_oauth_2_approve.go +++ b/internal/dao/internal/system_oauth_2_approve.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemOauth2ApproveDao is the data access object for the table system_oauth2_approve. +// SystemOauth2ApproveDao is the data access object for table system_oauth2_approve. type SystemOauth2ApproveDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemOauth2ApproveColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemOauth2ApproveColumns // columns contains all the column names of Table for convenient usage. } -// SystemOauth2ApproveColumns defines and stores column names for the table system_oauth2_approve. +// SystemOauth2ApproveColumns defines and stores column names for table system_oauth2_approve. type SystemOauth2ApproveColumns struct { Id string // 编号 UserId string // 用户编号 @@ -36,7 +35,7 @@ type SystemOauth2ApproveColumns struct { TenantId string // 租户编号 } -// systemOauth2ApproveColumns holds the columns for the table system_oauth2_approve. +// systemOauth2ApproveColumns holds the columns for table system_oauth2_approve. var systemOauth2ApproveColumns = SystemOauth2ApproveColumns{ Id: "id", UserId: "user_id", @@ -54,49 +53,44 @@ var systemOauth2ApproveColumns = SystemOauth2ApproveColumns{ } // NewSystemOauth2ApproveDao creates and returns a new DAO object for table data access. -func NewSystemOauth2ApproveDao(handlers ...gdb.ModelHandler) *SystemOauth2ApproveDao { +func NewSystemOauth2ApproveDao() *SystemOauth2ApproveDao { return &SystemOauth2ApproveDao{ - group: "default", - table: "system_oauth2_approve", - columns: systemOauth2ApproveColumns, - handlers: handlers, + group: "default", + table: "system_oauth2_approve", + columns: systemOauth2ApproveColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemOauth2ApproveDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemOauth2ApproveDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemOauth2ApproveDao) Columns() SystemOauth2ApproveColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemOauth2ApproveDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemOauth2ApproveDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemOauth2ApproveDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_oauth_2_client.go b/internal/dao/internal/system_oauth_2_client.go index caddc54..b12f9a0 100644 --- a/internal/dao/internal/system_oauth_2_client.go +++ b/internal/dao/internal/system_oauth_2_client.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemOauth2ClientDao is the data access object for the table system_oauth2_client. +// SystemOauth2ClientDao is the data access object for table system_oauth2_client. type SystemOauth2ClientDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemOauth2ClientColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemOauth2ClientColumns // columns contains all the column names of Table for convenient usage. } -// SystemOauth2ClientColumns defines and stores column names for the table system_oauth2_client. +// SystemOauth2ClientColumns defines and stores column names for table system_oauth2_client. type SystemOauth2ClientColumns struct { Id string // 编号 ClientId string // 客户端编号 @@ -44,7 +43,7 @@ type SystemOauth2ClientColumns struct { Deleted string // 是否删除 } -// systemOauth2ClientColumns holds the columns for the table system_oauth2_client. +// systemOauth2ClientColumns holds the columns for table system_oauth2_client. var systemOauth2ClientColumns = SystemOauth2ClientColumns{ Id: "id", ClientId: "client_id", @@ -70,49 +69,44 @@ var systemOauth2ClientColumns = SystemOauth2ClientColumns{ } // NewSystemOauth2ClientDao creates and returns a new DAO object for table data access. -func NewSystemOauth2ClientDao(handlers ...gdb.ModelHandler) *SystemOauth2ClientDao { +func NewSystemOauth2ClientDao() *SystemOauth2ClientDao { return &SystemOauth2ClientDao{ - group: "default", - table: "system_oauth2_client", - columns: systemOauth2ClientColumns, - handlers: handlers, + group: "default", + table: "system_oauth2_client", + columns: systemOauth2ClientColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemOauth2ClientDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemOauth2ClientDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemOauth2ClientDao) Columns() SystemOauth2ClientColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemOauth2ClientDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemOauth2ClientDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemOauth2ClientDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_oauth_2_code.go b/internal/dao/internal/system_oauth_2_code.go index 8481730..db3d32b 100644 --- a/internal/dao/internal/system_oauth_2_code.go +++ b/internal/dao/internal/system_oauth_2_code.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemOauth2CodeDao is the data access object for the table system_oauth2_code. +// SystemOauth2CodeDao is the data access object for table system_oauth2_code. type SystemOauth2CodeDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemOauth2CodeColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemOauth2CodeColumns // columns contains all the column names of Table for convenient usage. } -// SystemOauth2CodeColumns defines and stores column names for the table system_oauth2_code. +// SystemOauth2CodeColumns defines and stores column names for table system_oauth2_code. type SystemOauth2CodeColumns struct { Id string // 编号 UserId string // 用户编号 @@ -38,7 +37,7 @@ type SystemOauth2CodeColumns struct { TenantId string // 租户编号 } -// systemOauth2CodeColumns holds the columns for the table system_oauth2_code. +// systemOauth2CodeColumns holds the columns for table system_oauth2_code. var systemOauth2CodeColumns = SystemOauth2CodeColumns{ Id: "id", UserId: "user_id", @@ -58,49 +57,44 @@ var systemOauth2CodeColumns = SystemOauth2CodeColumns{ } // NewSystemOauth2CodeDao creates and returns a new DAO object for table data access. -func NewSystemOauth2CodeDao(handlers ...gdb.ModelHandler) *SystemOauth2CodeDao { +func NewSystemOauth2CodeDao() *SystemOauth2CodeDao { return &SystemOauth2CodeDao{ - group: "default", - table: "system_oauth2_code", - columns: systemOauth2CodeColumns, - handlers: handlers, + group: "default", + table: "system_oauth2_code", + columns: systemOauth2CodeColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemOauth2CodeDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemOauth2CodeDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemOauth2CodeDao) Columns() SystemOauth2CodeColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemOauth2CodeDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemOauth2CodeDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemOauth2CodeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_oauth_2_refresh_token.go b/internal/dao/internal/system_oauth_2_refresh_token.go index 2434f9b..2387627 100644 --- a/internal/dao/internal/system_oauth_2_refresh_token.go +++ b/internal/dao/internal/system_oauth_2_refresh_token.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemOauth2RefreshTokenDao is the data access object for the table system_oauth2_refresh_token. +// SystemOauth2RefreshTokenDao is the data access object for table system_oauth2_refresh_token. type SystemOauth2RefreshTokenDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemOauth2RefreshTokenColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemOauth2RefreshTokenColumns // columns contains all the column names of Table for convenient usage. } -// SystemOauth2RefreshTokenColumns defines and stores column names for the table system_oauth2_refresh_token. +// SystemOauth2RefreshTokenColumns defines and stores column names for table system_oauth2_refresh_token. type SystemOauth2RefreshTokenColumns struct { Id string // 编号 UserId string // 用户编号 @@ -36,7 +35,7 @@ type SystemOauth2RefreshTokenColumns struct { TenantId string // 租户编号 } -// systemOauth2RefreshTokenColumns holds the columns for the table system_oauth2_refresh_token. +// systemOauth2RefreshTokenColumns holds the columns for table system_oauth2_refresh_token. var systemOauth2RefreshTokenColumns = SystemOauth2RefreshTokenColumns{ Id: "id", UserId: "user_id", @@ -54,49 +53,44 @@ var systemOauth2RefreshTokenColumns = SystemOauth2RefreshTokenColumns{ } // NewSystemOauth2RefreshTokenDao creates and returns a new DAO object for table data access. -func NewSystemOauth2RefreshTokenDao(handlers ...gdb.ModelHandler) *SystemOauth2RefreshTokenDao { +func NewSystemOauth2RefreshTokenDao() *SystemOauth2RefreshTokenDao { return &SystemOauth2RefreshTokenDao{ - group: "default", - table: "system_oauth2_refresh_token", - columns: systemOauth2RefreshTokenColumns, - handlers: handlers, + group: "default", + table: "system_oauth2_refresh_token", + columns: systemOauth2RefreshTokenColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemOauth2RefreshTokenDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemOauth2RefreshTokenDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemOauth2RefreshTokenDao) Columns() SystemOauth2RefreshTokenColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemOauth2RefreshTokenDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemOauth2RefreshTokenDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemOauth2RefreshTokenDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_operate_log.go b/internal/dao/internal/system_operate_log.go index e5b08e9..8e4fea1 100644 --- a/internal/dao/internal/system_operate_log.go +++ b/internal/dao/internal/system_operate_log.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemOperateLogDao is the data access object for the table system_operate_log. +// SystemOperateLogDao is the data access object for table system_operate_log. type SystemOperateLogDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemOperateLogColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemOperateLogColumns // columns contains all the column names of Table for convenient usage. } -// SystemOperateLogColumns defines and stores column names for the table system_operate_log. +// SystemOperateLogColumns defines and stores column names for table system_operate_log. type SystemOperateLogColumns struct { Id string // 日志主键 TraceId string // 链路追踪编号 @@ -42,7 +41,7 @@ type SystemOperateLogColumns struct { TenantId string // 租户编号 } -// systemOperateLogColumns holds the columns for the table system_operate_log. +// systemOperateLogColumns holds the columns for table system_operate_log. var systemOperateLogColumns = SystemOperateLogColumns{ Id: "id", TraceId: "trace_id", @@ -66,49 +65,44 @@ var systemOperateLogColumns = SystemOperateLogColumns{ } // NewSystemOperateLogDao creates and returns a new DAO object for table data access. -func NewSystemOperateLogDao(handlers ...gdb.ModelHandler) *SystemOperateLogDao { +func NewSystemOperateLogDao() *SystemOperateLogDao { return &SystemOperateLogDao{ - group: "default", - table: "system_operate_log", - columns: systemOperateLogColumns, - handlers: handlers, + group: "default", + table: "system_operate_log", + columns: systemOperateLogColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemOperateLogDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemOperateLogDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemOperateLogDao) Columns() SystemOperateLogColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemOperateLogDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemOperateLogDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemOperateLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_post.go b/internal/dao/internal/system_post.go index c8bdeb9..02a3ac9 100644 --- a/internal/dao/internal/system_post.go +++ b/internal/dao/internal/system_post.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemPostDao is the data access object for the table system_post. +// SystemPostDao is the data access object for table system_post. type SystemPostDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemPostColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemPostColumns // columns contains all the column names of Table for convenient usage. } -// SystemPostColumns defines and stores column names for the table system_post. +// SystemPostColumns defines and stores column names for table system_post. type SystemPostColumns struct { Id string // 岗位ID Code string // 岗位编码 @@ -35,7 +34,7 @@ type SystemPostColumns struct { TenantId string // 租户编号 } -// systemPostColumns holds the columns for the table system_post. +// systemPostColumns holds the columns for table system_post. var systemPostColumns = SystemPostColumns{ Id: "id", Code: "code", @@ -52,49 +51,44 @@ var systemPostColumns = SystemPostColumns{ } // NewSystemPostDao creates and returns a new DAO object for table data access. -func NewSystemPostDao(handlers ...gdb.ModelHandler) *SystemPostDao { +func NewSystemPostDao() *SystemPostDao { return &SystemPostDao{ - group: "default", - table: "system_post", - columns: systemPostColumns, - handlers: handlers, + group: "default", + table: "system_post", + columns: systemPostColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemPostDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemPostDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemPostDao) Columns() SystemPostColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemPostDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemPostDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemPostDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_role.go b/internal/dao/internal/system_role.go index fb3a3f4..b6f8c6a 100644 --- a/internal/dao/internal/system_role.go +++ b/internal/dao/internal/system_role.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemRoleDao is the data access object for the table system_role. +// SystemRoleDao is the data access object for table system_role. type SystemRoleDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemRoleColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemRoleColumns // columns contains all the column names of Table for convenient usage. } -// SystemRoleColumns defines and stores column names for the table system_role. +// SystemRoleColumns defines and stores column names for table system_role. type SystemRoleColumns struct { Id string // 角色ID Name string // 角色名称 @@ -38,7 +37,7 @@ type SystemRoleColumns struct { TenantId string // 租户编号 } -// systemRoleColumns holds the columns for the table system_role. +// systemRoleColumns holds the columns for table system_role. var systemRoleColumns = SystemRoleColumns{ Id: "id", Name: "name", @@ -58,49 +57,44 @@ var systemRoleColumns = SystemRoleColumns{ } // NewSystemRoleDao creates and returns a new DAO object for table data access. -func NewSystemRoleDao(handlers ...gdb.ModelHandler) *SystemRoleDao { +func NewSystemRoleDao() *SystemRoleDao { return &SystemRoleDao{ - group: "default", - table: "system_role", - columns: systemRoleColumns, - handlers: handlers, + group: "default", + table: "system_role", + columns: systemRoleColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemRoleDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemRoleDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemRoleDao) Columns() SystemRoleColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemRoleDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemRoleDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemRoleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_role_menu.go b/internal/dao/internal/system_role_menu.go index d80b314..4732ba3 100644 --- a/internal/dao/internal/system_role_menu.go +++ b/internal/dao/internal/system_role_menu.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemRoleMenuDao is the data access object for the table system_role_menu. +// SystemRoleMenuDao is the data access object for table system_role_menu. type SystemRoleMenuDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemRoleMenuColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemRoleMenuColumns // columns contains all the column names of Table for convenient usage. } -// SystemRoleMenuColumns defines and stores column names for the table system_role_menu. +// SystemRoleMenuColumns defines and stores column names for table system_role_menu. type SystemRoleMenuColumns struct { Id string // 自增编号 RoleId string // 角色ID @@ -32,7 +31,7 @@ type SystemRoleMenuColumns struct { TenantId string // 租户编号 } -// systemRoleMenuColumns holds the columns for the table system_role_menu. +// systemRoleMenuColumns holds the columns for table system_role_menu. var systemRoleMenuColumns = SystemRoleMenuColumns{ Id: "id", RoleId: "role_id", @@ -46,49 +45,44 @@ var systemRoleMenuColumns = SystemRoleMenuColumns{ } // NewSystemRoleMenuDao creates and returns a new DAO object for table data access. -func NewSystemRoleMenuDao(handlers ...gdb.ModelHandler) *SystemRoleMenuDao { +func NewSystemRoleMenuDao() *SystemRoleMenuDao { return &SystemRoleMenuDao{ - group: "default", - table: "system_role_menu", - columns: systemRoleMenuColumns, - handlers: handlers, + group: "default", + table: "system_role_menu", + columns: systemRoleMenuColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemRoleMenuDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemRoleMenuDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemRoleMenuDao) Columns() SystemRoleMenuColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemRoleMenuDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemRoleMenuDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemRoleMenuDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_sms_channel.go b/internal/dao/internal/system_sms_channel.go index 44788dc..5d7ba90 100644 --- a/internal/dao/internal/system_sms_channel.go +++ b/internal/dao/internal/system_sms_channel.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemSmsChannelDao is the data access object for the table system_sms_channel. +// SystemSmsChannelDao is the data access object for table system_sms_channel. type SystemSmsChannelDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemSmsChannelColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemSmsChannelColumns // columns contains all the column names of Table for convenient usage. } -// SystemSmsChannelColumns defines and stores column names for the table system_sms_channel. +// SystemSmsChannelColumns defines and stores column names for table system_sms_channel. type SystemSmsChannelColumns struct { Id string // 编号 Signature string // 短信签名 @@ -36,7 +35,7 @@ type SystemSmsChannelColumns struct { Deleted string // 是否删除 } -// systemSmsChannelColumns holds the columns for the table system_sms_channel. +// systemSmsChannelColumns holds the columns for table system_sms_channel. var systemSmsChannelColumns = SystemSmsChannelColumns{ Id: "id", Signature: "signature", @@ -54,49 +53,44 @@ var systemSmsChannelColumns = SystemSmsChannelColumns{ } // NewSystemSmsChannelDao creates and returns a new DAO object for table data access. -func NewSystemSmsChannelDao(handlers ...gdb.ModelHandler) *SystemSmsChannelDao { +func NewSystemSmsChannelDao() *SystemSmsChannelDao { return &SystemSmsChannelDao{ - group: "default", - table: "system_sms_channel", - columns: systemSmsChannelColumns, - handlers: handlers, + group: "default", + table: "system_sms_channel", + columns: systemSmsChannelColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemSmsChannelDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemSmsChannelDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemSmsChannelDao) Columns() SystemSmsChannelColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemSmsChannelDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemSmsChannelDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemSmsChannelDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_sms_code.go b/internal/dao/internal/system_sms_code.go index 6184dbb..7c1d75d 100644 --- a/internal/dao/internal/system_sms_code.go +++ b/internal/dao/internal/system_sms_code.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemSmsCodeDao is the data access object for the table system_sms_code. +// SystemSmsCodeDao is the data access object for table system_sms_code. type SystemSmsCodeDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemSmsCodeColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemSmsCodeColumns // columns contains all the column names of Table for convenient usage. } -// SystemSmsCodeColumns defines and stores column names for the table system_sms_code. +// SystemSmsCodeColumns defines and stores column names for table system_sms_code. type SystemSmsCodeColumns struct { Id string // 编号 Mobile string // 手机号 @@ -38,7 +37,7 @@ type SystemSmsCodeColumns struct { TenantId string // 租户编号 } -// systemSmsCodeColumns holds the columns for the table system_sms_code. +// systemSmsCodeColumns holds the columns for table system_sms_code. var systemSmsCodeColumns = SystemSmsCodeColumns{ Id: "id", Mobile: "mobile", @@ -58,49 +57,44 @@ var systemSmsCodeColumns = SystemSmsCodeColumns{ } // NewSystemSmsCodeDao creates and returns a new DAO object for table data access. -func NewSystemSmsCodeDao(handlers ...gdb.ModelHandler) *SystemSmsCodeDao { +func NewSystemSmsCodeDao() *SystemSmsCodeDao { return &SystemSmsCodeDao{ - group: "default", - table: "system_sms_code", - columns: systemSmsCodeColumns, - handlers: handlers, + group: "default", + table: "system_sms_code", + columns: systemSmsCodeColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemSmsCodeDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemSmsCodeDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemSmsCodeDao) Columns() SystemSmsCodeColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemSmsCodeDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemSmsCodeDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemSmsCodeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_sms_log.go b/internal/dao/internal/system_sms_log.go index f67db09..11aee1a 100644 --- a/internal/dao/internal/system_sms_log.go +++ b/internal/dao/internal/system_sms_log.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemSmsLogDao is the data access object for the table system_sms_log. +// SystemSmsLogDao is the data access object for table system_sms_log. type SystemSmsLogDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemSmsLogColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemSmsLogColumns // columns contains all the column names of Table for convenient usage. } -// SystemSmsLogColumns defines and stores column names for the table system_sms_log. +// SystemSmsLogColumns defines and stores column names for table system_sms_log. type SystemSmsLogColumns struct { Id string // 编号 ChannelId string // 短信渠道编号 @@ -50,7 +49,7 @@ type SystemSmsLogColumns struct { Deleted string // 是否删除 } -// systemSmsLogColumns holds the columns for the table system_sms_log. +// systemSmsLogColumns holds the columns for table system_sms_log. var systemSmsLogColumns = SystemSmsLogColumns{ Id: "id", ChannelId: "channel_id", @@ -82,49 +81,44 @@ var systemSmsLogColumns = SystemSmsLogColumns{ } // NewSystemSmsLogDao creates and returns a new DAO object for table data access. -func NewSystemSmsLogDao(handlers ...gdb.ModelHandler) *SystemSmsLogDao { +func NewSystemSmsLogDao() *SystemSmsLogDao { return &SystemSmsLogDao{ - group: "default", - table: "system_sms_log", - columns: systemSmsLogColumns, - handlers: handlers, + group: "default", + table: "system_sms_log", + columns: systemSmsLogColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemSmsLogDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemSmsLogDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemSmsLogDao) Columns() SystemSmsLogColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemSmsLogDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemSmsLogDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemSmsLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_sms_template.go b/internal/dao/internal/system_sms_template.go index c2e71fe..0576727 100644 --- a/internal/dao/internal/system_sms_template.go +++ b/internal/dao/internal/system_sms_template.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemSmsTemplateDao is the data access object for the table system_sms_template. +// SystemSmsTemplateDao is the data access object for table system_sms_template. type SystemSmsTemplateDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemSmsTemplateColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemSmsTemplateColumns // columns contains all the column names of Table for convenient usage. } -// SystemSmsTemplateColumns defines and stores column names for the table system_sms_template. +// SystemSmsTemplateColumns defines and stores column names for table system_sms_template. type SystemSmsTemplateColumns struct { Id string // 编号 Type string // 模板类型 @@ -39,7 +38,7 @@ type SystemSmsTemplateColumns struct { Deleted string // 是否删除 } -// systemSmsTemplateColumns holds the columns for the table system_sms_template. +// systemSmsTemplateColumns holds the columns for table system_sms_template. var systemSmsTemplateColumns = SystemSmsTemplateColumns{ Id: "id", Type: "type", @@ -60,49 +59,44 @@ var systemSmsTemplateColumns = SystemSmsTemplateColumns{ } // NewSystemSmsTemplateDao creates and returns a new DAO object for table data access. -func NewSystemSmsTemplateDao(handlers ...gdb.ModelHandler) *SystemSmsTemplateDao { +func NewSystemSmsTemplateDao() *SystemSmsTemplateDao { return &SystemSmsTemplateDao{ - group: "default", - table: "system_sms_template", - columns: systemSmsTemplateColumns, - handlers: handlers, + group: "default", + table: "system_sms_template", + columns: systemSmsTemplateColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemSmsTemplateDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemSmsTemplateDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemSmsTemplateDao) Columns() SystemSmsTemplateColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemSmsTemplateDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemSmsTemplateDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemSmsTemplateDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_social_client.go b/internal/dao/internal/system_social_client.go index 61bdf7e..bd3bad4 100644 --- a/internal/dao/internal/system_social_client.go +++ b/internal/dao/internal/system_social_client.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemSocialClientDao is the data access object for the table system_social_client. +// SystemSocialClientDao is the data access object for table system_social_client. type SystemSocialClientDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemSocialClientColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemSocialClientColumns // columns contains all the column names of Table for convenient usage. } -// SystemSocialClientColumns defines and stores column names for the table system_social_client. +// SystemSocialClientColumns defines and stores column names for table system_social_client. type SystemSocialClientColumns struct { Id string // 编号 Name string // 应用名 @@ -37,7 +36,7 @@ type SystemSocialClientColumns struct { TenantId string // 租户编号 } -// systemSocialClientColumns holds the columns for the table system_social_client. +// systemSocialClientColumns holds the columns for table system_social_client. var systemSocialClientColumns = SystemSocialClientColumns{ Id: "id", Name: "name", @@ -56,49 +55,44 @@ var systemSocialClientColumns = SystemSocialClientColumns{ } // NewSystemSocialClientDao creates and returns a new DAO object for table data access. -func NewSystemSocialClientDao(handlers ...gdb.ModelHandler) *SystemSocialClientDao { +func NewSystemSocialClientDao() *SystemSocialClientDao { return &SystemSocialClientDao{ - group: "default", - table: "system_social_client", - columns: systemSocialClientColumns, - handlers: handlers, + group: "default", + table: "system_social_client", + columns: systemSocialClientColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemSocialClientDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemSocialClientDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemSocialClientDao) Columns() SystemSocialClientColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemSocialClientDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemSocialClientDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemSocialClientDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_social_user.go b/internal/dao/internal/system_social_user.go index fd05175..c79ad60 100644 --- a/internal/dao/internal/system_social_user.go +++ b/internal/dao/internal/system_social_user.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemSocialUserDao is the data access object for the table system_social_user. +// SystemSocialUserDao is the data access object for table system_social_user. type SystemSocialUserDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemSocialUserColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemSocialUserColumns // columns contains all the column names of Table for convenient usage. } -// SystemSocialUserColumns defines and stores column names for the table system_social_user. +// SystemSocialUserColumns defines and stores column names for table system_social_user. type SystemSocialUserColumns struct { Id string // 主键(自增策略) Type string // 社交平台的类型 @@ -39,7 +38,7 @@ type SystemSocialUserColumns struct { TenantId string // 租户编号 } -// systemSocialUserColumns holds the columns for the table system_social_user. +// systemSocialUserColumns holds the columns for table system_social_user. var systemSocialUserColumns = SystemSocialUserColumns{ Id: "id", Type: "type", @@ -60,49 +59,44 @@ var systemSocialUserColumns = SystemSocialUserColumns{ } // NewSystemSocialUserDao creates and returns a new DAO object for table data access. -func NewSystemSocialUserDao(handlers ...gdb.ModelHandler) *SystemSocialUserDao { +func NewSystemSocialUserDao() *SystemSocialUserDao { return &SystemSocialUserDao{ - group: "default", - table: "system_social_user", - columns: systemSocialUserColumns, - handlers: handlers, + group: "default", + table: "system_social_user", + columns: systemSocialUserColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemSocialUserDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemSocialUserDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemSocialUserDao) Columns() SystemSocialUserColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemSocialUserDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemSocialUserDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemSocialUserDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_social_user_bind.go b/internal/dao/internal/system_social_user_bind.go index e948b3d..682fa3a 100644 --- a/internal/dao/internal/system_social_user_bind.go +++ b/internal/dao/internal/system_social_user_bind.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemSocialUserBindDao is the data access object for the table system_social_user_bind. +// SystemSocialUserBindDao is the data access object for table system_social_user_bind. type SystemSocialUserBindDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemSocialUserBindColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemSocialUserBindColumns // columns contains all the column names of Table for convenient usage. } -// SystemSocialUserBindColumns defines and stores column names for the table system_social_user_bind. +// SystemSocialUserBindColumns defines and stores column names for table system_social_user_bind. type SystemSocialUserBindColumns struct { Id string // 主键(自增策略) UserId string // 用户编号 @@ -34,7 +33,7 @@ type SystemSocialUserBindColumns struct { TenantId string // 租户编号 } -// systemSocialUserBindColumns holds the columns for the table system_social_user_bind. +// systemSocialUserBindColumns holds the columns for table system_social_user_bind. var systemSocialUserBindColumns = SystemSocialUserBindColumns{ Id: "id", UserId: "user_id", @@ -50,49 +49,44 @@ var systemSocialUserBindColumns = SystemSocialUserBindColumns{ } // NewSystemSocialUserBindDao creates and returns a new DAO object for table data access. -func NewSystemSocialUserBindDao(handlers ...gdb.ModelHandler) *SystemSocialUserBindDao { +func NewSystemSocialUserBindDao() *SystemSocialUserBindDao { return &SystemSocialUserBindDao{ - group: "default", - table: "system_social_user_bind", - columns: systemSocialUserBindColumns, - handlers: handlers, + group: "default", + table: "system_social_user_bind", + columns: systemSocialUserBindColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemSocialUserBindDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemSocialUserBindDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemSocialUserBindDao) Columns() SystemSocialUserBindColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemSocialUserBindDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemSocialUserBindDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemSocialUserBindDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_tenant.go b/internal/dao/internal/system_tenant.go index eec876e..382c386 100644 --- a/internal/dao/internal/system_tenant.go +++ b/internal/dao/internal/system_tenant.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemTenantDao is the data access object for the table system_tenant. +// SystemTenantDao is the data access object for table system_tenant. type SystemTenantDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemTenantColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemTenantColumns // columns contains all the column names of Table for convenient usage. } -// SystemTenantColumns defines and stores column names for the table system_tenant. +// SystemTenantColumns defines and stores column names for table system_tenant. type SystemTenantColumns struct { Id string // 租户编号 Name string // 租户名 @@ -38,7 +37,7 @@ type SystemTenantColumns struct { Deleted string // 是否删除 } -// systemTenantColumns holds the columns for the table system_tenant. +// systemTenantColumns holds the columns for table system_tenant. var systemTenantColumns = SystemTenantColumns{ Id: "id", Name: "name", @@ -58,49 +57,44 @@ var systemTenantColumns = SystemTenantColumns{ } // NewSystemTenantDao creates and returns a new DAO object for table data access. -func NewSystemTenantDao(handlers ...gdb.ModelHandler) *SystemTenantDao { +func NewSystemTenantDao() *SystemTenantDao { return &SystemTenantDao{ - group: "default", - table: "system_tenant", - columns: systemTenantColumns, - handlers: handlers, + group: "default", + table: "system_tenant", + columns: systemTenantColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemTenantDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemTenantDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemTenantDao) Columns() SystemTenantColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemTenantDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemTenantDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemTenantDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_tenant_package.go b/internal/dao/internal/system_tenant_package.go index 97144e6..cb4d9ba 100644 --- a/internal/dao/internal/system_tenant_package.go +++ b/internal/dao/internal/system_tenant_package.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemTenantPackageDao is the data access object for the table system_tenant_package. +// SystemTenantPackageDao is the data access object for table system_tenant_package. type SystemTenantPackageDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemTenantPackageColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemTenantPackageColumns // columns contains all the column names of Table for convenient usage. } -// SystemTenantPackageColumns defines and stores column names for the table system_tenant_package. +// SystemTenantPackageColumns defines and stores column names for table system_tenant_package. type SystemTenantPackageColumns struct { Id string // 套餐编号 Name string // 套餐名 @@ -33,7 +32,7 @@ type SystemTenantPackageColumns struct { Deleted string // 是否删除 } -// systemTenantPackageColumns holds the columns for the table system_tenant_package. +// systemTenantPackageColumns holds the columns for table system_tenant_package. var systemTenantPackageColumns = SystemTenantPackageColumns{ Id: "id", Name: "name", @@ -48,49 +47,44 @@ var systemTenantPackageColumns = SystemTenantPackageColumns{ } // NewSystemTenantPackageDao creates and returns a new DAO object for table data access. -func NewSystemTenantPackageDao(handlers ...gdb.ModelHandler) *SystemTenantPackageDao { +func NewSystemTenantPackageDao() *SystemTenantPackageDao { return &SystemTenantPackageDao{ - group: "default", - table: "system_tenant_package", - columns: systemTenantPackageColumns, - handlers: handlers, + group: "default", + table: "system_tenant_package", + columns: systemTenantPackageColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemTenantPackageDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemTenantPackageDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemTenantPackageDao) Columns() SystemTenantPackageColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemTenantPackageDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemTenantPackageDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemTenantPackageDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_user_post.go b/internal/dao/internal/system_user_post.go index 508ef37..5a85810 100644 --- a/internal/dao/internal/system_user_post.go +++ b/internal/dao/internal/system_user_post.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemUserPostDao is the data access object for the table system_user_post. +// SystemUserPostDao is the data access object for table system_user_post. type SystemUserPostDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemUserPostColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemUserPostColumns // columns contains all the column names of Table for convenient usage. } -// SystemUserPostColumns defines and stores column names for the table system_user_post. +// SystemUserPostColumns defines and stores column names for table system_user_post. type SystemUserPostColumns struct { Id string // id UserId string // 用户ID @@ -32,7 +31,7 @@ type SystemUserPostColumns struct { TenantId string // 租户编号 } -// systemUserPostColumns holds the columns for the table system_user_post. +// systemUserPostColumns holds the columns for table system_user_post. var systemUserPostColumns = SystemUserPostColumns{ Id: "id", UserId: "user_id", @@ -46,49 +45,44 @@ var systemUserPostColumns = SystemUserPostColumns{ } // NewSystemUserPostDao creates and returns a new DAO object for table data access. -func NewSystemUserPostDao(handlers ...gdb.ModelHandler) *SystemUserPostDao { +func NewSystemUserPostDao() *SystemUserPostDao { return &SystemUserPostDao{ - group: "default", - table: "system_user_post", - columns: systemUserPostColumns, - handlers: handlers, + group: "default", + table: "system_user_post", + columns: systemUserPostColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemUserPostDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemUserPostDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemUserPostDao) Columns() SystemUserPostColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemUserPostDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemUserPostDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemUserPostDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_user_role.go b/internal/dao/internal/system_user_role.go index 4f0b8ce..85bf741 100644 --- a/internal/dao/internal/system_user_role.go +++ b/internal/dao/internal/system_user_role.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemUserRoleDao is the data access object for the table system_user_role. +// SystemUserRoleDao is the data access object for table system_user_role. type SystemUserRoleDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemUserRoleColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemUserRoleColumns // columns contains all the column names of Table for convenient usage. } -// SystemUserRoleColumns defines and stores column names for the table system_user_role. +// SystemUserRoleColumns defines and stores column names for table system_user_role. type SystemUserRoleColumns struct { Id string // 自增编号 UserId string // 用户ID @@ -32,7 +31,7 @@ type SystemUserRoleColumns struct { TenantId string // 租户编号 } -// systemUserRoleColumns holds the columns for the table system_user_role. +// systemUserRoleColumns holds the columns for table system_user_role. var systemUserRoleColumns = SystemUserRoleColumns{ Id: "id", UserId: "user_id", @@ -46,49 +45,44 @@ var systemUserRoleColumns = SystemUserRoleColumns{ } // NewSystemUserRoleDao creates and returns a new DAO object for table data access. -func NewSystemUserRoleDao(handlers ...gdb.ModelHandler) *SystemUserRoleDao { +func NewSystemUserRoleDao() *SystemUserRoleDao { return &SystemUserRoleDao{ - group: "default", - table: "system_user_role", - columns: systemUserRoleColumns, - handlers: handlers, + group: "default", + table: "system_user_role", + columns: systemUserRoleColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemUserRoleDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemUserRoleDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemUserRoleDao) Columns() SystemUserRoleColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemUserRoleDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemUserRoleDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemUserRoleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/system_users.go b/internal/dao/internal/system_users.go index 74c290b..ebe2756 100644 --- a/internal/dao/internal/system_users.go +++ b/internal/dao/internal/system_users.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// SystemUsersDao is the data access object for the table system_users. +// SystemUsersDao is the data access object for table system_users. type SystemUsersDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns SystemUsersColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns SystemUsersColumns // columns contains all the column names of Table for convenient usage. } -// SystemUsersColumns defines and stores column names for the table system_users. +// SystemUsersColumns defines and stores column names for table system_users. type SystemUsersColumns struct { Id string // 用户ID Username string // 用户账号 @@ -43,7 +42,7 @@ type SystemUsersColumns struct { TenantId string // 租户编号 } -// systemUsersColumns holds the columns for the table system_users. +// systemUsersColumns holds the columns for table system_users. var systemUsersColumns = SystemUsersColumns{ Id: "id", Username: "username", @@ -68,49 +67,44 @@ var systemUsersColumns = SystemUsersColumns{ } // NewSystemUsersDao creates and returns a new DAO object for table data access. -func NewSystemUsersDao(handlers ...gdb.ModelHandler) *SystemUsersDao { +func NewSystemUsersDao() *SystemUsersDao { return &SystemUsersDao{ - group: "default", - table: "system_users", - columns: systemUsersColumns, - handlers: handlers, + group: "default", + table: "system_users", + columns: systemUsersColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *SystemUsersDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *SystemUsersDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *SystemUsersDao) Columns() SystemUsersColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *SystemUsersDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *SystemUsersDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *SystemUsersDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/yudao_demo_01_contact.go b/internal/dao/internal/yudao_demo_01_contact.go index 29225e3..30bf149 100644 --- a/internal/dao/internal/yudao_demo_01_contact.go +++ b/internal/dao/internal/yudao_demo_01_contact.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// YudaoDemo01ContactDao is the data access object for the table yudao_demo01_contact. +// YudaoDemo01ContactDao is the data access object for table yudao_demo01_contact. type YudaoDemo01ContactDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns YudaoDemo01ContactColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns YudaoDemo01ContactColumns // columns contains all the column names of Table for convenient usage. } -// YudaoDemo01ContactColumns defines and stores column names for the table yudao_demo01_contact. +// YudaoDemo01ContactColumns defines and stores column names for table yudao_demo01_contact. type YudaoDemo01ContactColumns struct { Id string // 编号 Name string // 名字 @@ -35,7 +34,7 @@ type YudaoDemo01ContactColumns struct { TenantId string // 租户编号 } -// yudaoDemo01ContactColumns holds the columns for the table yudao_demo01_contact. +// yudaoDemo01ContactColumns holds the columns for table yudao_demo01_contact. var yudaoDemo01ContactColumns = YudaoDemo01ContactColumns{ Id: "id", Name: "name", @@ -52,49 +51,44 @@ var yudaoDemo01ContactColumns = YudaoDemo01ContactColumns{ } // NewYudaoDemo01ContactDao creates and returns a new DAO object for table data access. -func NewYudaoDemo01ContactDao(handlers ...gdb.ModelHandler) *YudaoDemo01ContactDao { +func NewYudaoDemo01ContactDao() *YudaoDemo01ContactDao { return &YudaoDemo01ContactDao{ - group: "default", - table: "yudao_demo01_contact", - columns: yudaoDemo01ContactColumns, - handlers: handlers, + group: "default", + table: "yudao_demo01_contact", + columns: yudaoDemo01ContactColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *YudaoDemo01ContactDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *YudaoDemo01ContactDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *YudaoDemo01ContactDao) Columns() YudaoDemo01ContactColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *YudaoDemo01ContactDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *YudaoDemo01ContactDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *YudaoDemo01ContactDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/yudao_demo_02_category.go b/internal/dao/internal/yudao_demo_02_category.go index 1602156..6fcdf82 100644 --- a/internal/dao/internal/yudao_demo_02_category.go +++ b/internal/dao/internal/yudao_demo_02_category.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// YudaoDemo02CategoryDao is the data access object for the table yudao_demo02_category. +// YudaoDemo02CategoryDao is the data access object for table yudao_demo02_category. type YudaoDemo02CategoryDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns YudaoDemo02CategoryColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns YudaoDemo02CategoryColumns // columns contains all the column names of Table for convenient usage. } -// YudaoDemo02CategoryColumns defines and stores column names for the table yudao_demo02_category. +// YudaoDemo02CategoryColumns defines and stores column names for table yudao_demo02_category. type YudaoDemo02CategoryColumns struct { Id string // 编号 Name string // 名字 @@ -32,7 +31,7 @@ type YudaoDemo02CategoryColumns struct { TenantId string // 租户编号 } -// yudaoDemo02CategoryColumns holds the columns for the table yudao_demo02_category. +// yudaoDemo02CategoryColumns holds the columns for table yudao_demo02_category. var yudaoDemo02CategoryColumns = YudaoDemo02CategoryColumns{ Id: "id", Name: "name", @@ -46,49 +45,44 @@ var yudaoDemo02CategoryColumns = YudaoDemo02CategoryColumns{ } // NewYudaoDemo02CategoryDao creates and returns a new DAO object for table data access. -func NewYudaoDemo02CategoryDao(handlers ...gdb.ModelHandler) *YudaoDemo02CategoryDao { +func NewYudaoDemo02CategoryDao() *YudaoDemo02CategoryDao { return &YudaoDemo02CategoryDao{ - group: "default", - table: "yudao_demo02_category", - columns: yudaoDemo02CategoryColumns, - handlers: handlers, + group: "default", + table: "yudao_demo02_category", + columns: yudaoDemo02CategoryColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *YudaoDemo02CategoryDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *YudaoDemo02CategoryDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *YudaoDemo02CategoryDao) Columns() YudaoDemo02CategoryColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *YudaoDemo02CategoryDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *YudaoDemo02CategoryDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *YudaoDemo02CategoryDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/yudao_demo_03_course.go b/internal/dao/internal/yudao_demo_03_course.go index adbca80..6d6eec4 100644 --- a/internal/dao/internal/yudao_demo_03_course.go +++ b/internal/dao/internal/yudao_demo_03_course.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// YudaoDemo03CourseDao is the data access object for the table yudao_demo03_course. +// YudaoDemo03CourseDao is the data access object for table yudao_demo03_course. type YudaoDemo03CourseDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns YudaoDemo03CourseColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns YudaoDemo03CourseColumns // columns contains all the column names of Table for convenient usage. } -// YudaoDemo03CourseColumns defines and stores column names for the table yudao_demo03_course. +// YudaoDemo03CourseColumns defines and stores column names for table yudao_demo03_course. type YudaoDemo03CourseColumns struct { Id string // 编号 StudentId string // 学生编号 @@ -33,7 +32,7 @@ type YudaoDemo03CourseColumns struct { TenantId string // 租户编号 } -// yudaoDemo03CourseColumns holds the columns for the table yudao_demo03_course. +// yudaoDemo03CourseColumns holds the columns for table yudao_demo03_course. var yudaoDemo03CourseColumns = YudaoDemo03CourseColumns{ Id: "id", StudentId: "student_id", @@ -48,49 +47,44 @@ var yudaoDemo03CourseColumns = YudaoDemo03CourseColumns{ } // NewYudaoDemo03CourseDao creates and returns a new DAO object for table data access. -func NewYudaoDemo03CourseDao(handlers ...gdb.ModelHandler) *YudaoDemo03CourseDao { +func NewYudaoDemo03CourseDao() *YudaoDemo03CourseDao { return &YudaoDemo03CourseDao{ - group: "default", - table: "yudao_demo03_course", - columns: yudaoDemo03CourseColumns, - handlers: handlers, + group: "default", + table: "yudao_demo03_course", + columns: yudaoDemo03CourseColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *YudaoDemo03CourseDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *YudaoDemo03CourseDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *YudaoDemo03CourseDao) Columns() YudaoDemo03CourseColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *YudaoDemo03CourseDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *YudaoDemo03CourseDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *YudaoDemo03CourseDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/yudao_demo_03_grade.go b/internal/dao/internal/yudao_demo_03_grade.go index 16d2c9d..fbc495b 100644 --- a/internal/dao/internal/yudao_demo_03_grade.go +++ b/internal/dao/internal/yudao_demo_03_grade.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// YudaoDemo03GradeDao is the data access object for the table yudao_demo03_grade. +// YudaoDemo03GradeDao is the data access object for table yudao_demo03_grade. type YudaoDemo03GradeDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns YudaoDemo03GradeColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns YudaoDemo03GradeColumns // columns contains all the column names of Table for convenient usage. } -// YudaoDemo03GradeColumns defines and stores column names for the table yudao_demo03_grade. +// YudaoDemo03GradeColumns defines and stores column names for table yudao_demo03_grade. type YudaoDemo03GradeColumns struct { Id string // 编号 StudentId string // 学生编号 @@ -33,7 +32,7 @@ type YudaoDemo03GradeColumns struct { TenantId string // 租户编号 } -// yudaoDemo03GradeColumns holds the columns for the table yudao_demo03_grade. +// yudaoDemo03GradeColumns holds the columns for table yudao_demo03_grade. var yudaoDemo03GradeColumns = YudaoDemo03GradeColumns{ Id: "id", StudentId: "student_id", @@ -48,49 +47,44 @@ var yudaoDemo03GradeColumns = YudaoDemo03GradeColumns{ } // NewYudaoDemo03GradeDao creates and returns a new DAO object for table data access. -func NewYudaoDemo03GradeDao(handlers ...gdb.ModelHandler) *YudaoDemo03GradeDao { +func NewYudaoDemo03GradeDao() *YudaoDemo03GradeDao { return &YudaoDemo03GradeDao{ - group: "default", - table: "yudao_demo03_grade", - columns: yudaoDemo03GradeColumns, - handlers: handlers, + group: "default", + table: "yudao_demo03_grade", + columns: yudaoDemo03GradeColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *YudaoDemo03GradeDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *YudaoDemo03GradeDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *YudaoDemo03GradeDao) Columns() YudaoDemo03GradeColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *YudaoDemo03GradeDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *YudaoDemo03GradeDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *YudaoDemo03GradeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/dao/internal/yudao_demo_03_student.go b/internal/dao/internal/yudao_demo_03_student.go index 4c8a272..ede3199 100644 --- a/internal/dao/internal/yudao_demo_03_student.go +++ b/internal/dao/internal/yudao_demo_03_student.go @@ -11,15 +11,14 @@ import ( "github.com/gogf/gf/v2/frame/g" ) -// YudaoDemo03StudentDao is the data access object for the table yudao_demo03_student. +// YudaoDemo03StudentDao is the data access object for table yudao_demo03_student. type YudaoDemo03StudentDao struct { - table string // table is the underlying table name of the DAO. - group string // group is the database configuration group name of the current DAO. - columns YudaoDemo03StudentColumns // columns contains all the column names of Table for convenient usage. - handlers []gdb.ModelHandler // handlers for customized model modification. + table string // table is the underlying table name of the DAO. + group string // group is the database configuration group name of current DAO. + columns YudaoDemo03StudentColumns // columns contains all the column names of Table for convenient usage. } -// YudaoDemo03StudentColumns defines and stores column names for the table yudao_demo03_student. +// YudaoDemo03StudentColumns defines and stores column names for table yudao_demo03_student. type YudaoDemo03StudentColumns struct { Id string // 编号 Name string // 名字 @@ -34,7 +33,7 @@ type YudaoDemo03StudentColumns struct { TenantId string // 租户编号 } -// yudaoDemo03StudentColumns holds the columns for the table yudao_demo03_student. +// yudaoDemo03StudentColumns holds the columns for table yudao_demo03_student. var yudaoDemo03StudentColumns = YudaoDemo03StudentColumns{ Id: "id", Name: "name", @@ -50,49 +49,44 @@ var yudaoDemo03StudentColumns = YudaoDemo03StudentColumns{ } // NewYudaoDemo03StudentDao creates and returns a new DAO object for table data access. -func NewYudaoDemo03StudentDao(handlers ...gdb.ModelHandler) *YudaoDemo03StudentDao { +func NewYudaoDemo03StudentDao() *YudaoDemo03StudentDao { return &YudaoDemo03StudentDao{ - group: "default", - table: "yudao_demo03_student", - columns: yudaoDemo03StudentColumns, - handlers: handlers, + group: "default", + table: "yudao_demo03_student", + columns: yudaoDemo03StudentColumns, } } -// DB retrieves and returns the underlying raw database management object of the current DAO. +// DB retrieves and returns the underlying raw database management object of current DAO. func (dao *YudaoDemo03StudentDao) DB() gdb.DB { return g.DB(dao.group) } -// Table returns the table name of the current DAO. +// Table returns the table name of current dao. func (dao *YudaoDemo03StudentDao) Table() string { return dao.table } -// Columns returns all column names of the current DAO. +// Columns returns all column names of current dao. func (dao *YudaoDemo03StudentDao) Columns() YudaoDemo03StudentColumns { return dao.columns } -// Group returns the database configuration group name of the current DAO. +// Group returns the configuration group name of database of current dao. func (dao *YudaoDemo03StudentDao) Group() string { return dao.group } -// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *YudaoDemo03StudentDao) Ctx(ctx context.Context) *gdb.Model { - model := dao.DB().Model(dao.table) - for _, handler := range dao.handlers { - model = handler(model) - } - return model.Safe().Ctx(ctx) + return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. -// It rolls back the transaction and returns the error if function f returns a non-nil error. +// It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // -// Note: Do not commit or roll back the transaction in function f, +// Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *YudaoDemo03StudentDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) diff --git a/internal/logic/cron/cron.go b/internal/logic/cron/cron.go index 0b8e76a..ced363b 100644 --- a/internal/logic/cron/cron.go +++ b/internal/logic/cron/cron.go @@ -131,19 +131,19 @@ func (l *Logic) GetJobStatus(ctx context.Context, name string) (bool, error) { // registerDefaultJobs 注册默认的定时任务 func (l *Logic) registerDefaultJobs(ctx context.Context) error { - // 每小时执行一次数据同步任务 - if err := l.AddJob(ctx, "data_sync_hourly", "0 0 * * * *", func() { - l.syncDataFromThirdParty(ctx) - }); err != nil { - return err - } - - // 每天凌晨2点执行数据清理任务 - if err := l.AddJob(ctx, "data_cleanup_daily", "0 0 2 * * *", func() { - l.cleanupOldData(ctx) - }); err != nil { - return err - } + //// 每小时执行一次数据同步任务 + //if err := l.AddJob(ctx, "data_sync_hourly", "0 0 * * * *", func() { + // l.syncDataFromThirdParty(ctx) + //}); err != nil { + // return err + //} + // + //// 每天凌晨2点执行数据清理任务 + //if err := l.AddJob(ctx, "data_cleanup_daily", "0 0 2 * * *", func() { + // l.cleanupOldData(ctx) + //}); err != nil { + // return err + //} // 每5分钟执行一次健康检查任务 if err := l.AddJob(ctx, "health_check", "0 0/5 * * * *", func() { @@ -208,7 +208,7 @@ func (l *Logic) syncHeroData(ctx context.Context) { g.Log().Info(ctx, "Hero data sync completed") } -// syncArtifactData 同步神器数据 +//同步神器数据 func (l *Logic) syncArtifactData(ctx context.Context) { g.Log().Info(ctx, "Starting artifact data sync...") @@ -220,18 +220,6 @@ func (l *Logic) syncArtifactData(ctx context.Context) { g.Log().Info(ctx, "Artifact data sync completed") } -// cleanupOldData 清理旧数据 -func (l *Logic) cleanupOldData(ctx context.Context) { - g.Log().Info(ctx, "Starting data cleanup...") - - // TODO: 实现数据清理逻辑 - // 1. 删除过期的缓存数据 - // 2. 清理过期的日志记录 - // 3. 归档历史数据 - - g.Log().Info(ctx, "Data cleanup completed") -} - // healthCheck 健康检查 func (l *Logic) healthCheck(ctx context.Context) { g.Log().Debug(ctx, "Performing health check...") diff --git a/internal/logic/cron/third_party_sync.go b/internal/logic/cron/third_party_sync.go index 9416d4b..f97c5db 100644 --- a/internal/logic/cron/third_party_sync.go +++ b/internal/logic/cron/third_party_sync.go @@ -54,20 +54,18 @@ func (t *ThirdPartyDataSync) SyncHeroData(ctx context.Context) error { func (t *ThirdPartyDataSync) SyncArtifactData(ctx context.Context) error { g.Log().Info(ctx, "开始同步神器数据...") - util.RedisCache.Set(ctx, "artifacts_all11", "asd", 0) + //从第三方API获取神器数据 + artifactData, err := t.fetchArtifactDataFromAPI(ctx) + if err != nil { + g.Log().Error(ctx, "获取神器数据失败:", err) + return err + } - // 示例:从第三方API获取神器数据 - //artifactData, err := t.fetchArtifactDataFromAPI(ctx) - //if err != nil { - // g.Log().Error(ctx, "获取神器数据失败:", err) - // return err - //} - // - //// 处理并保存数据 - //if err := t.processAndSaveArtifactData(ctx, artifactData); err != nil { - // g.Log().Error(ctx, "处理神器数据失败:", err) - // return err - //} + // 处理并保存数据 + if err := t.processAndSaveArtifactData(ctx, artifactData); err != nil { + g.Log().Error(ctx, "处理神器数据失败:", err) + return err + } g.Log().Info(ctx, "神器数据同步完成") return nil @@ -113,12 +111,9 @@ func (t *ThirdPartyDataSync) FetchHeroBuildsFromAPI(ctx context.Context, heroNam "Content-Type": "application/json", } - // 直接将角色名作为body - //bodyBytes := []byte(heroName) heroNameEN := i18n.Zh2En(heroName) - fmt.Println(heroNameEN) - resp, err := t.client.Header(headers).Post(ctx, apiURL, "Argent Waves Hwayoung") + resp, err := t.client.Header(headers).Post(ctx, apiURL, heroNameEN) if err != nil { return "", fmt.Errorf("API请求失败: %v", err) } @@ -424,3 +419,61 @@ func (t *ThirdPartyDataSync) SyncAllData(ctx context.Context) error { g.Log().Info(ctx, "所有第三方数据同步完成") return nil } + +// RefreshHeroSetContentByHeroInfo 刷新单个角色配装字段 +func (t *ThirdPartyDataSync) RefreshHeroSetContentByHeroInfo(ctx context.Context, heroName, heroCode, jsonStr string) error { + g.Log().Infof(ctx, "刷新角色配装: %s", heroName) + if len(jsonStr) > 200 { + _, err := dao.EpicHeroInfo.Ctx(ctx). + Where(dao.EpicHeroInfo.Columns().HeroCode, heroCode). + Data(g.Map{ + dao.EpicHeroInfo.Columns().SetContentJson: jsonStr, + dao.EpicHeroInfo.Columns().SetUpdateTime: gtime.Now(), + }). + Update() + if err != nil { + g.Log().Errorf(ctx, "更新数据库失败: %s, err: %v", heroName, err) + return err + } + g.Log().Infof(ctx, "已更新: %s", heroName) + return nil + } else { + g.Log().Error(ctx, "配装数据无效(长度<=200): %s", heroName) + return fmt.Errorf("配装数据无效(长度<=200)") + } +} + +// RefreshAllHeroSetContent 刷新所有角色配装字段 +func (t *ThirdPartyDataSync) RefreshAllHeroSetContent(ctx context.Context) error { + g.Log().Info(ctx, "开始批量刷新所有角色配装字段...") + + // 1. 查询所有角色,按set_update_time正序排列,为空的在最前面 + var heroList []*entity.EpicHeroInfo + err := dao.EpicHeroInfo.Ctx(ctx). + OrderAsc("set_update_time"). + Scan(&heroList) + if err != nil { + g.Log().Error(ctx, "查询epic_hero_info失败:", err) + return err + } + + for i, epicHeroInfo := range heroList { + g.Log().Infof(ctx, "[%d/%d] 处理角色: %s", i+1, len(heroList), epicHeroInfo.HeroName) + jsonStr, err := t.FetchHeroBuildsFromAPI(ctx, epicHeroInfo.HeroName) + if err != nil { + g.Log().Errorf(ctx, "获取配装数据失败: %s, err: %v", epicHeroInfo.HeroName, err) + } else { + err = t.RefreshHeroSetContentByHeroInfo(ctx, epicHeroInfo.HeroName, epicHeroInfo.HeroCode, jsonStr) + } + // 远程接口有频率限制,停顿10分钟 + if i < len(heroList)-1 { + g.Log().Info(ctx, "等待10分钟...") + time.Sleep(10 * time.Minute) + } + if err != nil { + continue + } + } + g.Log().Info(ctx, "所有角色配装字段刷新完成") + return nil +} diff --git a/internal/logic/cron/third_party_sync_test.go b/internal/logic/cron/third_party_sync_test.go index 7cb9725..a6ab61e 100644 --- a/internal/logic/cron/third_party_sync_test.go +++ b/internal/logic/cron/third_party_sync_test.go @@ -23,6 +23,15 @@ func TestMain(m *testing.M) { os.Exit(code) } +/** + * 测试同步英雄数据 + */ +func TestI18n(t *testing.T) { + _ = i18n.RefreshI18n(context.Background()) + fmt.Println(i18n.Zh2En("湖畔魔女泰妮布里雅")) + +} + /** * 测试同步英雄数据 */ diff --git a/internal/logic/hero/hero.go b/internal/logic/hero/hero.go index 0a01996..8f18e9d 100644 --- a/internal/logic/hero/hero.go +++ b/internal/logic/hero/hero.go @@ -150,6 +150,10 @@ func (l *Logic) GetHeroDetailByCode(ctx context.Context, code string) (*v1.HeroD } } if fribbleHeroSet.JsonContent != "" { + err := thirdPartySync.RefreshHeroSetContentByHeroInfo(ctx, epicHeroInfo.HeroName, code, fribbleHeroSet.JsonContent) + if err != nil { + return nil, err + } // 写入 Redis 缓存,永久 util.RedisCache.Set(ctx, cacheKey, fribbleHeroSet.JsonContent, 0) } diff --git a/internal/logic/i18n/i18n.go b/internal/logic/i18n/i18n.go index 6daa729..6f8c802 100644 --- a/internal/logic/i18n/i18n.go +++ b/internal/logic/i18n/i18n.go @@ -646,7 +646,7 @@ func (l *Logic) LoadFromDB(ctx context.Context) error { // 重新构建缓存 l.cache = make(map[string]map[string]string) - // 新增:同步数据库内容到I18nEnToZh备份 + // 新增:同步数据库内容到I18nEnToZh和I18nZhToEn备份 for _, m := range mappings { if l.cache[m.Language] == nil { l.cache[m.Language] = make(map[string]string) @@ -654,6 +654,7 @@ func (l *Logic) LoadFromDB(ctx context.Context) error { l.cache[m.Language][m.KeyName] = m.Value if m.Language == "zh" { I18nEnToZh[m.KeyName] = m.Value + I18nZhToEn[m.Value] = m.KeyName // 新增:同步反向映射 } } diff --git a/internal/model/do/epic_hero_info.go b/internal/model/do/epic_hero_info.go index 2bc87d9..ead93fe 100644 --- a/internal/model/do/epic_hero_info.go +++ b/internal/model/do/epic_hero_info.go @@ -11,22 +11,24 @@ import ( // EpicHeroInfo is the golang structure of table epic_hero_info for DAO operations like Where/Data. type EpicHeroInfo struct { - g.Meta `orm:"table:epic_hero_info, do:true"` - Id interface{} // 文件编号 - HeroName interface{} // 配置编号 - HeroCode interface{} // 文件名 - HeroAttrLv60 interface{} // 文件路径 - Creator interface{} // 创建者 - CreateTime *gtime.Time // 创建时间 - Updater interface{} // 更新者 - UpdateTime *gtime.Time // 更新时间 - Deleted interface{} // 是否删除 - NickName interface{} // 配置编号 - Rarity interface{} // 配置编号 - Role interface{} // 配置编号 - Zodiac interface{} // 配置编号 - HeadImgUrl interface{} // 配置编号 - Attribute interface{} // 配置编号 - Remark interface{} // 配置编号 - RawJson interface{} // 原始json + g.Meta `orm:"table:epic_hero_info, do:true"` + Id interface{} // 文件编号 + HeroName interface{} // 配置编号 + HeroCode interface{} // 文件名 + HeroAttrLv60 interface{} // 文件路径 + Creator interface{} // 创建者 + CreateTime *gtime.Time // 创建时间 + Updater interface{} // 更新者 + UpdateTime *gtime.Time // 更新时间 + Deleted interface{} // 是否删除 + NickName interface{} // 配置编号 + Rarity interface{} // 配置编号 + Role interface{} // 配置编号 + Zodiac interface{} // 配置编号 + HeadImgUrl interface{} // 配置编号 + Attribute interface{} // 配置编号 + Remark interface{} // 配置编号 + RawJson interface{} // 原始json + SetContentJson interface{} // 配装json数据 + SetUpdateTime *gtime.Time // 配装更新时间 } diff --git a/internal/model/entity/epic_hero_info.go b/internal/model/entity/epic_hero_info.go index ae9b441..c95d8e0 100644 --- a/internal/model/entity/epic_hero_info.go +++ b/internal/model/entity/epic_hero_info.go @@ -10,21 +10,23 @@ import ( // EpicHeroInfo is the golang structure for table epic_hero_info. type EpicHeroInfo struct { - Id int64 `json:"id" orm:"id" description:"文件编号"` // 文件编号 - HeroName string `json:"heroName" orm:"hero_name" description:"配置编号"` // 配置编号 - HeroCode string `json:"heroCode" orm:"hero_code" description:"文件名"` // 文件名 - HeroAttrLv60 string `json:"heroAttrLv60" orm:"hero_attr_lv60" description:"文件路径"` // 文件路径 - Creator string `json:"creator" orm:"creator" description:"创建者"` // 创建者 - CreateTime *gtime.Time `json:"createTime" orm:"create_time" description:"创建时间"` // 创建时间 - Updater string `json:"updater" orm:"updater" description:"更新者"` // 更新者 - UpdateTime *gtime.Time `json:"updateTime" orm:"update_time" description:"更新时间"` // 更新时间 - Deleted bool `json:"deleted" orm:"deleted" description:"是否删除"` // 是否删除 - NickName string `json:"nickName" orm:"nick_name" description:"配置编号"` // 配置编号 - Rarity string `json:"rarity" orm:"rarity" description:"配置编号"` // 配置编号 - Role string `json:"role" orm:"role" description:"配置编号"` // 配置编号 - Zodiac string `json:"zodiac" orm:"zodiac" description:"配置编号"` // 配置编号 - HeadImgUrl string `json:"headImgUrl" orm:"head_img_url" description:"配置编号"` // 配置编号 - Attribute string `json:"attribute" orm:"attribute" description:"配置编号"` // 配置编号 - Remark string `json:"remark" orm:"remark" description:"配置编号"` // 配置编号 - RawJson string `json:"rawJson" orm:"raw_json" description:"原始json"` // 原始json + Id int64 `json:"id" orm:"id" description:"文件编号"` // 文件编号 + HeroName string `json:"heroName" orm:"hero_name" description:"配置编号"` // 配置编号 + HeroCode string `json:"heroCode" orm:"hero_code" description:"文件名"` // 文件名 + HeroAttrLv60 string `json:"heroAttrLv60" orm:"hero_attr_lv60" description:"文件路径"` // 文件路径 + Creator string `json:"creator" orm:"creator" description:"创建者"` // 创建者 + CreateTime *gtime.Time `json:"createTime" orm:"create_time" description:"创建时间"` // 创建时间 + Updater string `json:"updater" orm:"updater" description:"更新者"` // 更新者 + UpdateTime *gtime.Time `json:"updateTime" orm:"update_time" description:"更新时间"` // 更新时间 + Deleted bool `json:"deleted" orm:"deleted" description:"是否删除"` // 是否删除 + NickName string `json:"nickName" orm:"nick_name" description:"配置编号"` // 配置编号 + Rarity string `json:"rarity" orm:"rarity" description:"配置编号"` // 配置编号 + Role string `json:"role" orm:"role" description:"配置编号"` // 配置编号 + Zodiac string `json:"zodiac" orm:"zodiac" description:"配置编号"` // 配置编号 + HeadImgUrl string `json:"headImgUrl" orm:"head_img_url" description:"配置编号"` // 配置编号 + Attribute string `json:"attribute" orm:"attribute" description:"配置编号"` // 配置编号 + Remark string `json:"remark" orm:"remark" description:"配置编号"` // 配置编号 + RawJson string `json:"rawJson" orm:"raw_json" description:"原始json"` // 原始json + SetContentJson string `json:"setContentJson" orm:"set_content_json" description:"配装json数据"` // 配装json数据 + SetUpdateTime *gtime.Time `json:"setUpdateTime" orm:"set_update_time" description:"配装更新时间"` // 配装更新时间 }