// ========================================================================== // 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" ) // StoreClientSessionsDao is the data access object for the table store_client_sessions. type StoreClientSessionsDao 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 StoreClientSessionsColumns // columns contains all the column names of Table for convenient usage. } // StoreClientSessionsColumns defines and stores column names for the table store_client_sessions. type StoreClientSessionsColumns struct { Id string // 记录ID StoreId string // 所属门店ID ClientId string // 客户机ID AreaId string // 所属区域ID XyUserId string // 系统唯一用户ID LevelId string // 会员等级ID(如0表示临时卡) LevelName string // 会员等级名称 StartTime string // 上机时间 EndTime string // 下机时间 UsedTime string // 使用时长(分钟) CreatedAt string // 创建时间 UpdatedAt string // 更新时间 DeletedAt string // 软删除时间戳 AreaName string // } // storeClientSessionsColumns holds the columns for the table store_client_sessions. var storeClientSessionsColumns = StoreClientSessionsColumns{ Id: "id", StoreId: "store_id", ClientId: "client_id", AreaId: "area_id", XyUserId: "xy_user_id", LevelId: "level_id", LevelName: "level_name", StartTime: "start_time", EndTime: "end_time", UsedTime: "used_time", CreatedAt: "created_at", UpdatedAt: "updated_at", DeletedAt: "deleted_at", AreaName: "area_name", } // NewStoreClientSessionsDao creates and returns a new DAO object for table data access. func NewStoreClientSessionsDao() *StoreClientSessionsDao { return &StoreClientSessionsDao{ group: "default", table: "store_client_sessions", columns: storeClientSessionsColumns, } } // DB retrieves and returns the underlying raw database management object of the current DAO. func (dao *StoreClientSessionsDao) DB() gdb.DB { return g.DB(dao.group) } // Table returns the table name of the current DAO. func (dao *StoreClientSessionsDao) Table() string { return dao.table } // Columns returns all column names of the current DAO. func (dao *StoreClientSessionsDao) Columns() StoreClientSessionsColumns { return dao.columns } // Group returns the database configuration group name of the current DAO. func (dao *StoreClientSessionsDao) 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 *StoreClientSessionsDao) Ctx(ctx context.Context) *gdb.Model { return dao.DB().Model(dao.table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. // It rolls back the transaction and returns the error if function f returns a non-nil error. // It 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 *StoreClientSessionsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) }