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.
105 lines
3.5 KiB
105 lines
3.5 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" |
|
) |
|
|
|
// LoginLogoutInfoDao is the data access object for table login_logout_info. |
|
type LoginLogoutInfoDao 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 LoginLogoutInfoColumns // columns contains all the column names of Table for convenient usage. |
|
} |
|
|
|
// LoginLogoutInfoColumns defines and stores column names for table login_logout_info. |
|
type LoginLogoutInfoColumns struct { |
|
Id string // |
|
Uid string // |
|
State string // 1: 登录,2: 登出 |
|
CDate string // |
|
GameTime string // 游戏时间 |
|
Scale string // 规模 |
|
VillagerNum string // 村民数量 |
|
Prosperity string // 繁荣值 |
|
Copper string // 铜币 |
|
GoldIngot string // 桃花石 |
|
BaseFood string // 基础食物 |
|
Day string // 游戏天数 |
|
Server string // 区服 |
|
VouchersNum string // |
|
RechargeTotal string // |
|
StoreSum string // |
|
StoneAmount string // |
|
} |
|
|
|
// loginLogoutInfoColumns holds the columns for table login_logout_info. |
|
var loginLogoutInfoColumns = LoginLogoutInfoColumns{ |
|
Id: "id", |
|
Uid: "uid", |
|
State: "state", |
|
CDate: "c_date", |
|
GameTime: "game_time", |
|
Scale: "scale", |
|
VillagerNum: "villager_num", |
|
Prosperity: "prosperity", |
|
Copper: "copper", |
|
GoldIngot: "goldIngot", |
|
BaseFood: "base_food", |
|
Day: "day", |
|
Server: "server", |
|
VouchersNum: "vouchersNum", |
|
RechargeTotal: "rechargeTotal", |
|
StoreSum: "storeSum", |
|
StoneAmount: "stoneAmount", |
|
} |
|
|
|
// NewLoginLogoutInfoDao creates and returns a new DAO object for table data access. |
|
func NewLoginLogoutInfoDao() *LoginLogoutInfoDao { |
|
return &LoginLogoutInfoDao{ |
|
group: "default", |
|
table: "login_logout_info", |
|
columns: loginLogoutInfoColumns, |
|
} |
|
} |
|
|
|
// DB retrieves and returns the underlying raw database management object of current DAO. |
|
func (dao *LoginLogoutInfoDao) DB() gdb.DB { |
|
return g.DB(dao.group) |
|
} |
|
|
|
// Table returns the table name of current dao. |
|
func (dao *LoginLogoutInfoDao) Table() string { |
|
return dao.table |
|
} |
|
|
|
// Columns returns all column names of current dao. |
|
func (dao *LoginLogoutInfoDao) Columns() LoginLogoutInfoColumns { |
|
return dao.columns |
|
} |
|
|
|
// Group returns the configuration group name of database of current dao. |
|
func (dao *LoginLogoutInfoDao) Group() string { |
|
return dao.group |
|
} |
|
|
|
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. |
|
func (dao *LoginLogoutInfoDao) 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 *LoginLogoutInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) { |
|
return dao.Ctx(ctx).Transaction(ctx, f) |
|
}
|
|
|