You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
3.2 KiB

// ==========================================================================
// Code generated 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"
)
// GameUnitCopy2Dao is the data access object for table game_unit_copy2.
type GameUnitCopy2Dao 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 GameUnitCopy2Columns // columns contains all the column names of Table for convenient usage.
}
// GameUnitCopy2Columns defines and stores column names for table game_unit_copy2.
type GameUnitCopy2Columns struct {
Id string //
Account string //
Channel string //
Uid string //
Server string //
Scale string //
Name string //
LogTime string //
CreateTime string // 账号创建时间
VillagerNum string // 村民数量
Prosperity string // 繁荣值
GoldIngot string // 桃花石
BaseFood string // 基础食物
Day string // 游戏天数
Recharge string // 充值
}
// gameUnitCopy2Columns holds the columns for table game_unit_copy2.
var gameUnitCopy2Columns = GameUnitCopy2Columns{
Id: "id",
Account: "account",
Channel: "channel",
Uid: "uid",
Server: "server",
Scale: "scale",
Name: "name",
LogTime: "logTime",
CreateTime: "create_time",
VillagerNum: "villager_num",
Prosperity: "prosperity",
GoldIngot: "goldIngot",
BaseFood: "base_food",
Day: "day",
Recharge: "recharge",
}
// NewGameUnitCopy2Dao creates and returns a new DAO object for table data access.
func NewGameUnitCopy2Dao() *GameUnitCopy2Dao {
return &GameUnitCopy2Dao{
group: "default",
table: "game_unit_copy2",
columns: gameUnitCopy2Columns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *GameUnitCopy2Dao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *GameUnitCopy2Dao) Table() string {
return dao.table
}
// Columns returns all column names of current dao.
func (dao *GameUnitCopy2Dao) Columns() GameUnitCopy2Columns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *GameUnitCopy2Dao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *GameUnitCopy2Dao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).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 commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *GameUnitCopy2Dao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}