102 lines
3.6 KiB
Go
102 lines
3.6 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"
|
|
)
|
|
|
|
// EpicArtifactInfoDao is the data access object for table epic_artifact_info.
|
|
type EpicArtifactInfoDao 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 EpicArtifactInfoColumns // columns contains all the column names of Table for convenient usage.
|
|
}
|
|
|
|
// EpicArtifactInfoColumns defines and stores column names for table epic_artifact_info.
|
|
type EpicArtifactInfoColumns struct {
|
|
Id string // 文件编号
|
|
ArtifactName string // 配置编号
|
|
ArtifactCode string // 文件名
|
|
Creator string // 创建者
|
|
CreateTime string // 创建时间
|
|
Updater string // 更新者
|
|
UpdateTime string // 更新时间
|
|
Deleted string // 是否删除
|
|
StatsHealth string // 文件路径
|
|
StatsAttack string // 文件路径
|
|
StatsDefense string // 文件路径
|
|
Rarity string // 文件路径
|
|
Role string // 文件路径
|
|
ArtifactNameEn string // 配置编号
|
|
ImageUrl string // 图片地址
|
|
}
|
|
|
|
// epicArtifactInfoColumns holds the columns for table epic_artifact_info.
|
|
var epicArtifactInfoColumns = EpicArtifactInfoColumns{
|
|
Id: "id",
|
|
ArtifactName: "artifact_name",
|
|
ArtifactCode: "artifact_code",
|
|
Creator: "creator",
|
|
CreateTime: "create_time",
|
|
Updater: "updater",
|
|
UpdateTime: "update_time",
|
|
Deleted: "deleted",
|
|
StatsHealth: "stats_health",
|
|
StatsAttack: "stats_attack",
|
|
StatsDefense: "stats_defense",
|
|
Rarity: "rarity",
|
|
Role: "role",
|
|
ArtifactNameEn: "artifact_name_en",
|
|
ImageUrl: "image_url",
|
|
}
|
|
|
|
// NewEpicArtifactInfoDao creates and returns a new DAO object for table data access.
|
|
func NewEpicArtifactInfoDao() *EpicArtifactInfoDao {
|
|
return &EpicArtifactInfoDao{
|
|
group: "default",
|
|
table: "epic_artifact_info",
|
|
columns: epicArtifactInfoColumns,
|
|
}
|
|
}
|
|
|
|
// DB retrieves and returns the underlying raw database management object of current DAO.
|
|
func (dao *EpicArtifactInfoDao) DB() gdb.DB {
|
|
return g.DB(dao.group)
|
|
}
|
|
|
|
// Table returns the table name of current dao.
|
|
func (dao *EpicArtifactInfoDao) Table() string {
|
|
return dao.table
|
|
}
|
|
|
|
// Columns returns all column names of current dao.
|
|
func (dao *EpicArtifactInfoDao) Columns() EpicArtifactInfoColumns {
|
|
return dao.columns
|
|
}
|
|
|
|
// Group returns the configuration group name of database of current dao.
|
|
func (dao *EpicArtifactInfoDao) Group() string {
|
|
return dao.group
|
|
}
|
|
|
|
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
|
func (dao *EpicArtifactInfoDao) 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 *EpicArtifactInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
|
return dao.Ctx(ctx).Transaction(ctx, f)
|
|
}
|