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)
|
||||||
|
}
|
||||||
26
internal/model/do/epic_i_18_n_mappings.go
Normal file
26
internal/model/do/epic_i_18_n_mappings.go
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
// =================================================================================
|
||||||
|
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||||
|
// =================================================================================
|
||||||
|
|
||||||
|
package do
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gogf/gf/v2/frame/g"
|
||||||
|
"github.com/gogf/gf/v2/os/gtime"
|
||||||
|
)
|
||||||
|
|
||||||
|
// EpicI18NMappings is the golang structure of table epic_i18n_mappings for DAO operations like Where/Data.
|
||||||
|
type EpicI18NMappings struct {
|
||||||
|
g.Meta `orm:"table:epic_i18n_mappings, do:true"`
|
||||||
|
Id interface{} // 主键ID
|
||||||
|
KeyName interface{} // 英文key
|
||||||
|
Language interface{} // 语言代码(zh/en/ja/ko等)
|
||||||
|
Value interface{} // 翻译值
|
||||||
|
Category interface{} // 分类(hero/artifact/role/attribute等)
|
||||||
|
Status interface{} // 状态(1:启用 0:禁用)
|
||||||
|
Creator interface{} // 创建者
|
||||||
|
CreateTime *gtime.Time // 创建时间
|
||||||
|
Updater interface{} // 更新者
|
||||||
|
UpdateTime *gtime.Time // 更新时间
|
||||||
|
Deleted interface{} // 是否删除
|
||||||
|
}
|
||||||
24
internal/model/entity/epic_i_18_n_mappings.go
Normal file
24
internal/model/entity/epic_i_18_n_mappings.go
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
// =================================================================================
|
||||||
|
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||||
|
// =================================================================================
|
||||||
|
|
||||||
|
package entity
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gogf/gf/v2/os/gtime"
|
||||||
|
)
|
||||||
|
|
||||||
|
// EpicI18NMappings is the golang structure for table epic_i18n_mappings.
|
||||||
|
type EpicI18NMappings struct {
|
||||||
|
Id int64 `json:"id" orm:"id" description:"主键ID"` // 主键ID
|
||||||
|
KeyName string `json:"keyName" orm:"key_name" description:"英文key"` // 英文key
|
||||||
|
Language string `json:"language" orm:"language" description:"语言代码(zh/en/ja/ko等)"` // 语言代码(zh/en/ja/ko等)
|
||||||
|
Value string `json:"value" orm:"value" description:"翻译值"` // 翻译值
|
||||||
|
Category string `json:"category" orm:"category" description:"分类(hero/artifact/role/attribute等)"` // 分类(hero/artifact/role/attribute等)
|
||||||
|
Status int `json:"status" orm:"status" description:"状态(1:启用 0:禁用)"` // 状态(1:启用 0:禁用)
|
||||||
|
Creator string `json:"creator" orm:"creator" description:"创建者"` // 创建者
|
||||||
|
CreateTime *gtime.Time `json:"createTime" orm:"create_time" description:"创建时间"` // 创建时间
|
||||||
|
Updater string `json:"updater" orm:"updater" description:"更新者"` // 更新者
|
||||||
|
UpdateTime *gtime.Time `json:"updateTime" orm:"update_time" description:"更新时间"` // 更新时间
|
||||||
|
Deleted int `json:"deleted" orm:"deleted" description:"是否删除"` // 是否删除
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user