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.
95 lines
2.9 KiB
95 lines
2.9 KiB
// ==========================================================================
|
|
// 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"
|
|
)
|
|
|
|
// PlayerDao is the data access object for table cms_player.
|
|
type PlayerDao 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 PlayerColumns // columns contains all the column names of Table for convenient usage.
|
|
}
|
|
|
|
// PlayerColumns defines and stores column names for table cms_player.
|
|
type PlayerColumns struct {
|
|
Id string //
|
|
Status string // 状态
|
|
From string // 编码格式
|
|
Name string // 名称
|
|
Target string // 目标窗口
|
|
Parse string // 解析状态
|
|
ParseApi string // 解析地址
|
|
Sort string // 排序
|
|
Tip string // 提示
|
|
Filename string // 文件名称
|
|
Code string // 编码
|
|
Remark string // 备注
|
|
}
|
|
|
|
// playerColumns holds the columns for table cms_player.
|
|
var playerColumns = PlayerColumns{
|
|
Id: "id",
|
|
Status: "status",
|
|
From: "from",
|
|
Name: "name",
|
|
Target: "target",
|
|
Parse: "parse",
|
|
ParseApi: "parse_api",
|
|
Sort: "sort",
|
|
Tip: "tip",
|
|
Filename: "filename",
|
|
Code: "code",
|
|
Remark: "remark",
|
|
}
|
|
|
|
// NewPlayerDao creates and returns a new DAO object for table data access.
|
|
func NewPlayerDao() *PlayerDao {
|
|
return &PlayerDao{
|
|
group: "cms",
|
|
table: "cms_player",
|
|
columns: playerColumns,
|
|
}
|
|
}
|
|
|
|
// DB retrieves and returns the underlying raw database management object of current DAO.
|
|
func (dao *PlayerDao) DB() gdb.DB {
|
|
return g.DB(dao.group)
|
|
}
|
|
|
|
// Table returns the table name of current dao.
|
|
func (dao *PlayerDao) Table() string {
|
|
return dao.table
|
|
}
|
|
|
|
// Columns returns all column names of current dao.
|
|
func (dao *PlayerDao) Columns() PlayerColumns {
|
|
return dao.columns
|
|
}
|
|
|
|
// Group returns the configuration group name of database of current dao.
|
|
func (dao *PlayerDao) Group() string {
|
|
return dao.group
|
|
}
|
|
|
|
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
|
func (dao *PlayerDao) 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 *PlayerDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
|
return dao.Ctx(ctx).Transaction(ctx, f)
|
|
}
|