i18n翻译
This commit is contained in:
22
internal/dao/epic_i_18_n_mappings.go
Normal file
22
internal/dao/epic_i_18_n_mappings.go
Normal file
@@ -0,0 +1,22 @@
|
||||
// =================================================================================
|
||||
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||
// =================================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"epic/internal/dao/internal"
|
||||
)
|
||||
|
||||
// epicI18NMappingsDao is the data access object for the table epic_i18n_mappings.
|
||||
// You can define custom methods on it to extend its functionality as needed.
|
||||
type epicI18NMappingsDao struct {
|
||||
*internal.EpicI18NMappingsDao
|
||||
}
|
||||
|
||||
var (
|
||||
// EpicI18NMappings is a globally accessible object for table epic_i18n_mappings operations.
|
||||
EpicI18NMappings = epicI18NMappingsDao{internal.NewEpicI18NMappingsDao()}
|
||||
)
|
||||
|
||||
// Add your custom methods and functionality below.
|
||||
99
internal/dao/internal/epic_i_18_n_mappings.go
Normal file
99
internal/dao/internal/epic_i_18_n_mappings.go
Normal file
@@ -0,0 +1,99 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// EpicI18NMappingsDao is the data access object for the table epic_i18n_mappings.
|
||||
type EpicI18NMappingsDao 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 EpicI18NMappingsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// EpicI18NMappingsColumns defines and stores column names for the table epic_i18n_mappings.
|
||||
type EpicI18NMappingsColumns struct {
|
||||
Id string // 主键ID
|
||||
KeyName string // 英文key
|
||||
Language string // 语言代码(zh/en/ja/ko等)
|
||||
Value string // 翻译值
|
||||
Category string // 分类(hero/artifact/role/attribute等)
|
||||
Status string // 状态(1:启用 0:禁用)
|
||||
Creator string // 创建者
|
||||
CreateTime string // 创建时间
|
||||
Updater string // 更新者
|
||||
UpdateTime string // 更新时间
|
||||
Deleted string // 是否删除
|
||||
}
|
||||
|
||||
// epicI18NMappingsColumns holds the columns for the table epic_i18n_mappings.
|
||||
var epicI18NMappingsColumns = EpicI18NMappingsColumns{
|
||||
Id: "id",
|
||||
KeyName: "key_name",
|
||||
Language: "language",
|
||||
Value: "value",
|
||||
Category: "category",
|
||||
Status: "status",
|
||||
Creator: "creator",
|
||||
CreateTime: "create_time",
|
||||
Updater: "updater",
|
||||
UpdateTime: "update_time",
|
||||
Deleted: "deleted",
|
||||
}
|
||||
|
||||
// NewEpicI18NMappingsDao creates and returns a new DAO object for table data access.
|
||||
func NewEpicI18NMappingsDao(handlers ...gdb.ModelHandler) *EpicI18NMappingsDao {
|
||||
return &EpicI18NMappingsDao{
|
||||
group: "default",
|
||||
table: "epic_i18n_mappings",
|
||||
columns: epicI18NMappingsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *EpicI18NMappingsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *EpicI18NMappingsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *EpicI18NMappingsDao) Columns() EpicI18NMappingsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *EpicI18NMappingsDao) 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 *EpicI18NMappingsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.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 *EpicI18NMappingsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
Reference in New Issue
Block a user