Files
epic-go/internal/dao/internal/fribble_hero_set.go
hu xiaotong 85e3a6540b init
2025-06-20 17:17:02 +08:00

98 lines
3.3 KiB
Go

// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// 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 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 the table fribble_hero_set.
type FribbleHeroSetColumns struct {
Id string // 文件编号
HeroCode string // 配置编号
JsonContent string // 文件名
HeroName string // 文件路径
Creator string // 创建者
CreateTime string // 创建时间
Updater string // 更新者
UpdateTime string // 更新时间
Deleted string // 是否删除
SuccessGet string //
}
// fribbleHeroSetColumns holds the columns for the table fribble_hero_set.
var fribbleHeroSetColumns = FribbleHeroSetColumns{
Id: "id",
HeroCode: "hero_code",
JsonContent: "json_content",
HeroName: "hero_name",
Creator: "creator",
CreateTime: "create_time",
Updater: "updater",
UpdateTime: "update_time",
Deleted: "deleted",
SuccessGet: "success_get",
}
// NewFribbleHeroSetDao creates and returns a new DAO object for table data access.
func NewFribbleHeroSetDao(handlers ...gdb.ModelHandler) *FribbleHeroSetDao {
return &FribbleHeroSetDao{
group: "default",
table: "fribble_hero_set",
columns: fribbleHeroSetColumns,
handlers: handlers,
}
}
// 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 the current DAO.
func (dao *FribbleHeroSetDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *FribbleHeroSetDao) Columns() FribbleHeroSetColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *FribbleHeroSetDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *FribbleHeroSetDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// 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)
}