签入版本
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// ArticleDao is the data access object for the table goframe_article.
|
||||
type ArticleDao 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 ArticleColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// ArticleColumns defines and stores column names for the table goframe_article.
|
||||
type ArticleColumns struct {
|
||||
Id string // 主键ID
|
||||
TenantId string // 租户ID:0=平台级
|
||||
CategoryId string // 分类ID
|
||||
Title string // 文章标题
|
||||
Cover string // 文章封面
|
||||
Images string // 文章图集
|
||||
Intro string // 文章导读
|
||||
Content string // 文章内容
|
||||
Author string // 文章作者
|
||||
Status string // 文章状态:0-正常 1-下架
|
||||
Click string // 文章点击率
|
||||
Sort string // 文章排序
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// articleColumns holds the columns for the table goframe_article.
|
||||
var articleColumns = ArticleColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
CategoryId: "category_id",
|
||||
Title: "title",
|
||||
Cover: "cover",
|
||||
Images: "images",
|
||||
Intro: "intro",
|
||||
Content: "content",
|
||||
Author: "author",
|
||||
Status: "status",
|
||||
Click: "click",
|
||||
Sort: "sort",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewArticleDao creates and returns a new DAO object for table data access.
|
||||
func NewArticleDao(handlers ...gdb.ModelHandler) *ArticleDao {
|
||||
return &ArticleDao{
|
||||
group: "default",
|
||||
table: "goframe_article",
|
||||
columns: articleColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *ArticleDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *ArticleDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *ArticleDao) Columns() ArticleColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *ArticleDao) 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 *ArticleDao) 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 *ArticleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// CategoryDao is the data access object for the table goframe_category.
|
||||
type CategoryDao 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 CategoryColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// CategoryColumns defines and stores column names for the table goframe_category.
|
||||
type CategoryColumns struct {
|
||||
Id string // 主键ID
|
||||
TenantId string // 租户ID:0=平台级
|
||||
CategoryName string // 分类名称
|
||||
CategoryCode string // 分类编码
|
||||
ParentId string // 上级ID
|
||||
Sort string // 排序
|
||||
Note string // 分类备注
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// categoryColumns holds the columns for the table goframe_category.
|
||||
var categoryColumns = CategoryColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
CategoryName: "category_name",
|
||||
CategoryCode: "category_code",
|
||||
ParentId: "parent_id",
|
||||
Sort: "sort",
|
||||
Note: "note",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewCategoryDao creates and returns a new DAO object for table data access.
|
||||
func NewCategoryDao(handlers ...gdb.ModelHandler) *CategoryDao {
|
||||
return &CategoryDao{
|
||||
group: "default",
|
||||
table: "goframe_category",
|
||||
columns: categoryColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *CategoryDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *CategoryDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *CategoryDao) Columns() CategoryColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *CategoryDao) 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 *CategoryDao) 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 *CategoryDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// CityDao is the data access object for the table goframe_city.
|
||||
type CityDao 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 CityColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// CityColumns defines and stores column names for the table goframe_city.
|
||||
type CityColumns struct {
|
||||
Id string // 主键ID
|
||||
CityCode string // 城市区号
|
||||
AreaCode string // 行政编码
|
||||
ParentCode string // 上级行政编码
|
||||
ZipCode string // 邮政编码
|
||||
Level string // 城市级别:0-省份 1-城市 2-县区 3-街道 4-社区
|
||||
Pid string // 上级城市ID
|
||||
Name string // 城市名称
|
||||
ShortName string // 城市简称
|
||||
FullName string // 城市全称
|
||||
Pinyin string // 城市拼音
|
||||
Lng string // 城市经度
|
||||
Lat string // 城市纬度
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// cityColumns holds the columns for the table goframe_city.
|
||||
var cityColumns = CityColumns{
|
||||
Id: "id",
|
||||
CityCode: "city_code",
|
||||
AreaCode: "area_code",
|
||||
ParentCode: "parent_code",
|
||||
ZipCode: "zip_code",
|
||||
Level: "level",
|
||||
Pid: "pid",
|
||||
Name: "name",
|
||||
ShortName: "short_name",
|
||||
FullName: "full_name",
|
||||
Pinyin: "pinyin",
|
||||
Lng: "lng",
|
||||
Lat: "lat",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewCityDao creates and returns a new DAO object for table data access.
|
||||
func NewCityDao(handlers ...gdb.ModelHandler) *CityDao {
|
||||
return &CityDao{
|
||||
group: "default",
|
||||
table: "goframe_city",
|
||||
columns: cityColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *CityDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *CityDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *CityDao) Columns() CityColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *CityDao) 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 *CityDao) 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 *CityDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// ConfigDao is the data access object for the table goframe_config.
|
||||
type ConfigDao 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 ConfigColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// ConfigColumns defines and stores column names for the table goframe_config.
|
||||
type ConfigColumns struct {
|
||||
Id string // 主键ID
|
||||
Name string // 配置名称
|
||||
Code string // 配置编码
|
||||
Sort string // 配置排序
|
||||
Note string // 配置备注
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// configColumns holds the columns for the table goframe_config.
|
||||
var configColumns = ConfigColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
Code: "code",
|
||||
Sort: "sort",
|
||||
Note: "note",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewConfigDao creates and returns a new DAO object for table data access.
|
||||
func NewConfigDao(handlers ...gdb.ModelHandler) *ConfigDao {
|
||||
return &ConfigDao{
|
||||
group: "default",
|
||||
table: "goframe_config",
|
||||
columns: configColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *ConfigDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *ConfigDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *ConfigDao) Columns() ConfigColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *ConfigDao) 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 *ConfigDao) 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 *ConfigDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// ConfigItemDao is the data access object for the table goframe_config_item.
|
||||
type ConfigItemDao 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 ConfigItemColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// ConfigItemColumns defines and stores column names for the table goframe_config_item.
|
||||
type ConfigItemColumns struct {
|
||||
Id string // 主键ID
|
||||
Name string // 配置项名称
|
||||
Code string // 配置项编码
|
||||
Value string // 配置项值
|
||||
Options string // 配置选项
|
||||
ConfigId string // 配置ID
|
||||
Type string // 配置类型
|
||||
Status string // 配置状态:1-正常 2-停用
|
||||
Sort string // 配置项顺序
|
||||
Note string // 配置项备注
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// configItemColumns holds the columns for the table goframe_config_item.
|
||||
var configItemColumns = ConfigItemColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
Code: "code",
|
||||
Value: "value",
|
||||
Options: "options",
|
||||
ConfigId: "config_id",
|
||||
Type: "type",
|
||||
Status: "status",
|
||||
Sort: "sort",
|
||||
Note: "note",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewConfigItemDao creates and returns a new DAO object for table data access.
|
||||
func NewConfigItemDao(handlers ...gdb.ModelHandler) *ConfigItemDao {
|
||||
return &ConfigItemDao{
|
||||
group: "default",
|
||||
table: "goframe_config_item",
|
||||
columns: configItemColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *ConfigItemDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *ConfigItemDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *ConfigItemDao) Columns() ConfigItemColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *ConfigItemDao) 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 *ConfigItemDao) 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 *ConfigItemDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// DeptDao is the data access object for the table goframe_dept.
|
||||
type DeptDao 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 DeptColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// DeptColumns defines and stores column names for the table goframe_dept.
|
||||
type DeptColumns struct {
|
||||
Id string // 主键ID
|
||||
TenantId string // 租户ID:0=平台级
|
||||
Name string // 部门名称
|
||||
Type string // 部门类型:1-公司 2-子公司 3-部门 4-小组
|
||||
ParentId string // 上级部门ID
|
||||
Sort string // 部门排序
|
||||
Note string // 备注
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// deptColumns holds the columns for the table goframe_dept.
|
||||
var deptColumns = DeptColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
Name: "name",
|
||||
Type: "type",
|
||||
ParentId: "parent_id",
|
||||
Sort: "sort",
|
||||
Note: "note",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewDeptDao creates and returns a new DAO object for table data access.
|
||||
func NewDeptDao(handlers ...gdb.ModelHandler) *DeptDao {
|
||||
return &DeptDao{
|
||||
group: "default",
|
||||
table: "goframe_dept",
|
||||
columns: deptColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *DeptDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *DeptDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *DeptDao) Columns() DeptColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *DeptDao) 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 *DeptDao) 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 *DeptDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// DictDao is the data access object for the table goframe_dict.
|
||||
type DictDao 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 DictColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// DictColumns defines and stores column names for the table goframe_dict.
|
||||
type DictColumns struct {
|
||||
Id string // 主键ID
|
||||
Name string // 字典名称
|
||||
Code string // 字典编码
|
||||
Sort string // 字典排序
|
||||
Note string // 字典备注
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// dictColumns holds the columns for the table goframe_dict.
|
||||
var dictColumns = DictColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
Code: "code",
|
||||
Sort: "sort",
|
||||
Note: "note",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewDictDao creates and returns a new DAO object for table data access.
|
||||
func NewDictDao(handlers ...gdb.ModelHandler) *DictDao {
|
||||
return &DictDao{
|
||||
group: "default",
|
||||
table: "goframe_dict",
|
||||
columns: dictColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *DictDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *DictDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *DictDao) Columns() DictColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *DictDao) 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 *DictDao) 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 *DictDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
// DictItemDao is the data access object for the table goframe_dict_item.
|
||||
type DictItemDao 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 DictItemColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// DictItemColumns defines and stores column names for the table goframe_dict_item.
|
||||
type DictItemColumns struct {
|
||||
Id string // 主键ID
|
||||
Name string // 字典项名称
|
||||
Value string // 字典项值
|
||||
DictId string // 字典ID
|
||||
Sort string // 字典项顺序
|
||||
Note string // 字典项备注
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// dictItemColumns holds the columns for the table goframe_dict_item.
|
||||
var dictItemColumns = DictItemColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
Value: "value",
|
||||
DictId: "dict_id",
|
||||
Sort: "sort",
|
||||
Note: "note",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewDictItemDao creates and returns a new DAO object for table data access.
|
||||
func NewDictItemDao(handlers ...gdb.ModelHandler) *DictItemDao {
|
||||
return &DictItemDao{
|
||||
group: "default",
|
||||
table: "goframe_dict_item",
|
||||
columns: dictItemColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *DictItemDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *DictItemDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *DictItemDao) Columns() DictItemColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *DictItemDao) 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 *DictItemDao) 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 *DictItemDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
// ExampleDao is the data access object for the table goframe_example.
|
||||
type ExampleDao 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 ExampleColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// ExampleColumns defines and stores column names for the table goframe_example.
|
||||
type ExampleColumns struct {
|
||||
Id string // 主键ID
|
||||
Name string // 案例名称
|
||||
Avatar string // 案例图片
|
||||
Type string // 案例类型:1-类型1 2-类型2 3-类型3 4-类型4
|
||||
Status string // 案例状态:1-在用 2-停用
|
||||
Sort string // 案例排序
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// exampleColumns holds the columns for the table goframe_example.
|
||||
var exampleColumns = ExampleColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
Avatar: "avatar",
|
||||
Type: "type",
|
||||
Status: "status",
|
||||
Sort: "sort",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewExampleDao creates and returns a new DAO object for table data access.
|
||||
func NewExampleDao(handlers ...gdb.ModelHandler) *ExampleDao {
|
||||
return &ExampleDao{
|
||||
group: "default",
|
||||
table: "goframe_example",
|
||||
columns: exampleColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *ExampleDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *ExampleDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *ExampleDao) Columns() ExampleColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *ExampleDao) 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 *ExampleDao) 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 *ExampleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// FileTemplateDao is the data access object for the table goframe_file_template.
|
||||
type FileTemplateDao 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 FileTemplateColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// FileTemplateColumns defines and stores column names for the table goframe_file_template.
|
||||
type FileTemplateColumns struct {
|
||||
Id string // 主键ID
|
||||
Name string // 模板名称
|
||||
Code string // 模板编码
|
||||
FileName string // 文件名称
|
||||
FilePath string // 文件路径
|
||||
Note string // 文件模板备注
|
||||
Sort string // 文件模板顺序
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// fileTemplateColumns holds the columns for the table goframe_file_template.
|
||||
var fileTemplateColumns = FileTemplateColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
Code: "code",
|
||||
FileName: "file_name",
|
||||
FilePath: "file_path",
|
||||
Note: "note",
|
||||
Sort: "sort",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewFileTemplateDao creates and returns a new DAO object for table data access.
|
||||
func NewFileTemplateDao(handlers ...gdb.ModelHandler) *FileTemplateDao {
|
||||
return &FileTemplateDao{
|
||||
group: "default",
|
||||
table: "goframe_file_template",
|
||||
columns: fileTemplateColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *FileTemplateDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *FileTemplateDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *FileTemplateDao) Columns() FileTemplateColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *FileTemplateDao) 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 *FileTemplateDao) 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 *FileTemplateDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// JobDao is the data access object for the table goframe_job.
|
||||
type JobDao 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 JobColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// JobColumns defines and stores column names for the table goframe_job.
|
||||
type JobColumns struct {
|
||||
Id string // 主键ID
|
||||
JobName string // 任务名称
|
||||
JobAlias string // 任务别名
|
||||
JobGroup string // 任务分组
|
||||
JobTrigger string // 任务触发器
|
||||
Status string // 任务状态:0-未发布 1-运行中 2-暂停 3-删除
|
||||
CronExpression string // Cron表达式
|
||||
ExecutePolicy string // 执行策略:1-立即执行 2-执行一次 3-放弃执行
|
||||
IsSync string // 是否同步任务:0-否 1-是
|
||||
Url string // 任务URL
|
||||
Params string // 任务参数
|
||||
Note string // 任务备注
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// jobColumns holds the columns for the table goframe_job.
|
||||
var jobColumns = JobColumns{
|
||||
Id: "id",
|
||||
JobName: "job_name",
|
||||
JobAlias: "job_alias",
|
||||
JobGroup: "job_group",
|
||||
JobTrigger: "job_trigger",
|
||||
Status: "status",
|
||||
CronExpression: "cron_expression",
|
||||
ExecutePolicy: "execute_policy",
|
||||
IsSync: "is_sync",
|
||||
Url: "url",
|
||||
Params: "params",
|
||||
Note: "note",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewJobDao creates and returns a new DAO object for table data access.
|
||||
func NewJobDao(handlers ...gdb.ModelHandler) *JobDao {
|
||||
return &JobDao{
|
||||
group: "default",
|
||||
table: "goframe_job",
|
||||
columns: jobColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *JobDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *JobDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *JobDao) Columns() JobColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *JobDao) 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 *JobDao) 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 *JobDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// JobLogDao is the data access object for the table goframe_job_log.
|
||||
type JobLogDao 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 JobLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// JobLogColumns defines and stores column names for the table goframe_job_log.
|
||||
type JobLogColumns struct {
|
||||
Id string // 主键ID
|
||||
JobId string // 任务ID
|
||||
JobName string // 任务名称
|
||||
JobGroup string // 任务分组
|
||||
JobTrigger string // 任务触发器
|
||||
JobMessage string // 任务日志信息
|
||||
CronExpression string // Cron表达式
|
||||
Status string // 执行状态:0-正常 1-失败
|
||||
StartTime string // 执行开始时间
|
||||
EndTime string // 执行结束时间
|
||||
ConsumeTime string // 执行耗时,单位:毫秒
|
||||
ExceptionInfo string // 异常信息
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// jobLogColumns holds the columns for the table goframe_job_log.
|
||||
var jobLogColumns = JobLogColumns{
|
||||
Id: "id",
|
||||
JobId: "job_id",
|
||||
JobName: "job_name",
|
||||
JobGroup: "job_group",
|
||||
JobTrigger: "job_trigger",
|
||||
JobMessage: "job_message",
|
||||
CronExpression: "cron_expression",
|
||||
Status: "status",
|
||||
StartTime: "start_time",
|
||||
EndTime: "end_time",
|
||||
ConsumeTime: "consume_time",
|
||||
ExceptionInfo: "exception_info",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewJobLogDao creates and returns a new DAO object for table data access.
|
||||
func NewJobLogDao(handlers ...gdb.ModelHandler) *JobLogDao {
|
||||
return &JobLogDao{
|
||||
group: "default",
|
||||
table: "goframe_job_log",
|
||||
columns: jobLogColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *JobLogDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *JobLogDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *JobLogDao) Columns() JobLogColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *JobLogDao) 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 *JobLogDao) 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 *JobLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// LevelDao is the data access object for the table goframe_level.
|
||||
type LevelDao 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 LevelColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// LevelColumns defines and stores column names for the table goframe_level.
|
||||
type LevelColumns struct {
|
||||
Id string // 主键ID
|
||||
TenantId string // 租户ID:0=平台级
|
||||
Name string // 职级名称
|
||||
Status string // 职级状态:1-在用 2-停用
|
||||
Sort string // 职级排序
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// levelColumns holds the columns for the table goframe_level.
|
||||
var levelColumns = LevelColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
Name: "name",
|
||||
Status: "status",
|
||||
Sort: "sort",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewLevelDao creates and returns a new DAO object for table data access.
|
||||
func NewLevelDao(handlers ...gdb.ModelHandler) *LevelDao {
|
||||
return &LevelDao{
|
||||
group: "default",
|
||||
table: "goframe_level",
|
||||
columns: levelColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *LevelDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *LevelDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *LevelDao) Columns() LevelColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *LevelDao) 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 *LevelDao) 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 *LevelDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// LinkDao is the data access object for the table goframe_link.
|
||||
type LinkDao 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 LinkColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// LinkColumns defines and stores column names for the table goframe_link.
|
||||
type LinkColumns struct {
|
||||
Id string // 主键ID
|
||||
TenantId string // 租户ID:0=平台级
|
||||
Name string // 友链名称
|
||||
Type string // 友链类型:1-友情链接 2-合作伙伴
|
||||
Url string // 友链URL
|
||||
Form string // 友链形式:1-文字链接 2-图片链接
|
||||
Image string // 友链图片
|
||||
Status string // 友链状态:1-正常 2-停用
|
||||
Sort string // 友链顺序
|
||||
Note string // 友链备注
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// linkColumns holds the columns for the table goframe_link.
|
||||
var linkColumns = LinkColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
Name: "name",
|
||||
Type: "type",
|
||||
Url: "url",
|
||||
Form: "form",
|
||||
Image: "image",
|
||||
Status: "status",
|
||||
Sort: "sort",
|
||||
Note: "note",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewLinkDao creates and returns a new DAO object for table data access.
|
||||
func NewLinkDao(handlers ...gdb.ModelHandler) *LinkDao {
|
||||
return &LinkDao{
|
||||
group: "default",
|
||||
table: "goframe_link",
|
||||
columns: linkColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *LinkDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *LinkDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *LinkDao) Columns() LinkColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *LinkDao) 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 *LinkDao) 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 *LinkDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// LoginLogDao is the data access object for the table goframe_login_log.
|
||||
type LoginLogDao 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 LoginLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// LoginLogColumns defines and stores column names for the table goframe_login_log.
|
||||
type LoginLogColumns struct {
|
||||
Id string // 主键ID
|
||||
Username string // 登录账号
|
||||
LogType string // 日志类型:1-登录,2-退出
|
||||
Source string // 登录来源:0-后台,1-前台
|
||||
Method string // 请求方法
|
||||
RequestMethod string // 请求方式
|
||||
Url string // 请求URL
|
||||
Param string // 请求参数
|
||||
Result string // 返回结果
|
||||
Ip string // IP地址
|
||||
Location string // IP归属地
|
||||
Os string // 操作系统
|
||||
Browser string // 浏览器
|
||||
ConsumeTime string // 请求耗时
|
||||
Status string // 操作状态:0-正常,1-异常
|
||||
Error string // 错误信息
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// loginLogColumns holds the columns for the table goframe_login_log.
|
||||
var loginLogColumns = LoginLogColumns{
|
||||
Id: "id",
|
||||
Username: "username",
|
||||
LogType: "log_type",
|
||||
Source: "source",
|
||||
Method: "method",
|
||||
RequestMethod: "request_method",
|
||||
Url: "url",
|
||||
Param: "param",
|
||||
Result: "result",
|
||||
Ip: "ip",
|
||||
Location: "location",
|
||||
Os: "os",
|
||||
Browser: "browser",
|
||||
ConsumeTime: "consume_time",
|
||||
Status: "status",
|
||||
Error: "error",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewLoginLogDao creates and returns a new DAO object for table data access.
|
||||
func NewLoginLogDao(handlers ...gdb.ModelHandler) *LoginLogDao {
|
||||
return &LoginLogDao{
|
||||
group: "default",
|
||||
table: "goframe_login_log",
|
||||
columns: loginLogColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *LoginLogDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *LoginLogDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *LoginLogDao) Columns() LoginLogColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *LoginLogDao) 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 *LoginLogDao) 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 *LoginLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// MenuDao is the data access object for the table goframe_menu.
|
||||
type MenuDao 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 MenuColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// MenuColumns defines and stores column names for the table goframe_menu.
|
||||
type MenuColumns struct {
|
||||
Id string // 主键ID
|
||||
Name string // 菜单名称
|
||||
Icon string // 菜单图标
|
||||
Icon2 string // 菜单图标
|
||||
ParentId string // 上级ID
|
||||
Path string // 菜单路径
|
||||
Component string // 菜单组件
|
||||
Permission string // 权限节点
|
||||
Target string // 打开方式:0-组件 1-内链 2-外链
|
||||
Type string // 菜单类型:0-菜单 1-节点
|
||||
Status string // 菜单状态:0-正常 1-停用
|
||||
Hide string // 是否可见:0-可见 1-不可见
|
||||
Sort string // 排序
|
||||
Note string // 备注
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// menuColumns holds the columns for the table goframe_menu.
|
||||
var menuColumns = MenuColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
Icon: "icon",
|
||||
Icon2: "icon2",
|
||||
ParentId: "parent_id",
|
||||
Path: "path",
|
||||
Component: "component",
|
||||
Permission: "permission",
|
||||
Target: "target",
|
||||
Type: "type",
|
||||
Status: "status",
|
||||
Hide: "hide",
|
||||
Sort: "sort",
|
||||
Note: "note",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewMenuDao creates and returns a new DAO object for table data access.
|
||||
func NewMenuDao(handlers ...gdb.ModelHandler) *MenuDao {
|
||||
return &MenuDao{
|
||||
group: "default",
|
||||
table: "goframe_menu",
|
||||
columns: menuColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *MenuDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *MenuDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *MenuDao) Columns() MenuColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *MenuDao) 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 *MenuDao) 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 *MenuDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NoticeDao is the data access object for the table goframe_notice.
|
||||
type NoticeDao 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 NoticeColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// NoticeColumns defines and stores column names for the table goframe_notice.
|
||||
type NoticeColumns struct {
|
||||
Id string // 主键ID
|
||||
TenantId string // 租户ID:0=平台级
|
||||
Title string // 通知标题
|
||||
Cover string // 通知封面
|
||||
Type string // 通知类型:1-通知 2-公告
|
||||
ClickNum string // 点击率
|
||||
Status string // 通知状态:1-正常 2-停用
|
||||
Content string // 通知公告内容
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// noticeColumns holds the columns for the table goframe_notice.
|
||||
var noticeColumns = NoticeColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
Title: "title",
|
||||
Cover: "cover",
|
||||
Type: "type",
|
||||
ClickNum: "click_num",
|
||||
Status: "status",
|
||||
Content: "content",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewNoticeDao creates and returns a new DAO object for table data access.
|
||||
func NewNoticeDao(handlers ...gdb.ModelHandler) *NoticeDao {
|
||||
return &NoticeDao{
|
||||
group: "default",
|
||||
table: "goframe_notice",
|
||||
columns: noticeColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *NoticeDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *NoticeDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *NoticeDao) Columns() NoticeColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *NoticeDao) 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 *NoticeDao) 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 *NoticeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// OperationLogDao is the data access object for the table goframe_operation_log.
|
||||
type OperationLogDao 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 OperationLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// OperationLogColumns defines and stores column names for the table goframe_operation_log.
|
||||
type OperationLogColumns struct {
|
||||
Id string // 主键ID
|
||||
Title string // 请求标题
|
||||
Type string // 请求类型
|
||||
Source string // 请求来源:0-后台,1-前台
|
||||
Method string // 请求方法
|
||||
RequestMethod string // 请求方式
|
||||
Url string // 请求URL
|
||||
Param string // 请求参数
|
||||
Result string // 请求结果
|
||||
Ip string // 请求IP
|
||||
Location string // 请求所在区域
|
||||
Os string // 操作系统
|
||||
Browser string // 浏览器
|
||||
ConsumeTime string // 请求耗时
|
||||
Status string // 请求状态:0-正常,1-异常
|
||||
Error string // 错误描述
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// operationLogColumns holds the columns for the table goframe_operation_log.
|
||||
var operationLogColumns = OperationLogColumns{
|
||||
Id: "id",
|
||||
Title: "title",
|
||||
Type: "type",
|
||||
Source: "source",
|
||||
Method: "method",
|
||||
RequestMethod: "request_method",
|
||||
Url: "url",
|
||||
Param: "param",
|
||||
Result: "result",
|
||||
Ip: "ip",
|
||||
Location: "location",
|
||||
Os: "os",
|
||||
Browser: "browser",
|
||||
ConsumeTime: "consume_time",
|
||||
Status: "status",
|
||||
Error: "error",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewOperationLogDao creates and returns a new DAO object for table data access.
|
||||
func NewOperationLogDao(handlers ...gdb.ModelHandler) *OperationLogDao {
|
||||
return &OperationLogDao{
|
||||
group: "default",
|
||||
table: "goframe_operation_log",
|
||||
columns: operationLogColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *OperationLogDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *OperationLogDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *OperationLogDao) Columns() OperationLogColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *OperationLogDao) 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 *OperationLogDao) 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 *OperationLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// ParamDao is the data access object for the table goframe_param.
|
||||
type ParamDao 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 ParamColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// ParamColumns defines and stores column names for the table goframe_param.
|
||||
type ParamColumns struct {
|
||||
Id string // 主键ID
|
||||
Name string // 参数名称
|
||||
Code string // 参数编码
|
||||
Value string // 参数值
|
||||
Type string // 参数类型:0-系统 1-业务
|
||||
Status string // 参数状态:1-正常 2-禁用
|
||||
Sort string // 参数排序
|
||||
Note string // 参数备注
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// paramColumns holds the columns for the table goframe_param.
|
||||
var paramColumns = ParamColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
Code: "code",
|
||||
Value: "value",
|
||||
Type: "type",
|
||||
Status: "status",
|
||||
Sort: "sort",
|
||||
Note: "note",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewParamDao creates and returns a new DAO object for table data access.
|
||||
func NewParamDao(handlers ...gdb.ModelHandler) *ParamDao {
|
||||
return &ParamDao{
|
||||
group: "default",
|
||||
table: "goframe_param",
|
||||
columns: paramColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *ParamDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *ParamDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *ParamDao) Columns() ParamColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *ParamDao) 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 *ParamDao) 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 *ParamDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PositionDao is the data access object for the table goframe_position.
|
||||
type PositionDao 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 PositionColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// PositionColumns defines and stores column names for the table goframe_position.
|
||||
type PositionColumns struct {
|
||||
Id string // 主键ID
|
||||
TenantId string // 租户ID:0=平台级
|
||||
Name string // 岗位名称
|
||||
Status string // 岗位状态:1-在用 2-停用
|
||||
Sort string // 岗位排序
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// positionColumns holds the columns for the table goframe_position.
|
||||
var positionColumns = PositionColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
Name: "name",
|
||||
Status: "status",
|
||||
Sort: "sort",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewPositionDao creates and returns a new DAO object for table data access.
|
||||
func NewPositionDao(handlers ...gdb.ModelHandler) *PositionDao {
|
||||
return &PositionDao{
|
||||
group: "default",
|
||||
table: "goframe_position",
|
||||
columns: positionColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *PositionDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *PositionDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *PositionDao) Columns() PositionColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *PositionDao) 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 *PositionDao) 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 *PositionDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// RoleDao is the data access object for the table goframe_role.
|
||||
type RoleDao 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 RoleColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// RoleColumns defines and stores column names for the table goframe_role.
|
||||
type RoleColumns struct {
|
||||
Id string // 主键ID
|
||||
TenantId string // 租户ID:0=平台级
|
||||
Name string // 角色名称
|
||||
Code string // 角色编码
|
||||
DataScope string // 数据范围:1-全部 2-本部门及以下 3-本部门 4-仅本人
|
||||
Sort string // 角色排序
|
||||
Note string // 角色备注
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// roleColumns holds the columns for the table goframe_role.
|
||||
var roleColumns = RoleColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
Name: "name",
|
||||
Code: "code",
|
||||
DataScope: "data_scope",
|
||||
Sort: "sort",
|
||||
Note: "note",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewRoleDao creates and returns a new DAO object for table data access.
|
||||
func NewRoleDao(handlers ...gdb.ModelHandler) *RoleDao {
|
||||
return &RoleDao{
|
||||
group: "default",
|
||||
table: "goframe_role",
|
||||
columns: roleColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *RoleDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *RoleDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *RoleDao) Columns() RoleColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *RoleDao) 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 *RoleDao) 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 *RoleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// RoleMenuDao is the data access object for the table goframe_role_menu.
|
||||
type RoleMenuDao 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 RoleMenuColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// RoleMenuColumns defines and stores column names for the table goframe_role_menu.
|
||||
type RoleMenuColumns struct {
|
||||
Id string // 主键ID
|
||||
RoleId string // 角色ID
|
||||
MenuId string // 菜单ID
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// roleMenuColumns holds the columns for the table goframe_role_menu.
|
||||
var roleMenuColumns = RoleMenuColumns{
|
||||
Id: "id",
|
||||
RoleId: "role_id",
|
||||
MenuId: "menu_id",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewRoleMenuDao creates and returns a new DAO object for table data access.
|
||||
func NewRoleMenuDao(handlers ...gdb.ModelHandler) *RoleMenuDao {
|
||||
return &RoleMenuDao{
|
||||
group: "default",
|
||||
table: "goframe_role_menu",
|
||||
columns: roleMenuColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *RoleMenuDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *RoleMenuDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *RoleMenuDao) Columns() RoleMenuColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *RoleMenuDao) 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 *RoleMenuDao) 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 *RoleMenuDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// TenantDao is the data access object for the table goframe_tenant.
|
||||
type TenantDao 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 TenantColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// TenantColumns defines and stores column names for the table goframe_tenant.
|
||||
type TenantColumns struct {
|
||||
Id string //
|
||||
Name string // 租户名称
|
||||
Code string // 租户编码(系统自动生成:T+4位ID左补零)
|
||||
Contact string // 联系人
|
||||
Mobile string // 联系电话
|
||||
Email string // 邮箱
|
||||
Address string // 地址
|
||||
Logo string // 租户LOGO
|
||||
Status string // 状态:1=正常 2=禁用
|
||||
ExpireTime string // 过期时间
|
||||
MaxUserNum string // 最大用户数
|
||||
Note string // 备注
|
||||
CreateUser string //
|
||||
CreateTime string //
|
||||
UpdateUser string //
|
||||
UpdateTime string //
|
||||
DelFlag string //
|
||||
}
|
||||
|
||||
// tenantColumns holds the columns for the table goframe_tenant.
|
||||
var tenantColumns = TenantColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
Code: "code",
|
||||
Contact: "contact",
|
||||
Mobile: "mobile",
|
||||
Email: "email",
|
||||
Address: "address",
|
||||
Logo: "logo",
|
||||
Status: "status",
|
||||
ExpireTime: "expire_time",
|
||||
MaxUserNum: "max_user_num",
|
||||
Note: "note",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewTenantDao creates and returns a new DAO object for table data access.
|
||||
func NewTenantDao(handlers ...gdb.ModelHandler) *TenantDao {
|
||||
return &TenantDao{
|
||||
group: "default",
|
||||
table: "goframe_tenant",
|
||||
columns: tenantColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *TenantDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *TenantDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *TenantDao) Columns() TenantColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *TenantDao) 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 *TenantDao) 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 *TenantDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// UserDao is the data access object for the table goframe_user.
|
||||
type UserDao 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 UserColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// UserColumns defines and stores column names for the table goframe_user.
|
||||
type UserColumns struct {
|
||||
Id string // 主键ID
|
||||
TenantId string // 租户ID:0=平台用户
|
||||
Code string // 用户编码
|
||||
Realname string // 用户姓名
|
||||
Gender string // 性别:1-男 2-女 3-保密
|
||||
Avatar string // 用户头像
|
||||
Mobile string // 手机号
|
||||
Email string // 邮箱
|
||||
DeptId string // 部门ID
|
||||
LevelId string // 职级ID
|
||||
PositionId string // 岗位ID
|
||||
ProvinceCode string // 省份编码
|
||||
CityCode string // 城市编码
|
||||
DistrictCode string // 县区编码
|
||||
StreetCode string // 街道编码
|
||||
CityInfo string // 省市区信息
|
||||
Address string // 详细地址
|
||||
Username string // 用户名
|
||||
Password string // 密码
|
||||
Salt string // 加密盐
|
||||
Intro string // 个人简介
|
||||
Status string // 状态:1-正常 2-禁用
|
||||
Sort string // 排序
|
||||
Note string // 个人备注
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// userColumns holds the columns for the table goframe_user.
|
||||
var userColumns = UserColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
Code: "code",
|
||||
Realname: "realname",
|
||||
Gender: "gender",
|
||||
Avatar: "avatar",
|
||||
Mobile: "mobile",
|
||||
Email: "email",
|
||||
DeptId: "dept_id",
|
||||
LevelId: "level_id",
|
||||
PositionId: "position_id",
|
||||
ProvinceCode: "province_code",
|
||||
CityCode: "city_code",
|
||||
DistrictCode: "district_code",
|
||||
StreetCode: "street_code",
|
||||
CityInfo: "city_info",
|
||||
Address: "address",
|
||||
Username: "username",
|
||||
Password: "password",
|
||||
Salt: "salt",
|
||||
Intro: "intro",
|
||||
Status: "status",
|
||||
Sort: "sort",
|
||||
Note: "note",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewUserDao creates and returns a new DAO object for table data access.
|
||||
func NewUserDao(handlers ...gdb.ModelHandler) *UserDao {
|
||||
return &UserDao{
|
||||
group: "default",
|
||||
table: "goframe_user",
|
||||
columns: userColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *UserDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *UserDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *UserDao) Columns() UserColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *UserDao) 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 *UserDao) 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 *UserDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// UserRoleDao is the data access object for the table goframe_user_role.
|
||||
type UserRoleDao 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 UserRoleColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// UserRoleColumns defines and stores column names for the table goframe_user_role.
|
||||
type UserRoleColumns struct {
|
||||
Id string // 主键ID
|
||||
UserId string // 用户ID
|
||||
RoleId string // 角色ID
|
||||
CreateUser string // 创建人
|
||||
CreateTime string // 创建时间
|
||||
UpdateUser string // 更新人
|
||||
UpdateTime string // 更新时间
|
||||
DelFlag string // 删除标识:0-正常 1-已删除
|
||||
}
|
||||
|
||||
// userRoleColumns holds the columns for the table goframe_user_role.
|
||||
var userRoleColumns = UserRoleColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
RoleId: "role_id",
|
||||
CreateUser: "create_user",
|
||||
CreateTime: "create_time",
|
||||
UpdateUser: "update_user",
|
||||
UpdateTime: "update_time",
|
||||
DelFlag: "del_flag",
|
||||
}
|
||||
|
||||
// NewUserRoleDao creates and returns a new DAO object for table data access.
|
||||
func NewUserRoleDao(handlers ...gdb.ModelHandler) *UserRoleDao {
|
||||
return &UserRoleDao{
|
||||
group: "default",
|
||||
table: "goframe_user_role",
|
||||
columns: userRoleColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *UserRoleDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *UserRoleDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *UserRoleDao) Columns() UserRoleColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *UserRoleDao) 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 *UserRoleDao) 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 *UserRoleDao) 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