refactor(internal): 优化 OSS 预签名 URL 缓存刷新任务和英雄数据缓存逻辑
- 注释掉 OSS预签名 URL 缓存刷新任务的定时执行代码 - 在 hero/hero.go 中增加对 Redis缓存和英雄数据集的非空校验 - 修改 OSS预签名 URL 生成逻辑,自动替换为 CDN 域名
This commit is contained in:
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// EpicArtifactInfoDao is the data access object for table epic_artifact_info.
|
||||
// EpicArtifactInfoDao is the data access object for the 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 current DAO.
|
||||
columns EpicArtifactInfoColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// EpicArtifactInfoColumns defines and stores column names for table epic_artifact_info.
|
||||
// EpicArtifactInfoColumns defines and stores column names for the table epic_artifact_info.
|
||||
type EpicArtifactInfoColumns struct {
|
||||
Id string // 文件编号
|
||||
ArtifactName string // 配置编号
|
||||
@@ -37,7 +38,7 @@ type EpicArtifactInfoColumns struct {
|
||||
ImageUrl string // 图片地址
|
||||
}
|
||||
|
||||
// epicArtifactInfoColumns holds the columns for table epic_artifact_info.
|
||||
// epicArtifactInfoColumns holds the columns for the table epic_artifact_info.
|
||||
var epicArtifactInfoColumns = EpicArtifactInfoColumns{
|
||||
Id: "id",
|
||||
ArtifactName: "artifact_name",
|
||||
@@ -57,44 +58,49 @@ var epicArtifactInfoColumns = EpicArtifactInfoColumns{
|
||||
}
|
||||
|
||||
// NewEpicArtifactInfoDao creates and returns a new DAO object for table data access.
|
||||
func NewEpicArtifactInfoDao() *EpicArtifactInfoDao {
|
||||
func NewEpicArtifactInfoDao(handlers ...gdb.ModelHandler) *EpicArtifactInfoDao {
|
||||
return &EpicArtifactInfoDao{
|
||||
group: "default",
|
||||
table: "epic_artifact_info",
|
||||
columns: epicArtifactInfoColumns,
|
||||
group: "default",
|
||||
table: "epic_artifact_info",
|
||||
columns: epicArtifactInfoColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *EpicArtifactInfoDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *EpicArtifactInfoDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *EpicArtifactInfoDao) Columns() EpicArtifactInfoColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *EpicArtifactInfoDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *EpicArtifactInfoDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// EpicGvgAttackTeamsDao is the data access object for table epic_gvg_attack_teams.
|
||||
// EpicGvgAttackTeamsDao is the data access object for the 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 current DAO.
|
||||
columns EpicGvgAttackTeamsColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// EpicGvgAttackTeamsColumns defines and stores column names for table epic_gvg_attack_teams.
|
||||
// EpicGvgAttackTeamsColumns defines and stores column names for the table epic_gvg_attack_teams.
|
||||
type EpicGvgAttackTeamsColumns struct {
|
||||
Id string // id
|
||||
AttackHeroes string // 进攻角色
|
||||
@@ -29,7 +30,7 @@ type EpicGvgAttackTeamsColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// epicGvgAttackTeamsColumns holds the columns for table epic_gvg_attack_teams.
|
||||
// epicGvgAttackTeamsColumns holds the columns for the table epic_gvg_attack_teams.
|
||||
var epicGvgAttackTeamsColumns = EpicGvgAttackTeamsColumns{
|
||||
Id: "id",
|
||||
AttackHeroes: "attack_heroes",
|
||||
@@ -41,44 +42,49 @@ var epicGvgAttackTeamsColumns = EpicGvgAttackTeamsColumns{
|
||||
}
|
||||
|
||||
// NewEpicGvgAttackTeamsDao creates and returns a new DAO object for table data access.
|
||||
func NewEpicGvgAttackTeamsDao() *EpicGvgAttackTeamsDao {
|
||||
func NewEpicGvgAttackTeamsDao(handlers ...gdb.ModelHandler) *EpicGvgAttackTeamsDao {
|
||||
return &EpicGvgAttackTeamsDao{
|
||||
group: "default",
|
||||
table: "epic_gvg_attack_teams",
|
||||
columns: epicGvgAttackTeamsColumns,
|
||||
group: "default",
|
||||
table: "epic_gvg_attack_teams",
|
||||
columns: epicGvgAttackTeamsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *EpicGvgAttackTeamsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *EpicGvgAttackTeamsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *EpicGvgAttackTeamsDao) Columns() EpicGvgAttackTeamsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *EpicGvgAttackTeamsDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *EpicGvgAttackTeamsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// EpicGvgDefenseAttackMappingDao is the data access object for table epic_gvg_defense_attack_mapping.
|
||||
// EpicGvgDefenseAttackMappingDao is the data access object for the 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 current DAO.
|
||||
columns EpicGvgDefenseAttackMappingColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// EpicGvgDefenseAttackMappingColumns defines and stores column names for table epic_gvg_defense_attack_mapping.
|
||||
// EpicGvgDefenseAttackMappingColumns defines and stores column names for the table epic_gvg_defense_attack_mapping.
|
||||
type EpicGvgDefenseAttackMappingColumns struct {
|
||||
Id string // id
|
||||
DefenseId string // 防守阵容
|
||||
@@ -35,7 +36,7 @@ type EpicGvgDefenseAttackMappingColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// epicGvgDefenseAttackMappingColumns holds the columns for table epic_gvg_defense_attack_mapping.
|
||||
// epicGvgDefenseAttackMappingColumns holds the columns for the table epic_gvg_defense_attack_mapping.
|
||||
var epicGvgDefenseAttackMappingColumns = EpicGvgDefenseAttackMappingColumns{
|
||||
Id: "id",
|
||||
DefenseId: "defense_id",
|
||||
@@ -53,44 +54,49 @@ var epicGvgDefenseAttackMappingColumns = EpicGvgDefenseAttackMappingColumns{
|
||||
}
|
||||
|
||||
// NewEpicGvgDefenseAttackMappingDao creates and returns a new DAO object for table data access.
|
||||
func NewEpicGvgDefenseAttackMappingDao() *EpicGvgDefenseAttackMappingDao {
|
||||
func NewEpicGvgDefenseAttackMappingDao(handlers ...gdb.ModelHandler) *EpicGvgDefenseAttackMappingDao {
|
||||
return &EpicGvgDefenseAttackMappingDao{
|
||||
group: "default",
|
||||
table: "epic_gvg_defense_attack_mapping",
|
||||
columns: epicGvgDefenseAttackMappingColumns,
|
||||
group: "default",
|
||||
table: "epic_gvg_defense_attack_mapping",
|
||||
columns: epicGvgDefenseAttackMappingColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *EpicGvgDefenseAttackMappingDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *EpicGvgDefenseAttackMappingDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *EpicGvgDefenseAttackMappingDao) Columns() EpicGvgDefenseAttackMappingColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *EpicGvgDefenseAttackMappingDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *EpicGvgDefenseAttackMappingDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// EpicGvgDefenseTeamsDao is the data access object for table epic_gvg_defense_teams.
|
||||
// EpicGvgDefenseTeamsDao is the data access object for the 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 current DAO.
|
||||
columns EpicGvgDefenseTeamsColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// EpicGvgDefenseTeamsColumns defines and stores column names for table epic_gvg_defense_teams.
|
||||
// EpicGvgDefenseTeamsColumns defines and stores column names for the table epic_gvg_defense_teams.
|
||||
type EpicGvgDefenseTeamsColumns struct {
|
||||
Id string // id
|
||||
DefenseHeroes string // 防守角色
|
||||
@@ -29,7 +30,7 @@ type EpicGvgDefenseTeamsColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// epicGvgDefenseTeamsColumns holds the columns for table epic_gvg_defense_teams.
|
||||
// epicGvgDefenseTeamsColumns holds the columns for the table epic_gvg_defense_teams.
|
||||
var epicGvgDefenseTeamsColumns = EpicGvgDefenseTeamsColumns{
|
||||
Id: "id",
|
||||
DefenseHeroes: "defense_heroes",
|
||||
@@ -41,44 +42,49 @@ var epicGvgDefenseTeamsColumns = EpicGvgDefenseTeamsColumns{
|
||||
}
|
||||
|
||||
// NewEpicGvgDefenseTeamsDao creates and returns a new DAO object for table data access.
|
||||
func NewEpicGvgDefenseTeamsDao() *EpicGvgDefenseTeamsDao {
|
||||
func NewEpicGvgDefenseTeamsDao(handlers ...gdb.ModelHandler) *EpicGvgDefenseTeamsDao {
|
||||
return &EpicGvgDefenseTeamsDao{
|
||||
group: "default",
|
||||
table: "epic_gvg_defense_teams",
|
||||
columns: epicGvgDefenseTeamsColumns,
|
||||
group: "default",
|
||||
table: "epic_gvg_defense_teams",
|
||||
columns: epicGvgDefenseTeamsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *EpicGvgDefenseTeamsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *EpicGvgDefenseTeamsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *EpicGvgDefenseTeamsDao) Columns() EpicGvgDefenseTeamsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *EpicGvgDefenseTeamsDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *EpicGvgDefenseTeamsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// EpicHeroInfoDao is the data access object for table epic_hero_info.
|
||||
// EpicHeroInfoDao is the data access object for the 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 current DAO.
|
||||
columns EpicHeroInfoColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// EpicHeroInfoColumns defines and stores column names for table epic_hero_info.
|
||||
// EpicHeroInfoColumns defines and stores column names for the table epic_hero_info.
|
||||
type EpicHeroInfoColumns struct {
|
||||
Id string // 文件编号
|
||||
HeroName string // 配置编号
|
||||
@@ -41,7 +42,7 @@ type EpicHeroInfoColumns struct {
|
||||
SetUpdateTime string // 配装更新时间
|
||||
}
|
||||
|
||||
// epicHeroInfoColumns holds the columns for table epic_hero_info.
|
||||
// epicHeroInfoColumns holds the columns for the table epic_hero_info.
|
||||
var epicHeroInfoColumns = EpicHeroInfoColumns{
|
||||
Id: "id",
|
||||
HeroName: "hero_name",
|
||||
@@ -65,44 +66,49 @@ var epicHeroInfoColumns = EpicHeroInfoColumns{
|
||||
}
|
||||
|
||||
// NewEpicHeroInfoDao creates and returns a new DAO object for table data access.
|
||||
func NewEpicHeroInfoDao() *EpicHeroInfoDao {
|
||||
func NewEpicHeroInfoDao(handlers ...gdb.ModelHandler) *EpicHeroInfoDao {
|
||||
return &EpicHeroInfoDao{
|
||||
group: "default",
|
||||
table: "epic_hero_info",
|
||||
columns: epicHeroInfoColumns,
|
||||
group: "default",
|
||||
table: "epic_hero_info",
|
||||
columns: epicHeroInfoColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *EpicHeroInfoDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *EpicHeroInfoDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *EpicHeroInfoDao) Columns() EpicHeroInfoColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *EpicHeroInfoDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *EpicHeroInfoDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// EpicHeroUserBuildDao is the data access object for table epic_hero_user_build.
|
||||
// EpicHeroUserBuildDao is the data access object for the 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 current DAO.
|
||||
columns EpicHeroUserBuildColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// EpicHeroUserBuildColumns defines and stores column names for table epic_hero_user_build.
|
||||
// EpicHeroUserBuildColumns defines and stores column names for the table epic_hero_user_build.
|
||||
type EpicHeroUserBuildColumns struct {
|
||||
Id string // 文件编号
|
||||
ArtifactCode string // 配置编号
|
||||
@@ -33,7 +34,7 @@ type EpicHeroUserBuildColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// epicHeroUserBuildColumns holds the columns for table epic_hero_user_build.
|
||||
// epicHeroUserBuildColumns holds the columns for the table epic_hero_user_build.
|
||||
var epicHeroUserBuildColumns = EpicHeroUserBuildColumns{
|
||||
Id: "id",
|
||||
ArtifactCode: "artifact_code",
|
||||
@@ -49,44 +50,49 @@ var epicHeroUserBuildColumns = EpicHeroUserBuildColumns{
|
||||
}
|
||||
|
||||
// NewEpicHeroUserBuildDao creates and returns a new DAO object for table data access.
|
||||
func NewEpicHeroUserBuildDao() *EpicHeroUserBuildDao {
|
||||
func NewEpicHeroUserBuildDao(handlers ...gdb.ModelHandler) *EpicHeroUserBuildDao {
|
||||
return &EpicHeroUserBuildDao{
|
||||
group: "default",
|
||||
table: "epic_hero_user_build",
|
||||
columns: epicHeroUserBuildColumns,
|
||||
group: "default",
|
||||
table: "epic_hero_user_build",
|
||||
columns: epicHeroUserBuildColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *EpicHeroUserBuildDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *EpicHeroUserBuildDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *EpicHeroUserBuildDao) Columns() EpicHeroUserBuildColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *EpicHeroUserBuildDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *EpicHeroUserBuildDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// EpicI18NMappingsDao is the data access object for table epic_i18n_mappings.
|
||||
// EpicI18NMappingsDao is the data access object for the 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 current DAO.
|
||||
columns EpicI18NMappingsColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// EpicI18NMappingsColumns defines and stores column names for table epic_i18n_mappings.
|
||||
// EpicI18NMappingsColumns defines and stores column names for the table epic_i18n_mappings.
|
||||
type EpicI18NMappingsColumns struct {
|
||||
Id string // 主键ID
|
||||
KeyName string // 英文key
|
||||
@@ -31,9 +32,10 @@ type EpicI18NMappingsColumns struct {
|
||||
Updater string // 更新者
|
||||
UpdateTime string // 更新时间
|
||||
Deleted string // 是否删除
|
||||
Code string // 编码
|
||||
}
|
||||
|
||||
// epicI18NMappingsColumns holds the columns for table epic_i18n_mappings.
|
||||
// epicI18NMappingsColumns holds the columns for the table epic_i18n_mappings.
|
||||
var epicI18NMappingsColumns = EpicI18NMappingsColumns{
|
||||
Id: "id",
|
||||
KeyName: "key_name",
|
||||
@@ -46,47 +48,53 @@ var epicI18NMappingsColumns = EpicI18NMappingsColumns{
|
||||
Updater: "updater",
|
||||
UpdateTime: "update_time",
|
||||
Deleted: "deleted",
|
||||
Code: "code",
|
||||
}
|
||||
|
||||
// NewEpicI18NMappingsDao creates and returns a new DAO object for table data access.
|
||||
func NewEpicI18NMappingsDao() *EpicI18NMappingsDao {
|
||||
func NewEpicI18NMappingsDao(handlers ...gdb.ModelHandler) *EpicI18NMappingsDao {
|
||||
return &EpicI18NMappingsDao{
|
||||
group: "default",
|
||||
table: "epic_i18n_mappings",
|
||||
columns: epicI18NMappingsColumns,
|
||||
group: "default",
|
||||
table: "epic_i18n_mappings",
|
||||
columns: epicI18NMappingsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *EpicI18NMappingsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *EpicI18NMappingsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *EpicI18NMappingsDao) Columns() EpicI18NMappingsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *EpicI18NMappingsDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *EpicI18NMappingsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// FribbleHeroSetDao is the data access object for table fribble_hero_set.
|
||||
// FribbleHeroSetDao is the data access object for the 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 current DAO.
|
||||
columns FribbleHeroSetColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// FribbleHeroSetColumns defines and stores column names for table fribble_hero_set.
|
||||
// FribbleHeroSetColumns defines and stores column names for the table fribble_hero_set.
|
||||
type FribbleHeroSetColumns struct {
|
||||
Id string // 文件编号
|
||||
HeroCode string // 配置编号
|
||||
@@ -32,7 +33,7 @@ type FribbleHeroSetColumns struct {
|
||||
SuccessGet string //
|
||||
}
|
||||
|
||||
// fribbleHeroSetColumns holds the columns for table fribble_hero_set.
|
||||
// fribbleHeroSetColumns holds the columns for the table fribble_hero_set.
|
||||
var fribbleHeroSetColumns = FribbleHeroSetColumns{
|
||||
Id: "id",
|
||||
HeroCode: "hero_code",
|
||||
@@ -47,44 +48,49 @@ var fribbleHeroSetColumns = FribbleHeroSetColumns{
|
||||
}
|
||||
|
||||
// NewFribbleHeroSetDao creates and returns a new DAO object for table data access.
|
||||
func NewFribbleHeroSetDao() *FribbleHeroSetDao {
|
||||
func NewFribbleHeroSetDao(handlers ...gdb.ModelHandler) *FribbleHeroSetDao {
|
||||
return &FribbleHeroSetDao{
|
||||
group: "default",
|
||||
table: "fribble_hero_set",
|
||||
columns: fribbleHeroSetColumns,
|
||||
group: "default",
|
||||
table: "fribble_hero_set",
|
||||
columns: fribbleHeroSetColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *FribbleHeroSetDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *FribbleHeroSetDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *FribbleHeroSetDao) Columns() FribbleHeroSetColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *FribbleHeroSetDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *FribbleHeroSetDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// GearSetInfoDao is the data access object for table gear_set_info.
|
||||
// GearSetInfoDao is the data access object for the 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 current DAO.
|
||||
columns GearSetInfoColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// GearSetInfoColumns defines and stores column names for table gear_set_info.
|
||||
// GearSetInfoColumns defines and stores column names for the table gear_set_info.
|
||||
type GearSetInfoColumns struct {
|
||||
Id string // 装备ID
|
||||
Level string // 装备等级
|
||||
@@ -45,7 +46,7 @@ type GearSetInfoColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// gearSetInfoColumns holds the columns for table gear_set_info.
|
||||
// gearSetInfoColumns holds the columns for the table gear_set_info.
|
||||
var gearSetInfoColumns = GearSetInfoColumns{
|
||||
Id: "id",
|
||||
Level: "level",
|
||||
@@ -73,44 +74,49 @@ var gearSetInfoColumns = GearSetInfoColumns{
|
||||
}
|
||||
|
||||
// NewGearSetInfoDao creates and returns a new DAO object for table data access.
|
||||
func NewGearSetInfoDao() *GearSetInfoDao {
|
||||
func NewGearSetInfoDao(handlers ...gdb.ModelHandler) *GearSetInfoDao {
|
||||
return &GearSetInfoDao{
|
||||
group: "default",
|
||||
table: "gear_set_info",
|
||||
columns: gearSetInfoColumns,
|
||||
group: "default",
|
||||
table: "gear_set_info",
|
||||
columns: gearSetInfoColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *GearSetInfoDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *GearSetInfoDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *GearSetInfoDao) Columns() GearSetInfoColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *GearSetInfoDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *GearSetInfoDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// InfraApiAccessLogDao is the data access object for table infra_api_access_log.
|
||||
// InfraApiAccessLogDao is the data access object for the 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 current DAO.
|
||||
columns InfraApiAccessLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// InfraApiAccessLogColumns defines and stores column names for table infra_api_access_log.
|
||||
// InfraApiAccessLogColumns defines and stores column names for the table infra_api_access_log.
|
||||
type InfraApiAccessLogColumns struct {
|
||||
Id string // 日志主键
|
||||
TraceId string // 链路追踪编号
|
||||
@@ -47,7 +48,7 @@ type InfraApiAccessLogColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// infraApiAccessLogColumns holds the columns for table infra_api_access_log.
|
||||
// infraApiAccessLogColumns holds the columns for the table infra_api_access_log.
|
||||
var infraApiAccessLogColumns = InfraApiAccessLogColumns{
|
||||
Id: "id",
|
||||
TraceId: "trace_id",
|
||||
@@ -77,44 +78,49 @@ var infraApiAccessLogColumns = InfraApiAccessLogColumns{
|
||||
}
|
||||
|
||||
// NewInfraApiAccessLogDao creates and returns a new DAO object for table data access.
|
||||
func NewInfraApiAccessLogDao() *InfraApiAccessLogDao {
|
||||
func NewInfraApiAccessLogDao(handlers ...gdb.ModelHandler) *InfraApiAccessLogDao {
|
||||
return &InfraApiAccessLogDao{
|
||||
group: "default",
|
||||
table: "infra_api_access_log",
|
||||
columns: infraApiAccessLogColumns,
|
||||
group: "default",
|
||||
table: "infra_api_access_log",
|
||||
columns: infraApiAccessLogColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *InfraApiAccessLogDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *InfraApiAccessLogDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *InfraApiAccessLogDao) Columns() InfraApiAccessLogColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *InfraApiAccessLogDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *InfraApiAccessLogDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// InfraApiErrorLogDao is the data access object for table infra_api_error_log.
|
||||
// InfraApiErrorLogDao is the data access object for the 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 current DAO.
|
||||
columns InfraApiErrorLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// InfraApiErrorLogColumns defines and stores column names for table infra_api_error_log.
|
||||
// InfraApiErrorLogColumns defines and stores column names for the table infra_api_error_log.
|
||||
type InfraApiErrorLogColumns struct {
|
||||
Id string // 编号
|
||||
TraceId string // 链路追踪编号
|
||||
@@ -50,7 +51,7 @@ type InfraApiErrorLogColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// infraApiErrorLogColumns holds the columns for table infra_api_error_log.
|
||||
// infraApiErrorLogColumns holds the columns for the table infra_api_error_log.
|
||||
var infraApiErrorLogColumns = InfraApiErrorLogColumns{
|
||||
Id: "id",
|
||||
TraceId: "trace_id",
|
||||
@@ -83,44 +84,49 @@ var infraApiErrorLogColumns = InfraApiErrorLogColumns{
|
||||
}
|
||||
|
||||
// NewInfraApiErrorLogDao creates and returns a new DAO object for table data access.
|
||||
func NewInfraApiErrorLogDao() *InfraApiErrorLogDao {
|
||||
func NewInfraApiErrorLogDao(handlers ...gdb.ModelHandler) *InfraApiErrorLogDao {
|
||||
return &InfraApiErrorLogDao{
|
||||
group: "default",
|
||||
table: "infra_api_error_log",
|
||||
columns: infraApiErrorLogColumns,
|
||||
group: "default",
|
||||
table: "infra_api_error_log",
|
||||
columns: infraApiErrorLogColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *InfraApiErrorLogDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *InfraApiErrorLogDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *InfraApiErrorLogDao) Columns() InfraApiErrorLogColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *InfraApiErrorLogDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *InfraApiErrorLogDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// InfraCodegenColumnDao is the data access object for table infra_codegen_column.
|
||||
// InfraCodegenColumnDao is the data access object for the 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 current DAO.
|
||||
columns InfraCodegenColumnColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// InfraCodegenColumnColumns defines and stores column names for table infra_codegen_column.
|
||||
// InfraCodegenColumnColumns defines and stores column names for the table infra_codegen_column.
|
||||
type InfraCodegenColumnColumns struct {
|
||||
Id string // 编号
|
||||
TableId string // 表编号
|
||||
@@ -45,7 +46,7 @@ type InfraCodegenColumnColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// infraCodegenColumnColumns holds the columns for table infra_codegen_column.
|
||||
// infraCodegenColumnColumns holds the columns for the table infra_codegen_column.
|
||||
var infraCodegenColumnColumns = InfraCodegenColumnColumns{
|
||||
Id: "id",
|
||||
TableId: "table_id",
|
||||
@@ -73,44 +74,49 @@ var infraCodegenColumnColumns = InfraCodegenColumnColumns{
|
||||
}
|
||||
|
||||
// NewInfraCodegenColumnDao creates and returns a new DAO object for table data access.
|
||||
func NewInfraCodegenColumnDao() *InfraCodegenColumnDao {
|
||||
func NewInfraCodegenColumnDao(handlers ...gdb.ModelHandler) *InfraCodegenColumnDao {
|
||||
return &InfraCodegenColumnDao{
|
||||
group: "default",
|
||||
table: "infra_codegen_column",
|
||||
columns: infraCodegenColumnColumns,
|
||||
group: "default",
|
||||
table: "infra_codegen_column",
|
||||
columns: infraCodegenColumnColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *InfraCodegenColumnDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *InfraCodegenColumnDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *InfraCodegenColumnDao) Columns() InfraCodegenColumnColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *InfraCodegenColumnDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *InfraCodegenColumnDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// InfraCodegenTableDao is the data access object for table infra_codegen_table.
|
||||
// InfraCodegenTableDao is the data access object for the 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 current DAO.
|
||||
columns InfraCodegenTableColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// InfraCodegenTableColumns defines and stores column names for table infra_codegen_table.
|
||||
// InfraCodegenTableColumns defines and stores column names for the table infra_codegen_table.
|
||||
type InfraCodegenTableColumns struct {
|
||||
Id string // 编号
|
||||
DataSourceConfigId string // 数据源配置的编号
|
||||
@@ -46,7 +47,7 @@ type InfraCodegenTableColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// infraCodegenTableColumns holds the columns for table infra_codegen_table.
|
||||
// infraCodegenTableColumns holds the columns for the table infra_codegen_table.
|
||||
var infraCodegenTableColumns = InfraCodegenTableColumns{
|
||||
Id: "id",
|
||||
DataSourceConfigId: "data_source_config_id",
|
||||
@@ -75,44 +76,49 @@ var infraCodegenTableColumns = InfraCodegenTableColumns{
|
||||
}
|
||||
|
||||
// NewInfraCodegenTableDao creates and returns a new DAO object for table data access.
|
||||
func NewInfraCodegenTableDao() *InfraCodegenTableDao {
|
||||
func NewInfraCodegenTableDao(handlers ...gdb.ModelHandler) *InfraCodegenTableDao {
|
||||
return &InfraCodegenTableDao{
|
||||
group: "default",
|
||||
table: "infra_codegen_table",
|
||||
columns: infraCodegenTableColumns,
|
||||
group: "default",
|
||||
table: "infra_codegen_table",
|
||||
columns: infraCodegenTableColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *InfraCodegenTableDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *InfraCodegenTableDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *InfraCodegenTableDao) Columns() InfraCodegenTableColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *InfraCodegenTableDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *InfraCodegenTableDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// InfraConfigDao is the data access object for table infra_config.
|
||||
// InfraConfigDao is the data access object for the 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 current DAO.
|
||||
columns InfraConfigColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// InfraConfigColumns defines and stores column names for table infra_config.
|
||||
// InfraConfigColumns defines and stores column names for the table infra_config.
|
||||
type InfraConfigColumns struct {
|
||||
Id string // 参数主键
|
||||
Category string // 参数分组
|
||||
@@ -35,7 +36,7 @@ type InfraConfigColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// infraConfigColumns holds the columns for table infra_config.
|
||||
// infraConfigColumns holds the columns for the table infra_config.
|
||||
var infraConfigColumns = InfraConfigColumns{
|
||||
Id: "id",
|
||||
Category: "category",
|
||||
@@ -53,44 +54,49 @@ var infraConfigColumns = InfraConfigColumns{
|
||||
}
|
||||
|
||||
// NewInfraConfigDao creates and returns a new DAO object for table data access.
|
||||
func NewInfraConfigDao() *InfraConfigDao {
|
||||
func NewInfraConfigDao(handlers ...gdb.ModelHandler) *InfraConfigDao {
|
||||
return &InfraConfigDao{
|
||||
group: "default",
|
||||
table: "infra_config",
|
||||
columns: infraConfigColumns,
|
||||
group: "default",
|
||||
table: "infra_config",
|
||||
columns: infraConfigColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *InfraConfigDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *InfraConfigDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *InfraConfigDao) Columns() InfraConfigColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *InfraConfigDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *InfraConfigDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// InfraDataSourceConfigDao is the data access object for table infra_data_source_config.
|
||||
// InfraDataSourceConfigDao is the data access object for the 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 current DAO.
|
||||
columns InfraDataSourceConfigColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// InfraDataSourceConfigColumns defines and stores column names for table infra_data_source_config.
|
||||
// InfraDataSourceConfigColumns defines and stores column names for the table infra_data_source_config.
|
||||
type InfraDataSourceConfigColumns struct {
|
||||
Id string // 主键编号
|
||||
Name string // 参数名称
|
||||
@@ -32,7 +33,7 @@ type InfraDataSourceConfigColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// infraDataSourceConfigColumns holds the columns for table infra_data_source_config.
|
||||
// infraDataSourceConfigColumns holds the columns for the table infra_data_source_config.
|
||||
var infraDataSourceConfigColumns = InfraDataSourceConfigColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
@@ -47,44 +48,49 @@ var infraDataSourceConfigColumns = InfraDataSourceConfigColumns{
|
||||
}
|
||||
|
||||
// NewInfraDataSourceConfigDao creates and returns a new DAO object for table data access.
|
||||
func NewInfraDataSourceConfigDao() *InfraDataSourceConfigDao {
|
||||
func NewInfraDataSourceConfigDao(handlers ...gdb.ModelHandler) *InfraDataSourceConfigDao {
|
||||
return &InfraDataSourceConfigDao{
|
||||
group: "default",
|
||||
table: "infra_data_source_config",
|
||||
columns: infraDataSourceConfigColumns,
|
||||
group: "default",
|
||||
table: "infra_data_source_config",
|
||||
columns: infraDataSourceConfigColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *InfraDataSourceConfigDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *InfraDataSourceConfigDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *InfraDataSourceConfigDao) Columns() InfraDataSourceConfigColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *InfraDataSourceConfigDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *InfraDataSourceConfigDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// InfraFileDao is the data access object for table infra_file.
|
||||
// InfraFileDao is the data access object for the 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 current DAO.
|
||||
columns InfraFileColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// InfraFileColumns defines and stores column names for table infra_file.
|
||||
// InfraFileColumns defines and stores column names for the table infra_file.
|
||||
type InfraFileColumns struct {
|
||||
Id string // 文件编号
|
||||
ConfigId string // 配置编号
|
||||
@@ -34,7 +35,7 @@ type InfraFileColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// infraFileColumns holds the columns for table infra_file.
|
||||
// infraFileColumns holds the columns for the table infra_file.
|
||||
var infraFileColumns = InfraFileColumns{
|
||||
Id: "id",
|
||||
ConfigId: "config_id",
|
||||
@@ -51,44 +52,49 @@ var infraFileColumns = InfraFileColumns{
|
||||
}
|
||||
|
||||
// NewInfraFileDao creates and returns a new DAO object for table data access.
|
||||
func NewInfraFileDao() *InfraFileDao {
|
||||
func NewInfraFileDao(handlers ...gdb.ModelHandler) *InfraFileDao {
|
||||
return &InfraFileDao{
|
||||
group: "default",
|
||||
table: "infra_file",
|
||||
columns: infraFileColumns,
|
||||
group: "default",
|
||||
table: "infra_file",
|
||||
columns: infraFileColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *InfraFileDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *InfraFileDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *InfraFileDao) Columns() InfraFileColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *InfraFileDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *InfraFileDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// InfraFileConfigDao is the data access object for table infra_file_config.
|
||||
// InfraFileConfigDao is the data access object for the 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 current DAO.
|
||||
columns InfraFileConfigColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// InfraFileConfigColumns defines and stores column names for table infra_file_config.
|
||||
// InfraFileConfigColumns defines and stores column names for the table infra_file_config.
|
||||
type InfraFileConfigColumns struct {
|
||||
Id string // 编号
|
||||
Name string // 配置名
|
||||
@@ -33,7 +34,7 @@ type InfraFileConfigColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// infraFileConfigColumns holds the columns for table infra_file_config.
|
||||
// infraFileConfigColumns holds the columns for the table infra_file_config.
|
||||
var infraFileConfigColumns = InfraFileConfigColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
@@ -49,44 +50,49 @@ var infraFileConfigColumns = InfraFileConfigColumns{
|
||||
}
|
||||
|
||||
// NewInfraFileConfigDao creates and returns a new DAO object for table data access.
|
||||
func NewInfraFileConfigDao() *InfraFileConfigDao {
|
||||
func NewInfraFileConfigDao(handlers ...gdb.ModelHandler) *InfraFileConfigDao {
|
||||
return &InfraFileConfigDao{
|
||||
group: "default",
|
||||
table: "infra_file_config",
|
||||
columns: infraFileConfigColumns,
|
||||
group: "default",
|
||||
table: "infra_file_config",
|
||||
columns: infraFileConfigColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *InfraFileConfigDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *InfraFileConfigDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *InfraFileConfigDao) Columns() InfraFileConfigColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *InfraFileConfigDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *InfraFileConfigDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// InfraFileContentDao is the data access object for table infra_file_content.
|
||||
// InfraFileContentDao is the data access object for the 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 current DAO.
|
||||
columns InfraFileContentColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// InfraFileContentColumns defines and stores column names for table infra_file_content.
|
||||
// InfraFileContentColumns defines and stores column names for the table infra_file_content.
|
||||
type InfraFileContentColumns struct {
|
||||
Id string // 编号
|
||||
ConfigId string // 配置编号
|
||||
@@ -31,7 +32,7 @@ type InfraFileContentColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// infraFileContentColumns holds the columns for table infra_file_content.
|
||||
// infraFileContentColumns holds the columns for the table infra_file_content.
|
||||
var infraFileContentColumns = InfraFileContentColumns{
|
||||
Id: "id",
|
||||
ConfigId: "config_id",
|
||||
@@ -45,44 +46,49 @@ var infraFileContentColumns = InfraFileContentColumns{
|
||||
}
|
||||
|
||||
// NewInfraFileContentDao creates and returns a new DAO object for table data access.
|
||||
func NewInfraFileContentDao() *InfraFileContentDao {
|
||||
func NewInfraFileContentDao(handlers ...gdb.ModelHandler) *InfraFileContentDao {
|
||||
return &InfraFileContentDao{
|
||||
group: "default",
|
||||
table: "infra_file_content",
|
||||
columns: infraFileContentColumns,
|
||||
group: "default",
|
||||
table: "infra_file_content",
|
||||
columns: infraFileContentColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *InfraFileContentDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *InfraFileContentDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *InfraFileContentDao) Columns() InfraFileContentColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *InfraFileContentDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *InfraFileContentDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// InfraJobDao is the data access object for table infra_job.
|
||||
// InfraJobDao is the data access object for the 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 current DAO.
|
||||
columns InfraJobColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// InfraJobColumns defines and stores column names for table infra_job.
|
||||
// InfraJobColumns defines and stores column names for the table infra_job.
|
||||
type InfraJobColumns struct {
|
||||
Id string // 任务编号
|
||||
Name string // 任务名称
|
||||
@@ -36,7 +37,7 @@ type InfraJobColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// infraJobColumns holds the columns for table infra_job.
|
||||
// infraJobColumns holds the columns for the table infra_job.
|
||||
var infraJobColumns = InfraJobColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
@@ -55,44 +56,49 @@ var infraJobColumns = InfraJobColumns{
|
||||
}
|
||||
|
||||
// NewInfraJobDao creates and returns a new DAO object for table data access.
|
||||
func NewInfraJobDao() *InfraJobDao {
|
||||
func NewInfraJobDao(handlers ...gdb.ModelHandler) *InfraJobDao {
|
||||
return &InfraJobDao{
|
||||
group: "default",
|
||||
table: "infra_job",
|
||||
columns: infraJobColumns,
|
||||
group: "default",
|
||||
table: "infra_job",
|
||||
columns: infraJobColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *InfraJobDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *InfraJobDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *InfraJobDao) Columns() InfraJobColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *InfraJobDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *InfraJobDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// InfraJobLogDao is the data access object for table infra_job_log.
|
||||
// InfraJobLogDao is the data access object for the 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 current DAO.
|
||||
columns InfraJobLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// InfraJobLogColumns defines and stores column names for table infra_job_log.
|
||||
// InfraJobLogColumns defines and stores column names for the table infra_job_log.
|
||||
type InfraJobLogColumns struct {
|
||||
Id string // 日志编号
|
||||
JobId string // 任务编号
|
||||
@@ -37,7 +38,7 @@ type InfraJobLogColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// infraJobLogColumns holds the columns for table infra_job_log.
|
||||
// infraJobLogColumns holds the columns for the table infra_job_log.
|
||||
var infraJobLogColumns = InfraJobLogColumns{
|
||||
Id: "id",
|
||||
JobId: "job_id",
|
||||
@@ -57,44 +58,49 @@ var infraJobLogColumns = InfraJobLogColumns{
|
||||
}
|
||||
|
||||
// NewInfraJobLogDao creates and returns a new DAO object for table data access.
|
||||
func NewInfraJobLogDao() *InfraJobLogDao {
|
||||
func NewInfraJobLogDao(handlers ...gdb.ModelHandler) *InfraJobLogDao {
|
||||
return &InfraJobLogDao{
|
||||
group: "default",
|
||||
table: "infra_job_log",
|
||||
columns: infraJobLogColumns,
|
||||
group: "default",
|
||||
table: "infra_job_log",
|
||||
columns: infraJobLogColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *InfraJobLogDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *InfraJobLogDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *InfraJobLogDao) Columns() InfraJobLogColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *InfraJobLogDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *InfraJobLogDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// QrtzBlobTriggersDao is the data access object for table qrtz_blob_triggers.
|
||||
// QrtzBlobTriggersDao is the data access object for the 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 current DAO.
|
||||
columns QrtzBlobTriggersColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// QrtzBlobTriggersColumns defines and stores column names for table qrtz_blob_triggers.
|
||||
// QrtzBlobTriggersColumns defines and stores column names for the table qrtz_blob_triggers.
|
||||
type QrtzBlobTriggersColumns struct {
|
||||
SchedName string //
|
||||
TriggerName string //
|
||||
@@ -26,7 +27,7 @@ type QrtzBlobTriggersColumns struct {
|
||||
BlobData string //
|
||||
}
|
||||
|
||||
// qrtzBlobTriggersColumns holds the columns for table qrtz_blob_triggers.
|
||||
// qrtzBlobTriggersColumns holds the columns for the table qrtz_blob_triggers.
|
||||
var qrtzBlobTriggersColumns = QrtzBlobTriggersColumns{
|
||||
SchedName: "SCHED_NAME",
|
||||
TriggerName: "TRIGGER_NAME",
|
||||
@@ -35,44 +36,49 @@ var qrtzBlobTriggersColumns = QrtzBlobTriggersColumns{
|
||||
}
|
||||
|
||||
// NewQrtzBlobTriggersDao creates and returns a new DAO object for table data access.
|
||||
func NewQrtzBlobTriggersDao() *QrtzBlobTriggersDao {
|
||||
func NewQrtzBlobTriggersDao(handlers ...gdb.ModelHandler) *QrtzBlobTriggersDao {
|
||||
return &QrtzBlobTriggersDao{
|
||||
group: "default",
|
||||
table: "qrtz_blob_triggers",
|
||||
columns: qrtzBlobTriggersColumns,
|
||||
group: "default",
|
||||
table: "qrtz_blob_triggers",
|
||||
columns: qrtzBlobTriggersColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *QrtzBlobTriggersDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *QrtzBlobTriggersDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *QrtzBlobTriggersDao) Columns() QrtzBlobTriggersColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *QrtzBlobTriggersDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *QrtzBlobTriggersDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,21 +11,22 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// QrtzCalendarsDao is the data access object for table qrtz_calendars.
|
||||
// QrtzCalendarsDao is the data access object for the 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 current DAO.
|
||||
columns QrtzCalendarsColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// QrtzCalendarsColumns defines and stores column names for table qrtz_calendars.
|
||||
// QrtzCalendarsColumns defines and stores column names for the table qrtz_calendars.
|
||||
type QrtzCalendarsColumns struct {
|
||||
SchedName string //
|
||||
CalendarName string //
|
||||
Calendar string //
|
||||
}
|
||||
|
||||
// qrtzCalendarsColumns holds the columns for table qrtz_calendars.
|
||||
// qrtzCalendarsColumns holds the columns for the table qrtz_calendars.
|
||||
var qrtzCalendarsColumns = QrtzCalendarsColumns{
|
||||
SchedName: "SCHED_NAME",
|
||||
CalendarName: "CALENDAR_NAME",
|
||||
@@ -33,44 +34,49 @@ var qrtzCalendarsColumns = QrtzCalendarsColumns{
|
||||
}
|
||||
|
||||
// NewQrtzCalendarsDao creates and returns a new DAO object for table data access.
|
||||
func NewQrtzCalendarsDao() *QrtzCalendarsDao {
|
||||
func NewQrtzCalendarsDao(handlers ...gdb.ModelHandler) *QrtzCalendarsDao {
|
||||
return &QrtzCalendarsDao{
|
||||
group: "default",
|
||||
table: "qrtz_calendars",
|
||||
columns: qrtzCalendarsColumns,
|
||||
group: "default",
|
||||
table: "qrtz_calendars",
|
||||
columns: qrtzCalendarsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *QrtzCalendarsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *QrtzCalendarsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *QrtzCalendarsDao) Columns() QrtzCalendarsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *QrtzCalendarsDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *QrtzCalendarsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// QrtzCronTriggersDao is the data access object for table qrtz_cron_triggers.
|
||||
// QrtzCronTriggersDao is the data access object for the 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 current DAO.
|
||||
columns QrtzCronTriggersColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// QrtzCronTriggersColumns defines and stores column names for table qrtz_cron_triggers.
|
||||
// QrtzCronTriggersColumns defines and stores column names for the table qrtz_cron_triggers.
|
||||
type QrtzCronTriggersColumns struct {
|
||||
SchedName string //
|
||||
TriggerName string //
|
||||
@@ -27,7 +28,7 @@ type QrtzCronTriggersColumns struct {
|
||||
TimeZoneId string //
|
||||
}
|
||||
|
||||
// qrtzCronTriggersColumns holds the columns for table qrtz_cron_triggers.
|
||||
// qrtzCronTriggersColumns holds the columns for the table qrtz_cron_triggers.
|
||||
var qrtzCronTriggersColumns = QrtzCronTriggersColumns{
|
||||
SchedName: "SCHED_NAME",
|
||||
TriggerName: "TRIGGER_NAME",
|
||||
@@ -37,44 +38,49 @@ var qrtzCronTriggersColumns = QrtzCronTriggersColumns{
|
||||
}
|
||||
|
||||
// NewQrtzCronTriggersDao creates and returns a new DAO object for table data access.
|
||||
func NewQrtzCronTriggersDao() *QrtzCronTriggersDao {
|
||||
func NewQrtzCronTriggersDao(handlers ...gdb.ModelHandler) *QrtzCronTriggersDao {
|
||||
return &QrtzCronTriggersDao{
|
||||
group: "default",
|
||||
table: "qrtz_cron_triggers",
|
||||
columns: qrtzCronTriggersColumns,
|
||||
group: "default",
|
||||
table: "qrtz_cron_triggers",
|
||||
columns: qrtzCronTriggersColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *QrtzCronTriggersDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *QrtzCronTriggersDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *QrtzCronTriggersDao) Columns() QrtzCronTriggersColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *QrtzCronTriggersDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *QrtzCronTriggersDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// QrtzFiredTriggersDao is the data access object for table qrtz_fired_triggers.
|
||||
// QrtzFiredTriggersDao is the data access object for the 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 current DAO.
|
||||
columns QrtzFiredTriggersColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// QrtzFiredTriggersColumns defines and stores column names for table qrtz_fired_triggers.
|
||||
// QrtzFiredTriggersColumns defines and stores column names for the table qrtz_fired_triggers.
|
||||
type QrtzFiredTriggersColumns struct {
|
||||
SchedName string //
|
||||
EntryId string //
|
||||
@@ -35,7 +36,7 @@ type QrtzFiredTriggersColumns struct {
|
||||
RequestsRecovery string //
|
||||
}
|
||||
|
||||
// qrtzFiredTriggersColumns holds the columns for table qrtz_fired_triggers.
|
||||
// qrtzFiredTriggersColumns holds the columns for the table qrtz_fired_triggers.
|
||||
var qrtzFiredTriggersColumns = QrtzFiredTriggersColumns{
|
||||
SchedName: "SCHED_NAME",
|
||||
EntryId: "ENTRY_ID",
|
||||
@@ -53,44 +54,49 @@ var qrtzFiredTriggersColumns = QrtzFiredTriggersColumns{
|
||||
}
|
||||
|
||||
// NewQrtzFiredTriggersDao creates and returns a new DAO object for table data access.
|
||||
func NewQrtzFiredTriggersDao() *QrtzFiredTriggersDao {
|
||||
func NewQrtzFiredTriggersDao(handlers ...gdb.ModelHandler) *QrtzFiredTriggersDao {
|
||||
return &QrtzFiredTriggersDao{
|
||||
group: "default",
|
||||
table: "qrtz_fired_triggers",
|
||||
columns: qrtzFiredTriggersColumns,
|
||||
group: "default",
|
||||
table: "qrtz_fired_triggers",
|
||||
columns: qrtzFiredTriggersColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *QrtzFiredTriggersDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *QrtzFiredTriggersDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *QrtzFiredTriggersDao) Columns() QrtzFiredTriggersColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *QrtzFiredTriggersDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *QrtzFiredTriggersDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// QrtzJobDetailsDao is the data access object for table qrtz_job_details.
|
||||
// QrtzJobDetailsDao is the data access object for the 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 current DAO.
|
||||
columns QrtzJobDetailsColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// QrtzJobDetailsColumns defines and stores column names for table qrtz_job_details.
|
||||
// QrtzJobDetailsColumns defines and stores column names for the table qrtz_job_details.
|
||||
type QrtzJobDetailsColumns struct {
|
||||
SchedName string //
|
||||
JobName string //
|
||||
@@ -32,7 +33,7 @@ type QrtzJobDetailsColumns struct {
|
||||
JobData string //
|
||||
}
|
||||
|
||||
// qrtzJobDetailsColumns holds the columns for table qrtz_job_details.
|
||||
// qrtzJobDetailsColumns holds the columns for the table qrtz_job_details.
|
||||
var qrtzJobDetailsColumns = QrtzJobDetailsColumns{
|
||||
SchedName: "SCHED_NAME",
|
||||
JobName: "JOB_NAME",
|
||||
@@ -47,44 +48,49 @@ var qrtzJobDetailsColumns = QrtzJobDetailsColumns{
|
||||
}
|
||||
|
||||
// NewQrtzJobDetailsDao creates and returns a new DAO object for table data access.
|
||||
func NewQrtzJobDetailsDao() *QrtzJobDetailsDao {
|
||||
func NewQrtzJobDetailsDao(handlers ...gdb.ModelHandler) *QrtzJobDetailsDao {
|
||||
return &QrtzJobDetailsDao{
|
||||
group: "default",
|
||||
table: "qrtz_job_details",
|
||||
columns: qrtzJobDetailsColumns,
|
||||
group: "default",
|
||||
table: "qrtz_job_details",
|
||||
columns: qrtzJobDetailsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *QrtzJobDetailsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *QrtzJobDetailsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *QrtzJobDetailsDao) Columns() QrtzJobDetailsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *QrtzJobDetailsDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *QrtzJobDetailsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,64 +11,70 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// QrtzLocksDao is the data access object for table qrtz_locks.
|
||||
// QrtzLocksDao is the data access object for the 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 current DAO.
|
||||
columns QrtzLocksColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// QrtzLocksColumns defines and stores column names for table qrtz_locks.
|
||||
// QrtzLocksColumns defines and stores column names for the table qrtz_locks.
|
||||
type QrtzLocksColumns struct {
|
||||
SchedName string //
|
||||
LockName string //
|
||||
}
|
||||
|
||||
// qrtzLocksColumns holds the columns for table qrtz_locks.
|
||||
// qrtzLocksColumns holds the columns for the 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() *QrtzLocksDao {
|
||||
func NewQrtzLocksDao(handlers ...gdb.ModelHandler) *QrtzLocksDao {
|
||||
return &QrtzLocksDao{
|
||||
group: "default",
|
||||
table: "qrtz_locks",
|
||||
columns: qrtzLocksColumns,
|
||||
group: "default",
|
||||
table: "qrtz_locks",
|
||||
columns: qrtzLocksColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *QrtzLocksDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *QrtzLocksDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *QrtzLocksDao) Columns() QrtzLocksColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *QrtzLocksDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *QrtzLocksDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,64 +11,70 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// QrtzPausedTriggerGrpsDao is the data access object for table qrtz_paused_trigger_grps.
|
||||
// QrtzPausedTriggerGrpsDao is the data access object for the 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 current DAO.
|
||||
columns QrtzPausedTriggerGrpsColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// QrtzPausedTriggerGrpsColumns defines and stores column names for table qrtz_paused_trigger_grps.
|
||||
// QrtzPausedTriggerGrpsColumns defines and stores column names for the table qrtz_paused_trigger_grps.
|
||||
type QrtzPausedTriggerGrpsColumns struct {
|
||||
SchedName string //
|
||||
TriggerGroup string //
|
||||
}
|
||||
|
||||
// qrtzPausedTriggerGrpsColumns holds the columns for table qrtz_paused_trigger_grps.
|
||||
// qrtzPausedTriggerGrpsColumns holds the columns for the 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() *QrtzPausedTriggerGrpsDao {
|
||||
func NewQrtzPausedTriggerGrpsDao(handlers ...gdb.ModelHandler) *QrtzPausedTriggerGrpsDao {
|
||||
return &QrtzPausedTriggerGrpsDao{
|
||||
group: "default",
|
||||
table: "qrtz_paused_trigger_grps",
|
||||
columns: qrtzPausedTriggerGrpsColumns,
|
||||
group: "default",
|
||||
table: "qrtz_paused_trigger_grps",
|
||||
columns: qrtzPausedTriggerGrpsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *QrtzPausedTriggerGrpsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *QrtzPausedTriggerGrpsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *QrtzPausedTriggerGrpsDao) Columns() QrtzPausedTriggerGrpsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *QrtzPausedTriggerGrpsDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *QrtzPausedTriggerGrpsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// QrtzSchedulerStateDao is the data access object for table qrtz_scheduler_state.
|
||||
// QrtzSchedulerStateDao is the data access object for the 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 current DAO.
|
||||
columns QrtzSchedulerStateColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// QrtzSchedulerStateColumns defines and stores column names for table qrtz_scheduler_state.
|
||||
// QrtzSchedulerStateColumns defines and stores column names for the table qrtz_scheduler_state.
|
||||
type QrtzSchedulerStateColumns struct {
|
||||
SchedName string //
|
||||
InstanceName string //
|
||||
@@ -26,7 +27,7 @@ type QrtzSchedulerStateColumns struct {
|
||||
CheckinInterval string //
|
||||
}
|
||||
|
||||
// qrtzSchedulerStateColumns holds the columns for table qrtz_scheduler_state.
|
||||
// qrtzSchedulerStateColumns holds the columns for the table qrtz_scheduler_state.
|
||||
var qrtzSchedulerStateColumns = QrtzSchedulerStateColumns{
|
||||
SchedName: "SCHED_NAME",
|
||||
InstanceName: "INSTANCE_NAME",
|
||||
@@ -35,44 +36,49 @@ var qrtzSchedulerStateColumns = QrtzSchedulerStateColumns{
|
||||
}
|
||||
|
||||
// NewQrtzSchedulerStateDao creates and returns a new DAO object for table data access.
|
||||
func NewQrtzSchedulerStateDao() *QrtzSchedulerStateDao {
|
||||
func NewQrtzSchedulerStateDao(handlers ...gdb.ModelHandler) *QrtzSchedulerStateDao {
|
||||
return &QrtzSchedulerStateDao{
|
||||
group: "default",
|
||||
table: "qrtz_scheduler_state",
|
||||
columns: qrtzSchedulerStateColumns,
|
||||
group: "default",
|
||||
table: "qrtz_scheduler_state",
|
||||
columns: qrtzSchedulerStateColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *QrtzSchedulerStateDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *QrtzSchedulerStateDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *QrtzSchedulerStateDao) Columns() QrtzSchedulerStateColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *QrtzSchedulerStateDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *QrtzSchedulerStateDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// QrtzSimpleTriggersDao is the data access object for table qrtz_simple_triggers.
|
||||
// QrtzSimpleTriggersDao is the data access object for the 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 current DAO.
|
||||
columns QrtzSimpleTriggersColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// QrtzSimpleTriggersColumns defines and stores column names for table qrtz_simple_triggers.
|
||||
// QrtzSimpleTriggersColumns defines and stores column names for the table qrtz_simple_triggers.
|
||||
type QrtzSimpleTriggersColumns struct {
|
||||
SchedName string //
|
||||
TriggerName string //
|
||||
@@ -28,7 +29,7 @@ type QrtzSimpleTriggersColumns struct {
|
||||
TimesTriggered string //
|
||||
}
|
||||
|
||||
// qrtzSimpleTriggersColumns holds the columns for table qrtz_simple_triggers.
|
||||
// qrtzSimpleTriggersColumns holds the columns for the table qrtz_simple_triggers.
|
||||
var qrtzSimpleTriggersColumns = QrtzSimpleTriggersColumns{
|
||||
SchedName: "SCHED_NAME",
|
||||
TriggerName: "TRIGGER_NAME",
|
||||
@@ -39,44 +40,49 @@ var qrtzSimpleTriggersColumns = QrtzSimpleTriggersColumns{
|
||||
}
|
||||
|
||||
// NewQrtzSimpleTriggersDao creates and returns a new DAO object for table data access.
|
||||
func NewQrtzSimpleTriggersDao() *QrtzSimpleTriggersDao {
|
||||
func NewQrtzSimpleTriggersDao(handlers ...gdb.ModelHandler) *QrtzSimpleTriggersDao {
|
||||
return &QrtzSimpleTriggersDao{
|
||||
group: "default",
|
||||
table: "qrtz_simple_triggers",
|
||||
columns: qrtzSimpleTriggersColumns,
|
||||
group: "default",
|
||||
table: "qrtz_simple_triggers",
|
||||
columns: qrtzSimpleTriggersColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *QrtzSimpleTriggersDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *QrtzSimpleTriggersDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *QrtzSimpleTriggersDao) Columns() QrtzSimpleTriggersColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *QrtzSimpleTriggersDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *QrtzSimpleTriggersDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// QrtzSimpropTriggersDao is the data access object for table qrtz_simprop_triggers.
|
||||
// QrtzSimpropTriggersDao is the data access object for the 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 current DAO.
|
||||
columns QrtzSimpropTriggersColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// QrtzSimpropTriggersColumns defines and stores column names for table qrtz_simprop_triggers.
|
||||
// QrtzSimpropTriggersColumns defines and stores column names for the table qrtz_simprop_triggers.
|
||||
type QrtzSimpropTriggersColumns struct {
|
||||
SchedName string //
|
||||
TriggerName string //
|
||||
@@ -36,7 +37,7 @@ type QrtzSimpropTriggersColumns struct {
|
||||
BoolProp2 string //
|
||||
}
|
||||
|
||||
// qrtzSimpropTriggersColumns holds the columns for table qrtz_simprop_triggers.
|
||||
// qrtzSimpropTriggersColumns holds the columns for the table qrtz_simprop_triggers.
|
||||
var qrtzSimpropTriggersColumns = QrtzSimpropTriggersColumns{
|
||||
SchedName: "SCHED_NAME",
|
||||
TriggerName: "TRIGGER_NAME",
|
||||
@@ -55,44 +56,49 @@ var qrtzSimpropTriggersColumns = QrtzSimpropTriggersColumns{
|
||||
}
|
||||
|
||||
// NewQrtzSimpropTriggersDao creates and returns a new DAO object for table data access.
|
||||
func NewQrtzSimpropTriggersDao() *QrtzSimpropTriggersDao {
|
||||
func NewQrtzSimpropTriggersDao(handlers ...gdb.ModelHandler) *QrtzSimpropTriggersDao {
|
||||
return &QrtzSimpropTriggersDao{
|
||||
group: "default",
|
||||
table: "qrtz_simprop_triggers",
|
||||
columns: qrtzSimpropTriggersColumns,
|
||||
group: "default",
|
||||
table: "qrtz_simprop_triggers",
|
||||
columns: qrtzSimpropTriggersColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *QrtzSimpropTriggersDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *QrtzSimpropTriggersDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *QrtzSimpropTriggersDao) Columns() QrtzSimpropTriggersColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *QrtzSimpropTriggersDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *QrtzSimpropTriggersDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// QrtzTriggersDao is the data access object for table qrtz_triggers.
|
||||
// QrtzTriggersDao is the data access object for the 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 current DAO.
|
||||
columns QrtzTriggersColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// QrtzTriggersColumns defines and stores column names for table qrtz_triggers.
|
||||
// QrtzTriggersColumns defines and stores column names for the table qrtz_triggers.
|
||||
type QrtzTriggersColumns struct {
|
||||
SchedName string //
|
||||
TriggerName string //
|
||||
@@ -38,7 +39,7 @@ type QrtzTriggersColumns struct {
|
||||
JobData string //
|
||||
}
|
||||
|
||||
// qrtzTriggersColumns holds the columns for table qrtz_triggers.
|
||||
// qrtzTriggersColumns holds the columns for the table qrtz_triggers.
|
||||
var qrtzTriggersColumns = QrtzTriggersColumns{
|
||||
SchedName: "SCHED_NAME",
|
||||
TriggerName: "TRIGGER_NAME",
|
||||
@@ -59,44 +60,49 @@ var qrtzTriggersColumns = QrtzTriggersColumns{
|
||||
}
|
||||
|
||||
// NewQrtzTriggersDao creates and returns a new DAO object for table data access.
|
||||
func NewQrtzTriggersDao() *QrtzTriggersDao {
|
||||
func NewQrtzTriggersDao(handlers ...gdb.ModelHandler) *QrtzTriggersDao {
|
||||
return &QrtzTriggersDao{
|
||||
group: "default",
|
||||
table: "qrtz_triggers",
|
||||
columns: qrtzTriggersColumns,
|
||||
group: "default",
|
||||
table: "qrtz_triggers",
|
||||
columns: qrtzTriggersColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *QrtzTriggersDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *QrtzTriggersDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *QrtzTriggersDao) Columns() QrtzTriggersColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *QrtzTriggersDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *QrtzTriggersDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemDeptDao is the data access object for table system_dept.
|
||||
// SystemDeptDao is the data access object for the 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 current DAO.
|
||||
columns SystemDeptColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemDeptColumns defines and stores column names for table system_dept.
|
||||
// SystemDeptColumns defines and stores column names for the table system_dept.
|
||||
type SystemDeptColumns struct {
|
||||
Id string // 部门id
|
||||
Name string // 部门名称
|
||||
@@ -36,7 +37,7 @@ type SystemDeptColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemDeptColumns holds the columns for table system_dept.
|
||||
// systemDeptColumns holds the columns for the table system_dept.
|
||||
var systemDeptColumns = SystemDeptColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
@@ -55,44 +56,49 @@ var systemDeptColumns = SystemDeptColumns{
|
||||
}
|
||||
|
||||
// NewSystemDeptDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemDeptDao() *SystemDeptDao {
|
||||
func NewSystemDeptDao(handlers ...gdb.ModelHandler) *SystemDeptDao {
|
||||
return &SystemDeptDao{
|
||||
group: "default",
|
||||
table: "system_dept",
|
||||
columns: systemDeptColumns,
|
||||
group: "default",
|
||||
table: "system_dept",
|
||||
columns: systemDeptColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemDeptDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemDeptDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemDeptDao) Columns() SystemDeptColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemDeptDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemDeptDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemDictDataDao is the data access object for table system_dict_data.
|
||||
// SystemDictDataDao is the data access object for the 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 current DAO.
|
||||
columns SystemDictDataColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemDictDataColumns defines and stores column names for table system_dict_data.
|
||||
// SystemDictDataColumns defines and stores column names for the table system_dict_data.
|
||||
type SystemDictDataColumns struct {
|
||||
Id string // 字典编码
|
||||
Sort string // 字典排序
|
||||
@@ -36,7 +37,7 @@ type SystemDictDataColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// systemDictDataColumns holds the columns for table system_dict_data.
|
||||
// systemDictDataColumns holds the columns for the table system_dict_data.
|
||||
var systemDictDataColumns = SystemDictDataColumns{
|
||||
Id: "id",
|
||||
Sort: "sort",
|
||||
@@ -55,44 +56,49 @@ var systemDictDataColumns = SystemDictDataColumns{
|
||||
}
|
||||
|
||||
// NewSystemDictDataDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemDictDataDao() *SystemDictDataDao {
|
||||
func NewSystemDictDataDao(handlers ...gdb.ModelHandler) *SystemDictDataDao {
|
||||
return &SystemDictDataDao{
|
||||
group: "default",
|
||||
table: "system_dict_data",
|
||||
columns: systemDictDataColumns,
|
||||
group: "default",
|
||||
table: "system_dict_data",
|
||||
columns: systemDictDataColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemDictDataDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemDictDataDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemDictDataDao) Columns() SystemDictDataColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemDictDataDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemDictDataDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemDictTypeDao is the data access object for table system_dict_type.
|
||||
// SystemDictTypeDao is the data access object for the 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 current DAO.
|
||||
columns SystemDictTypeColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemDictTypeColumns defines and stores column names for table system_dict_type.
|
||||
// SystemDictTypeColumns defines and stores column names for the table system_dict_type.
|
||||
type SystemDictTypeColumns struct {
|
||||
Id string // 字典主键
|
||||
Name string // 字典名称
|
||||
@@ -33,7 +34,7 @@ type SystemDictTypeColumns struct {
|
||||
DeletedTime string // 删除时间
|
||||
}
|
||||
|
||||
// systemDictTypeColumns holds the columns for table system_dict_type.
|
||||
// systemDictTypeColumns holds the columns for the table system_dict_type.
|
||||
var systemDictTypeColumns = SystemDictTypeColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
@@ -49,44 +50,49 @@ var systemDictTypeColumns = SystemDictTypeColumns{
|
||||
}
|
||||
|
||||
// NewSystemDictTypeDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemDictTypeDao() *SystemDictTypeDao {
|
||||
func NewSystemDictTypeDao(handlers ...gdb.ModelHandler) *SystemDictTypeDao {
|
||||
return &SystemDictTypeDao{
|
||||
group: "default",
|
||||
table: "system_dict_type",
|
||||
columns: systemDictTypeColumns,
|
||||
group: "default",
|
||||
table: "system_dict_type",
|
||||
columns: systemDictTypeColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemDictTypeDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemDictTypeDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemDictTypeDao) Columns() SystemDictTypeColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemDictTypeDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemDictTypeDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemLoginLogDao is the data access object for table system_login_log.
|
||||
// SystemLoginLogDao is the data access object for the 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 current DAO.
|
||||
columns SystemLoginLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemLoginLogColumns defines and stores column names for table system_login_log.
|
||||
// SystemLoginLogColumns defines and stores column names for the table system_login_log.
|
||||
type SystemLoginLogColumns struct {
|
||||
Id string // 访问ID
|
||||
LogType string // 日志类型
|
||||
@@ -37,7 +38,7 @@ type SystemLoginLogColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemLoginLogColumns holds the columns for table system_login_log.
|
||||
// systemLoginLogColumns holds the columns for the table system_login_log.
|
||||
var systemLoginLogColumns = SystemLoginLogColumns{
|
||||
Id: "id",
|
||||
LogType: "log_type",
|
||||
@@ -57,44 +58,49 @@ var systemLoginLogColumns = SystemLoginLogColumns{
|
||||
}
|
||||
|
||||
// NewSystemLoginLogDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemLoginLogDao() *SystemLoginLogDao {
|
||||
func NewSystemLoginLogDao(handlers ...gdb.ModelHandler) *SystemLoginLogDao {
|
||||
return &SystemLoginLogDao{
|
||||
group: "default",
|
||||
table: "system_login_log",
|
||||
columns: systemLoginLogColumns,
|
||||
group: "default",
|
||||
table: "system_login_log",
|
||||
columns: systemLoginLogColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemLoginLogDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemLoginLogDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemLoginLogDao) Columns() SystemLoginLogColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemLoginLogDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemLoginLogDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemMailAccountDao is the data access object for table system_mail_account.
|
||||
// SystemMailAccountDao is the data access object for the 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 current DAO.
|
||||
columns SystemMailAccountColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemMailAccountColumns defines and stores column names for table system_mail_account.
|
||||
// SystemMailAccountColumns defines and stores column names for the table system_mail_account.
|
||||
type SystemMailAccountColumns struct {
|
||||
Id string // 主键
|
||||
Mail string // 邮箱
|
||||
@@ -35,7 +36,7 @@ type SystemMailAccountColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// systemMailAccountColumns holds the columns for table system_mail_account.
|
||||
// systemMailAccountColumns holds the columns for the table system_mail_account.
|
||||
var systemMailAccountColumns = SystemMailAccountColumns{
|
||||
Id: "id",
|
||||
Mail: "mail",
|
||||
@@ -53,44 +54,49 @@ var systemMailAccountColumns = SystemMailAccountColumns{
|
||||
}
|
||||
|
||||
// NewSystemMailAccountDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemMailAccountDao() *SystemMailAccountDao {
|
||||
func NewSystemMailAccountDao(handlers ...gdb.ModelHandler) *SystemMailAccountDao {
|
||||
return &SystemMailAccountDao{
|
||||
group: "default",
|
||||
table: "system_mail_account",
|
||||
columns: systemMailAccountColumns,
|
||||
group: "default",
|
||||
table: "system_mail_account",
|
||||
columns: systemMailAccountColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemMailAccountDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemMailAccountDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemMailAccountDao) Columns() SystemMailAccountColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemMailAccountDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemMailAccountDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemMailLogDao is the data access object for table system_mail_log.
|
||||
// SystemMailLogDao is the data access object for the 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 current DAO.
|
||||
columns SystemMailLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemMailLogColumns defines and stores column names for table system_mail_log.
|
||||
// SystemMailLogColumns defines and stores column names for the table system_mail_log.
|
||||
type SystemMailLogColumns struct {
|
||||
Id string // 编号
|
||||
UserId string // 用户编号
|
||||
@@ -43,7 +44,7 @@ type SystemMailLogColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// systemMailLogColumns holds the columns for table system_mail_log.
|
||||
// systemMailLogColumns holds the columns for the table system_mail_log.
|
||||
var systemMailLogColumns = SystemMailLogColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
@@ -69,44 +70,49 @@ var systemMailLogColumns = SystemMailLogColumns{
|
||||
}
|
||||
|
||||
// NewSystemMailLogDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemMailLogDao() *SystemMailLogDao {
|
||||
func NewSystemMailLogDao(handlers ...gdb.ModelHandler) *SystemMailLogDao {
|
||||
return &SystemMailLogDao{
|
||||
group: "default",
|
||||
table: "system_mail_log",
|
||||
columns: systemMailLogColumns,
|
||||
group: "default",
|
||||
table: "system_mail_log",
|
||||
columns: systemMailLogColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemMailLogDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemMailLogDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemMailLogDao) Columns() SystemMailLogColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemMailLogDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemMailLogDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemMailTemplateDao is the data access object for table system_mail_template.
|
||||
// SystemMailTemplateDao is the data access object for the 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 current DAO.
|
||||
columns SystemMailTemplateColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemMailTemplateColumns defines and stores column names for table system_mail_template.
|
||||
// SystemMailTemplateColumns defines and stores column names for the table system_mail_template.
|
||||
type SystemMailTemplateColumns struct {
|
||||
Id string // 编号
|
||||
Name string // 模板名称
|
||||
@@ -37,7 +38,7 @@ type SystemMailTemplateColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// systemMailTemplateColumns holds the columns for table system_mail_template.
|
||||
// systemMailTemplateColumns holds the columns for the table system_mail_template.
|
||||
var systemMailTemplateColumns = SystemMailTemplateColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
@@ -57,44 +58,49 @@ var systemMailTemplateColumns = SystemMailTemplateColumns{
|
||||
}
|
||||
|
||||
// NewSystemMailTemplateDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemMailTemplateDao() *SystemMailTemplateDao {
|
||||
func NewSystemMailTemplateDao(handlers ...gdb.ModelHandler) *SystemMailTemplateDao {
|
||||
return &SystemMailTemplateDao{
|
||||
group: "default",
|
||||
table: "system_mail_template",
|
||||
columns: systemMailTemplateColumns,
|
||||
group: "default",
|
||||
table: "system_mail_template",
|
||||
columns: systemMailTemplateColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemMailTemplateDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemMailTemplateDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemMailTemplateDao) Columns() SystemMailTemplateColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemMailTemplateDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemMailTemplateDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemMenuDao is the data access object for table system_menu.
|
||||
// SystemMenuDao is the data access object for the 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 current DAO.
|
||||
columns SystemMenuColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemMenuColumns defines and stores column names for table system_menu.
|
||||
// SystemMenuColumns defines and stores column names for the table system_menu.
|
||||
type SystemMenuColumns struct {
|
||||
Id string // 菜单ID
|
||||
Name string // 菜单名称
|
||||
@@ -41,7 +42,7 @@ type SystemMenuColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// systemMenuColumns holds the columns for table system_menu.
|
||||
// systemMenuColumns holds the columns for the table system_menu.
|
||||
var systemMenuColumns = SystemMenuColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
@@ -65,44 +66,49 @@ var systemMenuColumns = SystemMenuColumns{
|
||||
}
|
||||
|
||||
// NewSystemMenuDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemMenuDao() *SystemMenuDao {
|
||||
func NewSystemMenuDao(handlers ...gdb.ModelHandler) *SystemMenuDao {
|
||||
return &SystemMenuDao{
|
||||
group: "default",
|
||||
table: "system_menu",
|
||||
columns: systemMenuColumns,
|
||||
group: "default",
|
||||
table: "system_menu",
|
||||
columns: systemMenuColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemMenuDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemMenuDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemMenuDao) Columns() SystemMenuColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemMenuDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemMenuDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemNoticeDao is the data access object for table system_notice.
|
||||
// SystemNoticeDao is the data access object for the 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 current DAO.
|
||||
columns SystemNoticeColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemNoticeColumns defines and stores column names for table system_notice.
|
||||
// SystemNoticeColumns defines and stores column names for the table system_notice.
|
||||
type SystemNoticeColumns struct {
|
||||
Id string // 公告ID
|
||||
Title string // 公告标题
|
||||
@@ -33,7 +34,7 @@ type SystemNoticeColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemNoticeColumns holds the columns for table system_notice.
|
||||
// systemNoticeColumns holds the columns for the table system_notice.
|
||||
var systemNoticeColumns = SystemNoticeColumns{
|
||||
Id: "id",
|
||||
Title: "title",
|
||||
@@ -49,44 +50,49 @@ var systemNoticeColumns = SystemNoticeColumns{
|
||||
}
|
||||
|
||||
// NewSystemNoticeDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemNoticeDao() *SystemNoticeDao {
|
||||
func NewSystemNoticeDao(handlers ...gdb.ModelHandler) *SystemNoticeDao {
|
||||
return &SystemNoticeDao{
|
||||
group: "default",
|
||||
table: "system_notice",
|
||||
columns: systemNoticeColumns,
|
||||
group: "default",
|
||||
table: "system_notice",
|
||||
columns: systemNoticeColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemNoticeDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemNoticeDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemNoticeDao) Columns() SystemNoticeColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemNoticeDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemNoticeDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemNotifyMessageDao is the data access object for table system_notify_message.
|
||||
// SystemNotifyMessageDao is the data access object for the 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 current DAO.
|
||||
columns SystemNotifyMessageColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemNotifyMessageColumns defines and stores column names for table system_notify_message.
|
||||
// SystemNotifyMessageColumns defines and stores column names for the table system_notify_message.
|
||||
type SystemNotifyMessageColumns struct {
|
||||
Id string // 用户ID
|
||||
UserId string // 用户id
|
||||
@@ -39,7 +40,7 @@ type SystemNotifyMessageColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemNotifyMessageColumns holds the columns for table system_notify_message.
|
||||
// systemNotifyMessageColumns holds the columns for the table system_notify_message.
|
||||
var systemNotifyMessageColumns = SystemNotifyMessageColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
@@ -61,44 +62,49 @@ var systemNotifyMessageColumns = SystemNotifyMessageColumns{
|
||||
}
|
||||
|
||||
// NewSystemNotifyMessageDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemNotifyMessageDao() *SystemNotifyMessageDao {
|
||||
func NewSystemNotifyMessageDao(handlers ...gdb.ModelHandler) *SystemNotifyMessageDao {
|
||||
return &SystemNotifyMessageDao{
|
||||
group: "default",
|
||||
table: "system_notify_message",
|
||||
columns: systemNotifyMessageColumns,
|
||||
group: "default",
|
||||
table: "system_notify_message",
|
||||
columns: systemNotifyMessageColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemNotifyMessageDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemNotifyMessageDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemNotifyMessageDao) Columns() SystemNotifyMessageColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemNotifyMessageDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemNotifyMessageDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemNotifyTemplateDao is the data access object for table system_notify_template.
|
||||
// SystemNotifyTemplateDao is the data access object for the 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 current DAO.
|
||||
columns SystemNotifyTemplateColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemNotifyTemplateColumns defines and stores column names for table system_notify_template.
|
||||
// SystemNotifyTemplateColumns defines and stores column names for the table system_notify_template.
|
||||
type SystemNotifyTemplateColumns struct {
|
||||
Id string // 主键
|
||||
Name string // 模板名称
|
||||
@@ -36,7 +37,7 @@ type SystemNotifyTemplateColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// systemNotifyTemplateColumns holds the columns for table system_notify_template.
|
||||
// systemNotifyTemplateColumns holds the columns for the table system_notify_template.
|
||||
var systemNotifyTemplateColumns = SystemNotifyTemplateColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
@@ -55,44 +56,49 @@ var systemNotifyTemplateColumns = SystemNotifyTemplateColumns{
|
||||
}
|
||||
|
||||
// NewSystemNotifyTemplateDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemNotifyTemplateDao() *SystemNotifyTemplateDao {
|
||||
func NewSystemNotifyTemplateDao(handlers ...gdb.ModelHandler) *SystemNotifyTemplateDao {
|
||||
return &SystemNotifyTemplateDao{
|
||||
group: "default",
|
||||
table: "system_notify_template",
|
||||
columns: systemNotifyTemplateColumns,
|
||||
group: "default",
|
||||
table: "system_notify_template",
|
||||
columns: systemNotifyTemplateColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemNotifyTemplateDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemNotifyTemplateDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemNotifyTemplateDao) Columns() SystemNotifyTemplateColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemNotifyTemplateDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemNotifyTemplateDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemOauth2AccessTokenDao is the data access object for table system_oauth2_access_token.
|
||||
// SystemOauth2AccessTokenDao is the data access object for the 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 current DAO.
|
||||
columns SystemOauth2AccessTokenColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemOauth2AccessTokenColumns defines and stores column names for table system_oauth2_access_token.
|
||||
// SystemOauth2AccessTokenColumns defines and stores column names for the table system_oauth2_access_token.
|
||||
type SystemOauth2AccessTokenColumns struct {
|
||||
Id string // 编号
|
||||
UserId string // 用户编号
|
||||
@@ -37,7 +38,7 @@ type SystemOauth2AccessTokenColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemOauth2AccessTokenColumns holds the columns for table system_oauth2_access_token.
|
||||
// systemOauth2AccessTokenColumns holds the columns for the table system_oauth2_access_token.
|
||||
var systemOauth2AccessTokenColumns = SystemOauth2AccessTokenColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
@@ -57,44 +58,49 @@ var systemOauth2AccessTokenColumns = SystemOauth2AccessTokenColumns{
|
||||
}
|
||||
|
||||
// NewSystemOauth2AccessTokenDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemOauth2AccessTokenDao() *SystemOauth2AccessTokenDao {
|
||||
func NewSystemOauth2AccessTokenDao(handlers ...gdb.ModelHandler) *SystemOauth2AccessTokenDao {
|
||||
return &SystemOauth2AccessTokenDao{
|
||||
group: "default",
|
||||
table: "system_oauth2_access_token",
|
||||
columns: systemOauth2AccessTokenColumns,
|
||||
group: "default",
|
||||
table: "system_oauth2_access_token",
|
||||
columns: systemOauth2AccessTokenColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemOauth2AccessTokenDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemOauth2AccessTokenDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemOauth2AccessTokenDao) Columns() SystemOauth2AccessTokenColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemOauth2AccessTokenDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemOauth2AccessTokenDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemOauth2ApproveDao is the data access object for table system_oauth2_approve.
|
||||
// SystemOauth2ApproveDao is the data access object for the 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 current DAO.
|
||||
columns SystemOauth2ApproveColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemOauth2ApproveColumns defines and stores column names for table system_oauth2_approve.
|
||||
// SystemOauth2ApproveColumns defines and stores column names for the table system_oauth2_approve.
|
||||
type SystemOauth2ApproveColumns struct {
|
||||
Id string // 编号
|
||||
UserId string // 用户编号
|
||||
@@ -35,7 +36,7 @@ type SystemOauth2ApproveColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemOauth2ApproveColumns holds the columns for table system_oauth2_approve.
|
||||
// systemOauth2ApproveColumns holds the columns for the table system_oauth2_approve.
|
||||
var systemOauth2ApproveColumns = SystemOauth2ApproveColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
@@ -53,44 +54,49 @@ var systemOauth2ApproveColumns = SystemOauth2ApproveColumns{
|
||||
}
|
||||
|
||||
// NewSystemOauth2ApproveDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemOauth2ApproveDao() *SystemOauth2ApproveDao {
|
||||
func NewSystemOauth2ApproveDao(handlers ...gdb.ModelHandler) *SystemOauth2ApproveDao {
|
||||
return &SystemOauth2ApproveDao{
|
||||
group: "default",
|
||||
table: "system_oauth2_approve",
|
||||
columns: systemOauth2ApproveColumns,
|
||||
group: "default",
|
||||
table: "system_oauth2_approve",
|
||||
columns: systemOauth2ApproveColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemOauth2ApproveDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemOauth2ApproveDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemOauth2ApproveDao) Columns() SystemOauth2ApproveColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemOauth2ApproveDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemOauth2ApproveDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemOauth2ClientDao is the data access object for table system_oauth2_client.
|
||||
// SystemOauth2ClientDao is the data access object for the 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 current DAO.
|
||||
columns SystemOauth2ClientColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemOauth2ClientColumns defines and stores column names for table system_oauth2_client.
|
||||
// SystemOauth2ClientColumns defines and stores column names for the table system_oauth2_client.
|
||||
type SystemOauth2ClientColumns struct {
|
||||
Id string // 编号
|
||||
ClientId string // 客户端编号
|
||||
@@ -43,7 +44,7 @@ type SystemOauth2ClientColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// systemOauth2ClientColumns holds the columns for table system_oauth2_client.
|
||||
// systemOauth2ClientColumns holds the columns for the table system_oauth2_client.
|
||||
var systemOauth2ClientColumns = SystemOauth2ClientColumns{
|
||||
Id: "id",
|
||||
ClientId: "client_id",
|
||||
@@ -69,44 +70,49 @@ var systemOauth2ClientColumns = SystemOauth2ClientColumns{
|
||||
}
|
||||
|
||||
// NewSystemOauth2ClientDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemOauth2ClientDao() *SystemOauth2ClientDao {
|
||||
func NewSystemOauth2ClientDao(handlers ...gdb.ModelHandler) *SystemOauth2ClientDao {
|
||||
return &SystemOauth2ClientDao{
|
||||
group: "default",
|
||||
table: "system_oauth2_client",
|
||||
columns: systemOauth2ClientColumns,
|
||||
group: "default",
|
||||
table: "system_oauth2_client",
|
||||
columns: systemOauth2ClientColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemOauth2ClientDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemOauth2ClientDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemOauth2ClientDao) Columns() SystemOauth2ClientColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemOauth2ClientDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemOauth2ClientDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemOauth2CodeDao is the data access object for table system_oauth2_code.
|
||||
// SystemOauth2CodeDao is the data access object for the 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 current DAO.
|
||||
columns SystemOauth2CodeColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemOauth2CodeColumns defines and stores column names for table system_oauth2_code.
|
||||
// SystemOauth2CodeColumns defines and stores column names for the table system_oauth2_code.
|
||||
type SystemOauth2CodeColumns struct {
|
||||
Id string // 编号
|
||||
UserId string // 用户编号
|
||||
@@ -37,7 +38,7 @@ type SystemOauth2CodeColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemOauth2CodeColumns holds the columns for table system_oauth2_code.
|
||||
// systemOauth2CodeColumns holds the columns for the table system_oauth2_code.
|
||||
var systemOauth2CodeColumns = SystemOauth2CodeColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
@@ -57,44 +58,49 @@ var systemOauth2CodeColumns = SystemOauth2CodeColumns{
|
||||
}
|
||||
|
||||
// NewSystemOauth2CodeDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemOauth2CodeDao() *SystemOauth2CodeDao {
|
||||
func NewSystemOauth2CodeDao(handlers ...gdb.ModelHandler) *SystemOauth2CodeDao {
|
||||
return &SystemOauth2CodeDao{
|
||||
group: "default",
|
||||
table: "system_oauth2_code",
|
||||
columns: systemOauth2CodeColumns,
|
||||
group: "default",
|
||||
table: "system_oauth2_code",
|
||||
columns: systemOauth2CodeColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemOauth2CodeDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemOauth2CodeDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemOauth2CodeDao) Columns() SystemOauth2CodeColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemOauth2CodeDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemOauth2CodeDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemOauth2RefreshTokenDao is the data access object for table system_oauth2_refresh_token.
|
||||
// SystemOauth2RefreshTokenDao is the data access object for the 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 current DAO.
|
||||
columns SystemOauth2RefreshTokenColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemOauth2RefreshTokenColumns defines and stores column names for table system_oauth2_refresh_token.
|
||||
// SystemOauth2RefreshTokenColumns defines and stores column names for the table system_oauth2_refresh_token.
|
||||
type SystemOauth2RefreshTokenColumns struct {
|
||||
Id string // 编号
|
||||
UserId string // 用户编号
|
||||
@@ -35,7 +36,7 @@ type SystemOauth2RefreshTokenColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemOauth2RefreshTokenColumns holds the columns for table system_oauth2_refresh_token.
|
||||
// systemOauth2RefreshTokenColumns holds the columns for the table system_oauth2_refresh_token.
|
||||
var systemOauth2RefreshTokenColumns = SystemOauth2RefreshTokenColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
@@ -53,44 +54,49 @@ var systemOauth2RefreshTokenColumns = SystemOauth2RefreshTokenColumns{
|
||||
}
|
||||
|
||||
// NewSystemOauth2RefreshTokenDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemOauth2RefreshTokenDao() *SystemOauth2RefreshTokenDao {
|
||||
func NewSystemOauth2RefreshTokenDao(handlers ...gdb.ModelHandler) *SystemOauth2RefreshTokenDao {
|
||||
return &SystemOauth2RefreshTokenDao{
|
||||
group: "default",
|
||||
table: "system_oauth2_refresh_token",
|
||||
columns: systemOauth2RefreshTokenColumns,
|
||||
group: "default",
|
||||
table: "system_oauth2_refresh_token",
|
||||
columns: systemOauth2RefreshTokenColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemOauth2RefreshTokenDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemOauth2RefreshTokenDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemOauth2RefreshTokenDao) Columns() SystemOauth2RefreshTokenColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemOauth2RefreshTokenDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemOauth2RefreshTokenDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemOperateLogDao is the data access object for table system_operate_log.
|
||||
// SystemOperateLogDao is the data access object for the 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 current DAO.
|
||||
columns SystemOperateLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemOperateLogColumns defines and stores column names for table system_operate_log.
|
||||
// SystemOperateLogColumns defines and stores column names for the table system_operate_log.
|
||||
type SystemOperateLogColumns struct {
|
||||
Id string // 日志主键
|
||||
TraceId string // 链路追踪编号
|
||||
@@ -41,7 +42,7 @@ type SystemOperateLogColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemOperateLogColumns holds the columns for table system_operate_log.
|
||||
// systemOperateLogColumns holds the columns for the table system_operate_log.
|
||||
var systemOperateLogColumns = SystemOperateLogColumns{
|
||||
Id: "id",
|
||||
TraceId: "trace_id",
|
||||
@@ -65,44 +66,49 @@ var systemOperateLogColumns = SystemOperateLogColumns{
|
||||
}
|
||||
|
||||
// NewSystemOperateLogDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemOperateLogDao() *SystemOperateLogDao {
|
||||
func NewSystemOperateLogDao(handlers ...gdb.ModelHandler) *SystemOperateLogDao {
|
||||
return &SystemOperateLogDao{
|
||||
group: "default",
|
||||
table: "system_operate_log",
|
||||
columns: systemOperateLogColumns,
|
||||
group: "default",
|
||||
table: "system_operate_log",
|
||||
columns: systemOperateLogColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemOperateLogDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemOperateLogDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemOperateLogDao) Columns() SystemOperateLogColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemOperateLogDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemOperateLogDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemPostDao is the data access object for table system_post.
|
||||
// SystemPostDao is the data access object for the 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 current DAO.
|
||||
columns SystemPostColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemPostColumns defines and stores column names for table system_post.
|
||||
// SystemPostColumns defines and stores column names for the table system_post.
|
||||
type SystemPostColumns struct {
|
||||
Id string // 岗位ID
|
||||
Code string // 岗位编码
|
||||
@@ -34,7 +35,7 @@ type SystemPostColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemPostColumns holds the columns for table system_post.
|
||||
// systemPostColumns holds the columns for the table system_post.
|
||||
var systemPostColumns = SystemPostColumns{
|
||||
Id: "id",
|
||||
Code: "code",
|
||||
@@ -51,44 +52,49 @@ var systemPostColumns = SystemPostColumns{
|
||||
}
|
||||
|
||||
// NewSystemPostDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemPostDao() *SystemPostDao {
|
||||
func NewSystemPostDao(handlers ...gdb.ModelHandler) *SystemPostDao {
|
||||
return &SystemPostDao{
|
||||
group: "default",
|
||||
table: "system_post",
|
||||
columns: systemPostColumns,
|
||||
group: "default",
|
||||
table: "system_post",
|
||||
columns: systemPostColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemPostDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemPostDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemPostDao) Columns() SystemPostColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemPostDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemPostDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemRoleDao is the data access object for table system_role.
|
||||
// SystemRoleDao is the data access object for the 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 current DAO.
|
||||
columns SystemRoleColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemRoleColumns defines and stores column names for table system_role.
|
||||
// SystemRoleColumns defines and stores column names for the table system_role.
|
||||
type SystemRoleColumns struct {
|
||||
Id string // 角色ID
|
||||
Name string // 角色名称
|
||||
@@ -37,7 +38,7 @@ type SystemRoleColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemRoleColumns holds the columns for table system_role.
|
||||
// systemRoleColumns holds the columns for the table system_role.
|
||||
var systemRoleColumns = SystemRoleColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
@@ -57,44 +58,49 @@ var systemRoleColumns = SystemRoleColumns{
|
||||
}
|
||||
|
||||
// NewSystemRoleDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemRoleDao() *SystemRoleDao {
|
||||
func NewSystemRoleDao(handlers ...gdb.ModelHandler) *SystemRoleDao {
|
||||
return &SystemRoleDao{
|
||||
group: "default",
|
||||
table: "system_role",
|
||||
columns: systemRoleColumns,
|
||||
group: "default",
|
||||
table: "system_role",
|
||||
columns: systemRoleColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemRoleDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemRoleDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemRoleDao) Columns() SystemRoleColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemRoleDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemRoleDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemRoleMenuDao is the data access object for table system_role_menu.
|
||||
// SystemRoleMenuDao is the data access object for the 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 current DAO.
|
||||
columns SystemRoleMenuColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemRoleMenuColumns defines and stores column names for table system_role_menu.
|
||||
// SystemRoleMenuColumns defines and stores column names for the table system_role_menu.
|
||||
type SystemRoleMenuColumns struct {
|
||||
Id string // 自增编号
|
||||
RoleId string // 角色ID
|
||||
@@ -31,7 +32,7 @@ type SystemRoleMenuColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemRoleMenuColumns holds the columns for table system_role_menu.
|
||||
// systemRoleMenuColumns holds the columns for the table system_role_menu.
|
||||
var systemRoleMenuColumns = SystemRoleMenuColumns{
|
||||
Id: "id",
|
||||
RoleId: "role_id",
|
||||
@@ -45,44 +46,49 @@ var systemRoleMenuColumns = SystemRoleMenuColumns{
|
||||
}
|
||||
|
||||
// NewSystemRoleMenuDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemRoleMenuDao() *SystemRoleMenuDao {
|
||||
func NewSystemRoleMenuDao(handlers ...gdb.ModelHandler) *SystemRoleMenuDao {
|
||||
return &SystemRoleMenuDao{
|
||||
group: "default",
|
||||
table: "system_role_menu",
|
||||
columns: systemRoleMenuColumns,
|
||||
group: "default",
|
||||
table: "system_role_menu",
|
||||
columns: systemRoleMenuColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemRoleMenuDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemRoleMenuDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemRoleMenuDao) Columns() SystemRoleMenuColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemRoleMenuDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemRoleMenuDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemSmsChannelDao is the data access object for table system_sms_channel.
|
||||
// SystemSmsChannelDao is the data access object for the 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 current DAO.
|
||||
columns SystemSmsChannelColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemSmsChannelColumns defines and stores column names for table system_sms_channel.
|
||||
// SystemSmsChannelColumns defines and stores column names for the table system_sms_channel.
|
||||
type SystemSmsChannelColumns struct {
|
||||
Id string // 编号
|
||||
Signature string // 短信签名
|
||||
@@ -35,7 +36,7 @@ type SystemSmsChannelColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// systemSmsChannelColumns holds the columns for table system_sms_channel.
|
||||
// systemSmsChannelColumns holds the columns for the table system_sms_channel.
|
||||
var systemSmsChannelColumns = SystemSmsChannelColumns{
|
||||
Id: "id",
|
||||
Signature: "signature",
|
||||
@@ -53,44 +54,49 @@ var systemSmsChannelColumns = SystemSmsChannelColumns{
|
||||
}
|
||||
|
||||
// NewSystemSmsChannelDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemSmsChannelDao() *SystemSmsChannelDao {
|
||||
func NewSystemSmsChannelDao(handlers ...gdb.ModelHandler) *SystemSmsChannelDao {
|
||||
return &SystemSmsChannelDao{
|
||||
group: "default",
|
||||
table: "system_sms_channel",
|
||||
columns: systemSmsChannelColumns,
|
||||
group: "default",
|
||||
table: "system_sms_channel",
|
||||
columns: systemSmsChannelColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemSmsChannelDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemSmsChannelDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemSmsChannelDao) Columns() SystemSmsChannelColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemSmsChannelDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemSmsChannelDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemSmsCodeDao is the data access object for table system_sms_code.
|
||||
// SystemSmsCodeDao is the data access object for the 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 current DAO.
|
||||
columns SystemSmsCodeColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemSmsCodeColumns defines and stores column names for table system_sms_code.
|
||||
// SystemSmsCodeColumns defines and stores column names for the table system_sms_code.
|
||||
type SystemSmsCodeColumns struct {
|
||||
Id string // 编号
|
||||
Mobile string // 手机号
|
||||
@@ -37,7 +38,7 @@ type SystemSmsCodeColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemSmsCodeColumns holds the columns for table system_sms_code.
|
||||
// systemSmsCodeColumns holds the columns for the table system_sms_code.
|
||||
var systemSmsCodeColumns = SystemSmsCodeColumns{
|
||||
Id: "id",
|
||||
Mobile: "mobile",
|
||||
@@ -57,44 +58,49 @@ var systemSmsCodeColumns = SystemSmsCodeColumns{
|
||||
}
|
||||
|
||||
// NewSystemSmsCodeDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemSmsCodeDao() *SystemSmsCodeDao {
|
||||
func NewSystemSmsCodeDao(handlers ...gdb.ModelHandler) *SystemSmsCodeDao {
|
||||
return &SystemSmsCodeDao{
|
||||
group: "default",
|
||||
table: "system_sms_code",
|
||||
columns: systemSmsCodeColumns,
|
||||
group: "default",
|
||||
table: "system_sms_code",
|
||||
columns: systemSmsCodeColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemSmsCodeDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemSmsCodeDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemSmsCodeDao) Columns() SystemSmsCodeColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemSmsCodeDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemSmsCodeDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemSmsLogDao is the data access object for table system_sms_log.
|
||||
// SystemSmsLogDao is the data access object for the 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 current DAO.
|
||||
columns SystemSmsLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemSmsLogColumns defines and stores column names for table system_sms_log.
|
||||
// SystemSmsLogColumns defines and stores column names for the table system_sms_log.
|
||||
type SystemSmsLogColumns struct {
|
||||
Id string // 编号
|
||||
ChannelId string // 短信渠道编号
|
||||
@@ -49,7 +50,7 @@ type SystemSmsLogColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// systemSmsLogColumns holds the columns for table system_sms_log.
|
||||
// systemSmsLogColumns holds the columns for the table system_sms_log.
|
||||
var systemSmsLogColumns = SystemSmsLogColumns{
|
||||
Id: "id",
|
||||
ChannelId: "channel_id",
|
||||
@@ -81,44 +82,49 @@ var systemSmsLogColumns = SystemSmsLogColumns{
|
||||
}
|
||||
|
||||
// NewSystemSmsLogDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemSmsLogDao() *SystemSmsLogDao {
|
||||
func NewSystemSmsLogDao(handlers ...gdb.ModelHandler) *SystemSmsLogDao {
|
||||
return &SystemSmsLogDao{
|
||||
group: "default",
|
||||
table: "system_sms_log",
|
||||
columns: systemSmsLogColumns,
|
||||
group: "default",
|
||||
table: "system_sms_log",
|
||||
columns: systemSmsLogColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemSmsLogDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemSmsLogDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemSmsLogDao) Columns() SystemSmsLogColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemSmsLogDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemSmsLogDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemSmsTemplateDao is the data access object for table system_sms_template.
|
||||
// SystemSmsTemplateDao is the data access object for the 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 current DAO.
|
||||
columns SystemSmsTemplateColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemSmsTemplateColumns defines and stores column names for table system_sms_template.
|
||||
// SystemSmsTemplateColumns defines and stores column names for the table system_sms_template.
|
||||
type SystemSmsTemplateColumns struct {
|
||||
Id string // 编号
|
||||
Type string // 模板类型
|
||||
@@ -38,7 +39,7 @@ type SystemSmsTemplateColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// systemSmsTemplateColumns holds the columns for table system_sms_template.
|
||||
// systemSmsTemplateColumns holds the columns for the table system_sms_template.
|
||||
var systemSmsTemplateColumns = SystemSmsTemplateColumns{
|
||||
Id: "id",
|
||||
Type: "type",
|
||||
@@ -59,44 +60,49 @@ var systemSmsTemplateColumns = SystemSmsTemplateColumns{
|
||||
}
|
||||
|
||||
// NewSystemSmsTemplateDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemSmsTemplateDao() *SystemSmsTemplateDao {
|
||||
func NewSystemSmsTemplateDao(handlers ...gdb.ModelHandler) *SystemSmsTemplateDao {
|
||||
return &SystemSmsTemplateDao{
|
||||
group: "default",
|
||||
table: "system_sms_template",
|
||||
columns: systemSmsTemplateColumns,
|
||||
group: "default",
|
||||
table: "system_sms_template",
|
||||
columns: systemSmsTemplateColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemSmsTemplateDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemSmsTemplateDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemSmsTemplateDao) Columns() SystemSmsTemplateColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemSmsTemplateDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemSmsTemplateDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemSocialClientDao is the data access object for table system_social_client.
|
||||
// SystemSocialClientDao is the data access object for the 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 current DAO.
|
||||
columns SystemSocialClientColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemSocialClientColumns defines and stores column names for table system_social_client.
|
||||
// SystemSocialClientColumns defines and stores column names for the table system_social_client.
|
||||
type SystemSocialClientColumns struct {
|
||||
Id string // 编号
|
||||
Name string // 应用名
|
||||
@@ -36,7 +37,7 @@ type SystemSocialClientColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemSocialClientColumns holds the columns for table system_social_client.
|
||||
// systemSocialClientColumns holds the columns for the table system_social_client.
|
||||
var systemSocialClientColumns = SystemSocialClientColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
@@ -55,44 +56,49 @@ var systemSocialClientColumns = SystemSocialClientColumns{
|
||||
}
|
||||
|
||||
// NewSystemSocialClientDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemSocialClientDao() *SystemSocialClientDao {
|
||||
func NewSystemSocialClientDao(handlers ...gdb.ModelHandler) *SystemSocialClientDao {
|
||||
return &SystemSocialClientDao{
|
||||
group: "default",
|
||||
table: "system_social_client",
|
||||
columns: systemSocialClientColumns,
|
||||
group: "default",
|
||||
table: "system_social_client",
|
||||
columns: systemSocialClientColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemSocialClientDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemSocialClientDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemSocialClientDao) Columns() SystemSocialClientColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemSocialClientDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemSocialClientDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemSocialUserDao is the data access object for table system_social_user.
|
||||
// SystemSocialUserDao is the data access object for the 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 current DAO.
|
||||
columns SystemSocialUserColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemSocialUserColumns defines and stores column names for table system_social_user.
|
||||
// SystemSocialUserColumns defines and stores column names for the table system_social_user.
|
||||
type SystemSocialUserColumns struct {
|
||||
Id string // 主键(自增策略)
|
||||
Type string // 社交平台的类型
|
||||
@@ -38,7 +39,7 @@ type SystemSocialUserColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemSocialUserColumns holds the columns for table system_social_user.
|
||||
// systemSocialUserColumns holds the columns for the table system_social_user.
|
||||
var systemSocialUserColumns = SystemSocialUserColumns{
|
||||
Id: "id",
|
||||
Type: "type",
|
||||
@@ -59,44 +60,49 @@ var systemSocialUserColumns = SystemSocialUserColumns{
|
||||
}
|
||||
|
||||
// NewSystemSocialUserDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemSocialUserDao() *SystemSocialUserDao {
|
||||
func NewSystemSocialUserDao(handlers ...gdb.ModelHandler) *SystemSocialUserDao {
|
||||
return &SystemSocialUserDao{
|
||||
group: "default",
|
||||
table: "system_social_user",
|
||||
columns: systemSocialUserColumns,
|
||||
group: "default",
|
||||
table: "system_social_user",
|
||||
columns: systemSocialUserColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemSocialUserDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemSocialUserDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemSocialUserDao) Columns() SystemSocialUserColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemSocialUserDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemSocialUserDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemSocialUserBindDao is the data access object for table system_social_user_bind.
|
||||
// SystemSocialUserBindDao is the data access object for the 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 current DAO.
|
||||
columns SystemSocialUserBindColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemSocialUserBindColumns defines and stores column names for table system_social_user_bind.
|
||||
// SystemSocialUserBindColumns defines and stores column names for the table system_social_user_bind.
|
||||
type SystemSocialUserBindColumns struct {
|
||||
Id string // 主键(自增策略)
|
||||
UserId string // 用户编号
|
||||
@@ -33,7 +34,7 @@ type SystemSocialUserBindColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemSocialUserBindColumns holds the columns for table system_social_user_bind.
|
||||
// systemSocialUserBindColumns holds the columns for the table system_social_user_bind.
|
||||
var systemSocialUserBindColumns = SystemSocialUserBindColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
@@ -49,44 +50,49 @@ var systemSocialUserBindColumns = SystemSocialUserBindColumns{
|
||||
}
|
||||
|
||||
// NewSystemSocialUserBindDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemSocialUserBindDao() *SystemSocialUserBindDao {
|
||||
func NewSystemSocialUserBindDao(handlers ...gdb.ModelHandler) *SystemSocialUserBindDao {
|
||||
return &SystemSocialUserBindDao{
|
||||
group: "default",
|
||||
table: "system_social_user_bind",
|
||||
columns: systemSocialUserBindColumns,
|
||||
group: "default",
|
||||
table: "system_social_user_bind",
|
||||
columns: systemSocialUserBindColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemSocialUserBindDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemSocialUserBindDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemSocialUserBindDao) Columns() SystemSocialUserBindColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemSocialUserBindDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemSocialUserBindDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemTenantDao is the data access object for table system_tenant.
|
||||
// SystemTenantDao is the data access object for the 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 current DAO.
|
||||
columns SystemTenantColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemTenantColumns defines and stores column names for table system_tenant.
|
||||
// SystemTenantColumns defines and stores column names for the table system_tenant.
|
||||
type SystemTenantColumns struct {
|
||||
Id string // 租户编号
|
||||
Name string // 租户名
|
||||
@@ -37,7 +38,7 @@ type SystemTenantColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// systemTenantColumns holds the columns for table system_tenant.
|
||||
// systemTenantColumns holds the columns for the table system_tenant.
|
||||
var systemTenantColumns = SystemTenantColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
@@ -57,44 +58,49 @@ var systemTenantColumns = SystemTenantColumns{
|
||||
}
|
||||
|
||||
// NewSystemTenantDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemTenantDao() *SystemTenantDao {
|
||||
func NewSystemTenantDao(handlers ...gdb.ModelHandler) *SystemTenantDao {
|
||||
return &SystemTenantDao{
|
||||
group: "default",
|
||||
table: "system_tenant",
|
||||
columns: systemTenantColumns,
|
||||
group: "default",
|
||||
table: "system_tenant",
|
||||
columns: systemTenantColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemTenantDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemTenantDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemTenantDao) Columns() SystemTenantColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemTenantDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemTenantDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemTenantPackageDao is the data access object for table system_tenant_package.
|
||||
// SystemTenantPackageDao is the data access object for the 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 current DAO.
|
||||
columns SystemTenantPackageColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemTenantPackageColumns defines and stores column names for table system_tenant_package.
|
||||
// SystemTenantPackageColumns defines and stores column names for the table system_tenant_package.
|
||||
type SystemTenantPackageColumns struct {
|
||||
Id string // 套餐编号
|
||||
Name string // 套餐名
|
||||
@@ -32,7 +33,7 @@ type SystemTenantPackageColumns struct {
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// systemTenantPackageColumns holds the columns for table system_tenant_package.
|
||||
// systemTenantPackageColumns holds the columns for the table system_tenant_package.
|
||||
var systemTenantPackageColumns = SystemTenantPackageColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
@@ -47,44 +48,49 @@ var systemTenantPackageColumns = SystemTenantPackageColumns{
|
||||
}
|
||||
|
||||
// NewSystemTenantPackageDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemTenantPackageDao() *SystemTenantPackageDao {
|
||||
func NewSystemTenantPackageDao(handlers ...gdb.ModelHandler) *SystemTenantPackageDao {
|
||||
return &SystemTenantPackageDao{
|
||||
group: "default",
|
||||
table: "system_tenant_package",
|
||||
columns: systemTenantPackageColumns,
|
||||
group: "default",
|
||||
table: "system_tenant_package",
|
||||
columns: systemTenantPackageColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemTenantPackageDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemTenantPackageDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemTenantPackageDao) Columns() SystemTenantPackageColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemTenantPackageDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemTenantPackageDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemUserPostDao is the data access object for table system_user_post.
|
||||
// SystemUserPostDao is the data access object for the 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 current DAO.
|
||||
columns SystemUserPostColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemUserPostColumns defines and stores column names for table system_user_post.
|
||||
// SystemUserPostColumns defines and stores column names for the table system_user_post.
|
||||
type SystemUserPostColumns struct {
|
||||
Id string // id
|
||||
UserId string // 用户ID
|
||||
@@ -31,7 +32,7 @@ type SystemUserPostColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemUserPostColumns holds the columns for table system_user_post.
|
||||
// systemUserPostColumns holds the columns for the table system_user_post.
|
||||
var systemUserPostColumns = SystemUserPostColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
@@ -45,44 +46,49 @@ var systemUserPostColumns = SystemUserPostColumns{
|
||||
}
|
||||
|
||||
// NewSystemUserPostDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemUserPostDao() *SystemUserPostDao {
|
||||
func NewSystemUserPostDao(handlers ...gdb.ModelHandler) *SystemUserPostDao {
|
||||
return &SystemUserPostDao{
|
||||
group: "default",
|
||||
table: "system_user_post",
|
||||
columns: systemUserPostColumns,
|
||||
group: "default",
|
||||
table: "system_user_post",
|
||||
columns: systemUserPostColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemUserPostDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemUserPostDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemUserPostDao) Columns() SystemUserPostColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemUserPostDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemUserPostDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemUserRoleDao is the data access object for table system_user_role.
|
||||
// SystemUserRoleDao is the data access object for the 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 current DAO.
|
||||
columns SystemUserRoleColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemUserRoleColumns defines and stores column names for table system_user_role.
|
||||
// SystemUserRoleColumns defines and stores column names for the table system_user_role.
|
||||
type SystemUserRoleColumns struct {
|
||||
Id string // 自增编号
|
||||
UserId string // 用户ID
|
||||
@@ -31,7 +32,7 @@ type SystemUserRoleColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemUserRoleColumns holds the columns for table system_user_role.
|
||||
// systemUserRoleColumns holds the columns for the table system_user_role.
|
||||
var systemUserRoleColumns = SystemUserRoleColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
@@ -45,44 +46,49 @@ var systemUserRoleColumns = SystemUserRoleColumns{
|
||||
}
|
||||
|
||||
// NewSystemUserRoleDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemUserRoleDao() *SystemUserRoleDao {
|
||||
func NewSystemUserRoleDao(handlers ...gdb.ModelHandler) *SystemUserRoleDao {
|
||||
return &SystemUserRoleDao{
|
||||
group: "default",
|
||||
table: "system_user_role",
|
||||
columns: systemUserRoleColumns,
|
||||
group: "default",
|
||||
table: "system_user_role",
|
||||
columns: systemUserRoleColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemUserRoleDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemUserRoleDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemUserRoleDao) Columns() SystemUserRoleColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemUserRoleDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemUserRoleDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SystemUsersDao is the data access object for table system_users.
|
||||
// SystemUsersDao is the data access object for the 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 current DAO.
|
||||
columns SystemUsersColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// SystemUsersColumns defines and stores column names for table system_users.
|
||||
// SystemUsersColumns defines and stores column names for the table system_users.
|
||||
type SystemUsersColumns struct {
|
||||
Id string // 用户ID
|
||||
Username string // 用户账号
|
||||
@@ -42,7 +43,7 @@ type SystemUsersColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// systemUsersColumns holds the columns for table system_users.
|
||||
// systemUsersColumns holds the columns for the table system_users.
|
||||
var systemUsersColumns = SystemUsersColumns{
|
||||
Id: "id",
|
||||
Username: "username",
|
||||
@@ -67,44 +68,49 @@ var systemUsersColumns = SystemUsersColumns{
|
||||
}
|
||||
|
||||
// NewSystemUsersDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemUsersDao() *SystemUsersDao {
|
||||
func NewSystemUsersDao(handlers ...gdb.ModelHandler) *SystemUsersDao {
|
||||
return &SystemUsersDao{
|
||||
group: "default",
|
||||
table: "system_users",
|
||||
columns: systemUsersColumns,
|
||||
group: "default",
|
||||
table: "system_users",
|
||||
columns: systemUsersColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemUsersDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemUsersDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemUsersDao) Columns() SystemUsersColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemUsersDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SystemUsersDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// YudaoDemo01ContactDao is the data access object for table yudao_demo01_contact.
|
||||
// YudaoDemo01ContactDao is the data access object for the 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 current DAO.
|
||||
columns YudaoDemo01ContactColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// YudaoDemo01ContactColumns defines and stores column names for table yudao_demo01_contact.
|
||||
// YudaoDemo01ContactColumns defines and stores column names for the table yudao_demo01_contact.
|
||||
type YudaoDemo01ContactColumns struct {
|
||||
Id string // 编号
|
||||
Name string // 名字
|
||||
@@ -34,7 +35,7 @@ type YudaoDemo01ContactColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// yudaoDemo01ContactColumns holds the columns for table yudao_demo01_contact.
|
||||
// yudaoDemo01ContactColumns holds the columns for the table yudao_demo01_contact.
|
||||
var yudaoDemo01ContactColumns = YudaoDemo01ContactColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
@@ -51,44 +52,49 @@ var yudaoDemo01ContactColumns = YudaoDemo01ContactColumns{
|
||||
}
|
||||
|
||||
// NewYudaoDemo01ContactDao creates and returns a new DAO object for table data access.
|
||||
func NewYudaoDemo01ContactDao() *YudaoDemo01ContactDao {
|
||||
func NewYudaoDemo01ContactDao(handlers ...gdb.ModelHandler) *YudaoDemo01ContactDao {
|
||||
return &YudaoDemo01ContactDao{
|
||||
group: "default",
|
||||
table: "yudao_demo01_contact",
|
||||
columns: yudaoDemo01ContactColumns,
|
||||
group: "default",
|
||||
table: "yudao_demo01_contact",
|
||||
columns: yudaoDemo01ContactColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *YudaoDemo01ContactDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *YudaoDemo01ContactDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *YudaoDemo01ContactDao) Columns() YudaoDemo01ContactColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *YudaoDemo01ContactDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *YudaoDemo01ContactDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// YudaoDemo02CategoryDao is the data access object for table yudao_demo02_category.
|
||||
// YudaoDemo02CategoryDao is the data access object for the 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 current DAO.
|
||||
columns YudaoDemo02CategoryColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// YudaoDemo02CategoryColumns defines and stores column names for table yudao_demo02_category.
|
||||
// YudaoDemo02CategoryColumns defines and stores column names for the table yudao_demo02_category.
|
||||
type YudaoDemo02CategoryColumns struct {
|
||||
Id string // 编号
|
||||
Name string // 名字
|
||||
@@ -31,7 +32,7 @@ type YudaoDemo02CategoryColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// yudaoDemo02CategoryColumns holds the columns for table yudao_demo02_category.
|
||||
// yudaoDemo02CategoryColumns holds the columns for the table yudao_demo02_category.
|
||||
var yudaoDemo02CategoryColumns = YudaoDemo02CategoryColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
@@ -45,44 +46,49 @@ var yudaoDemo02CategoryColumns = YudaoDemo02CategoryColumns{
|
||||
}
|
||||
|
||||
// NewYudaoDemo02CategoryDao creates and returns a new DAO object for table data access.
|
||||
func NewYudaoDemo02CategoryDao() *YudaoDemo02CategoryDao {
|
||||
func NewYudaoDemo02CategoryDao(handlers ...gdb.ModelHandler) *YudaoDemo02CategoryDao {
|
||||
return &YudaoDemo02CategoryDao{
|
||||
group: "default",
|
||||
table: "yudao_demo02_category",
|
||||
columns: yudaoDemo02CategoryColumns,
|
||||
group: "default",
|
||||
table: "yudao_demo02_category",
|
||||
columns: yudaoDemo02CategoryColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *YudaoDemo02CategoryDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *YudaoDemo02CategoryDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *YudaoDemo02CategoryDao) Columns() YudaoDemo02CategoryColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *YudaoDemo02CategoryDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *YudaoDemo02CategoryDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// YudaoDemo03CourseDao is the data access object for table yudao_demo03_course.
|
||||
// YudaoDemo03CourseDao is the data access object for the 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 current DAO.
|
||||
columns YudaoDemo03CourseColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// YudaoDemo03CourseColumns defines and stores column names for table yudao_demo03_course.
|
||||
// YudaoDemo03CourseColumns defines and stores column names for the table yudao_demo03_course.
|
||||
type YudaoDemo03CourseColumns struct {
|
||||
Id string // 编号
|
||||
StudentId string // 学生编号
|
||||
@@ -32,7 +33,7 @@ type YudaoDemo03CourseColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// yudaoDemo03CourseColumns holds the columns for table yudao_demo03_course.
|
||||
// yudaoDemo03CourseColumns holds the columns for the table yudao_demo03_course.
|
||||
var yudaoDemo03CourseColumns = YudaoDemo03CourseColumns{
|
||||
Id: "id",
|
||||
StudentId: "student_id",
|
||||
@@ -47,44 +48,49 @@ var yudaoDemo03CourseColumns = YudaoDemo03CourseColumns{
|
||||
}
|
||||
|
||||
// NewYudaoDemo03CourseDao creates and returns a new DAO object for table data access.
|
||||
func NewYudaoDemo03CourseDao() *YudaoDemo03CourseDao {
|
||||
func NewYudaoDemo03CourseDao(handlers ...gdb.ModelHandler) *YudaoDemo03CourseDao {
|
||||
return &YudaoDemo03CourseDao{
|
||||
group: "default",
|
||||
table: "yudao_demo03_course",
|
||||
columns: yudaoDemo03CourseColumns,
|
||||
group: "default",
|
||||
table: "yudao_demo03_course",
|
||||
columns: yudaoDemo03CourseColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *YudaoDemo03CourseDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *YudaoDemo03CourseDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *YudaoDemo03CourseDao) Columns() YudaoDemo03CourseColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *YudaoDemo03CourseDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *YudaoDemo03CourseDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// YudaoDemo03GradeDao is the data access object for table yudao_demo03_grade.
|
||||
// YudaoDemo03GradeDao is the data access object for the 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 current DAO.
|
||||
columns YudaoDemo03GradeColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// YudaoDemo03GradeColumns defines and stores column names for table yudao_demo03_grade.
|
||||
// YudaoDemo03GradeColumns defines and stores column names for the table yudao_demo03_grade.
|
||||
type YudaoDemo03GradeColumns struct {
|
||||
Id string // 编号
|
||||
StudentId string // 学生编号
|
||||
@@ -32,7 +33,7 @@ type YudaoDemo03GradeColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// yudaoDemo03GradeColumns holds the columns for table yudao_demo03_grade.
|
||||
// yudaoDemo03GradeColumns holds the columns for the table yudao_demo03_grade.
|
||||
var yudaoDemo03GradeColumns = YudaoDemo03GradeColumns{
|
||||
Id: "id",
|
||||
StudentId: "student_id",
|
||||
@@ -47,44 +48,49 @@ var yudaoDemo03GradeColumns = YudaoDemo03GradeColumns{
|
||||
}
|
||||
|
||||
// NewYudaoDemo03GradeDao creates and returns a new DAO object for table data access.
|
||||
func NewYudaoDemo03GradeDao() *YudaoDemo03GradeDao {
|
||||
func NewYudaoDemo03GradeDao(handlers ...gdb.ModelHandler) *YudaoDemo03GradeDao {
|
||||
return &YudaoDemo03GradeDao{
|
||||
group: "default",
|
||||
table: "yudao_demo03_grade",
|
||||
columns: yudaoDemo03GradeColumns,
|
||||
group: "default",
|
||||
table: "yudao_demo03_grade",
|
||||
columns: yudaoDemo03GradeColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *YudaoDemo03GradeDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *YudaoDemo03GradeDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *YudaoDemo03GradeDao) Columns() YudaoDemo03GradeColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *YudaoDemo03GradeDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *YudaoDemo03GradeDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// YudaoDemo03StudentDao is the data access object for table yudao_demo03_student.
|
||||
// YudaoDemo03StudentDao is the data access object for the 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 current DAO.
|
||||
columns YudaoDemo03StudentColumns // columns contains all the column names of Table for convenient usage.
|
||||
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.
|
||||
}
|
||||
|
||||
// YudaoDemo03StudentColumns defines and stores column names for table yudao_demo03_student.
|
||||
// YudaoDemo03StudentColumns defines and stores column names for the table yudao_demo03_student.
|
||||
type YudaoDemo03StudentColumns struct {
|
||||
Id string // 编号
|
||||
Name string // 名字
|
||||
@@ -33,7 +34,7 @@ type YudaoDemo03StudentColumns struct {
|
||||
TenantId string // 租户编号
|
||||
}
|
||||
|
||||
// yudaoDemo03StudentColumns holds the columns for table yudao_demo03_student.
|
||||
// yudaoDemo03StudentColumns holds the columns for the table yudao_demo03_student.
|
||||
var yudaoDemo03StudentColumns = YudaoDemo03StudentColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
@@ -49,44 +50,49 @@ var yudaoDemo03StudentColumns = YudaoDemo03StudentColumns{
|
||||
}
|
||||
|
||||
// NewYudaoDemo03StudentDao creates and returns a new DAO object for table data access.
|
||||
func NewYudaoDemo03StudentDao() *YudaoDemo03StudentDao {
|
||||
func NewYudaoDemo03StudentDao(handlers ...gdb.ModelHandler) *YudaoDemo03StudentDao {
|
||||
return &YudaoDemo03StudentDao{
|
||||
group: "default",
|
||||
table: "yudao_demo03_student",
|
||||
columns: yudaoDemo03StudentColumns,
|
||||
group: "default",
|
||||
table: "yudao_demo03_student",
|
||||
columns: yudaoDemo03StudentColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *YudaoDemo03StudentDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *YudaoDemo03StudentDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *YudaoDemo03StudentDao) Columns() YudaoDemo03StudentColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *YudaoDemo03StudentDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *YudaoDemo03StudentDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back 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)
|
||||
|
||||
Reference in New Issue
Block a user