Files
nl-video-api/internal/dao/config.go
2025-08-03 00:11:15 +08:00

83 lines
2.6 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package dao
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// internalConfigDao is internal type for wrapping internal DAO implements.
type internalConfigDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns ConfigColumns // columns contains all the column names of Table for convenient usage.
}
// ConfigColumns defines and stores column names for table nl_config.
type ConfigColumns struct {
Id string // 配置ID
ConfigKey string // 配置键
ConfigValue string // 配置值
ConfigType string // 配置类型
Description string // 配置描述
Status string // 状态0禁用1启用
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
}
// configColumns holds the columns for table nl_config.
var configColumns = ConfigColumns{
Id: "id",
ConfigKey: "config_key",
ConfigValue: "config_value",
ConfigType: "config_type",
Description: "description",
Status: "status",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
}
// NewConfigDao creates and returns a new DAO object for table data access.
func NewConfigDao() *internalConfigDao {
return &internalConfigDao{
group: "default",
table: "nl_config",
columns: configColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *internalConfigDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *internalConfigDao) Table() string {
return dao.table
}
// Columns returns the columns of current dao.
func (dao *internalConfigDao) Columns() ConfigColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *internalConfigDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *internalConfigDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
func (dao *internalConfigDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) error {
return dao.Ctx(ctx).Transaction(ctx, f)
}