调整表结构
This commit is contained in:
@ -1,93 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// CompetitionAwardsDao is the data access object for the table competition_awards.
|
||||
type CompetitionAwardsDao 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 CompetitionAwardsColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// CompetitionAwardsColumns defines and stores column names for the table competition_awards.
|
||||
type CompetitionAwardsColumns struct {
|
||||
Id string // 赛事获奖ID
|
||||
CompetitionId string // 赛事ID
|
||||
UserId string // 获奖用户ID
|
||||
AwardRank string // 获奖名次(1:冠军,2:亚军,3:季军,依次类推)
|
||||
RewardType string // 奖励类型:1=平台奖励,2=门店奖励
|
||||
RewardId string // 对应奖励ID
|
||||
Amount string // 奖励数量
|
||||
IssuedAt string // 奖励发放时间
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间
|
||||
}
|
||||
|
||||
// competitionAwardsColumns holds the columns for the table competition_awards.
|
||||
var competitionAwardsColumns = CompetitionAwardsColumns{
|
||||
Id: "id",
|
||||
CompetitionId: "competition_id",
|
||||
UserId: "user_id",
|
||||
AwardRank: "award_rank",
|
||||
RewardType: "reward_type",
|
||||
RewardId: "reward_id",
|
||||
Amount: "amount",
|
||||
IssuedAt: "issued_at",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewCompetitionAwardsDao creates and returns a new DAO object for table data access.
|
||||
func NewCompetitionAwardsDao() *CompetitionAwardsDao {
|
||||
return &CompetitionAwardsDao{
|
||||
group: "default",
|
||||
table: "competition_awards",
|
||||
columns: competitionAwardsColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *CompetitionAwardsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *CompetitionAwardsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *CompetitionAwardsDao) Columns() CompetitionAwardsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *CompetitionAwardsDao) 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 *CompetitionAwardsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).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 *CompetitionAwardsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -1,87 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// CompetitionParticipantsDao is the data access object for the table competition_participants.
|
||||
type CompetitionParticipantsDao 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 CompetitionParticipantsColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// CompetitionParticipantsColumns defines and stores column names for the table competition_participants.
|
||||
type CompetitionParticipantsColumns struct {
|
||||
Id string // 参赛记录ID
|
||||
CompetitionId string // 赛事ID
|
||||
UserId string // 参赛用户ID
|
||||
RegistrationTime string // 报名时间
|
||||
Status string // 参赛状态:1=已报名,2=已取消,3=已禁赛
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间
|
||||
}
|
||||
|
||||
// competitionParticipantsColumns holds the columns for the table competition_participants.
|
||||
var competitionParticipantsColumns = CompetitionParticipantsColumns{
|
||||
Id: "id",
|
||||
CompetitionId: "competition_id",
|
||||
UserId: "user_id",
|
||||
RegistrationTime: "registration_time",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewCompetitionParticipantsDao creates and returns a new DAO object for table data access.
|
||||
func NewCompetitionParticipantsDao() *CompetitionParticipantsDao {
|
||||
return &CompetitionParticipantsDao{
|
||||
group: "default",
|
||||
table: "competition_participants",
|
||||
columns: competitionParticipantsColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *CompetitionParticipantsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *CompetitionParticipantsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *CompetitionParticipantsDao) Columns() CompetitionParticipantsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *CompetitionParticipantsDao) 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 *CompetitionParticipantsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).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 *CompetitionParticipantsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -1,99 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// CompetitionsDao is the data access object for the table competitions.
|
||||
type CompetitionsDao 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 CompetitionsColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// CompetitionsColumns defines and stores column names for the table competitions.
|
||||
type CompetitionsColumns struct {
|
||||
Id string // 赛事唯一标识符
|
||||
Name string // 赛事名称
|
||||
Description string // 赛事描述
|
||||
GameMode string // 游戏模式
|
||||
Conditions string // 赛事条件
|
||||
Rules string // 赛事规则说明
|
||||
StartTime string // 赛事开始时间
|
||||
EndTime string // 赛事结束时间
|
||||
IsActive string // 赛事是否启用
|
||||
MerchantId string // 所属商户ID
|
||||
StoreId string // 所属门店ID
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// competitionsColumns holds the columns for the table competitions.
|
||||
var competitionsColumns = CompetitionsColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
Description: "description",
|
||||
GameMode: "game_mode",
|
||||
Conditions: "conditions",
|
||||
Rules: "rules",
|
||||
StartTime: "start_time",
|
||||
EndTime: "end_time",
|
||||
IsActive: "is_active",
|
||||
MerchantId: "merchant_id",
|
||||
StoreId: "store_id",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewCompetitionsDao creates and returns a new DAO object for table data access.
|
||||
func NewCompetitionsDao() *CompetitionsDao {
|
||||
return &CompetitionsDao{
|
||||
group: "default",
|
||||
table: "competitions",
|
||||
columns: competitionsColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *CompetitionsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *CompetitionsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *CompetitionsDao) Columns() CompetitionsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *CompetitionsDao) 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 *CompetitionsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).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 *CompetitionsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -1,97 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// MenusDao is the data access object for the table menus.
|
||||
type MenusDao 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 MenusColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// MenusColumns defines and stores column names for the table menus.
|
||||
type MenusColumns struct {
|
||||
Id string // 菜单ID
|
||||
ParentId string // 父级菜单ID
|
||||
Name string // 菜单名称
|
||||
Path string // 前端路由路径
|
||||
Component string // 前端组件路径
|
||||
Type string // 类型:1=目录(父级菜单),2=菜单(功能页面)
|
||||
Icon string // 图标
|
||||
Sort string // 排序
|
||||
Hidden string // 是否隐藏:0=显示,1=隐藏
|
||||
Status string // 状态:1=启用,2=禁用
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// menusColumns holds the columns for the table menus.
|
||||
var menusColumns = MenusColumns{
|
||||
Id: "id",
|
||||
ParentId: "parent_id",
|
||||
Name: "name",
|
||||
Path: "path",
|
||||
Component: "component",
|
||||
Type: "type",
|
||||
Icon: "icon",
|
||||
Sort: "sort",
|
||||
Hidden: "hidden",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewMenusDao creates and returns a new DAO object for table data access.
|
||||
func NewMenusDao() *MenusDao {
|
||||
return &MenusDao{
|
||||
group: "default",
|
||||
table: "menus",
|
||||
columns: menusColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *MenusDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *MenusDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *MenusDao) Columns() MenusColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *MenusDao) 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 *MenusDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).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 *MenusDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -1,93 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NoticesDao is the data access object for the table notices.
|
||||
type NoticesDao 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 NoticesColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// NoticesColumns defines and stores column names for the table notices.
|
||||
type NoticesColumns struct {
|
||||
Id string // 通知ID
|
||||
Title string // 通知标题
|
||||
Content string // 通知内容
|
||||
Type string // 通知类型:1=系统公告,2=活动通知,3=维护通知
|
||||
Status string // 状态:0=关闭,1=发布
|
||||
VisibleTo string // 可见范围:1=所有人,2=仅门店,3=仅用户
|
||||
MerchantId string // 所属商户ID
|
||||
StoreId string // 所属门店ID
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// noticesColumns holds the columns for the table notices.
|
||||
var noticesColumns = NoticesColumns{
|
||||
Id: "id",
|
||||
Title: "title",
|
||||
Content: "content",
|
||||
Type: "type",
|
||||
Status: "status",
|
||||
VisibleTo: "visible_to",
|
||||
MerchantId: "merchant_id",
|
||||
StoreId: "store_id",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewNoticesDao creates and returns a new DAO object for table data access.
|
||||
func NewNoticesDao() *NoticesDao {
|
||||
return &NoticesDao{
|
||||
group: "default",
|
||||
table: "notices",
|
||||
columns: noticesColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *NoticesDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *NoticesDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *NoticesDao) Columns() NoticesColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *NoticesDao) 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 *NoticesDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).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 *NoticesDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -1,97 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// RewardDistributionsDao is the data access object for the table reward_distributions.
|
||||
type RewardDistributionsDao 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 RewardDistributionsColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// RewardDistributionsColumns defines and stores column names for the table reward_distributions.
|
||||
type RewardDistributionsColumns struct {
|
||||
Id string // 奖励下发记录ID
|
||||
UserId string // 接收奖励的用户ID
|
||||
TaskId string // 触发该奖励的任务ID
|
||||
RewardId string // 奖励ID
|
||||
RewardSource string // 奖励来源:1=平台,2=门店
|
||||
Amount string // 奖励数量
|
||||
StoreId string // 所属门店ID
|
||||
Status string // 发放状态:0=待发放,1=已发放,2=失败
|
||||
IssuedAt string // 实际发放时间
|
||||
Remark string // 备注信息
|
||||
CreatedAt string // 记录创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// rewardDistributionsColumns holds the columns for the table reward_distributions.
|
||||
var rewardDistributionsColumns = RewardDistributionsColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
TaskId: "task_id",
|
||||
RewardId: "reward_id",
|
||||
RewardSource: "reward_source",
|
||||
Amount: "amount",
|
||||
StoreId: "store_id",
|
||||
Status: "status",
|
||||
IssuedAt: "issued_at",
|
||||
Remark: "remark",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewRewardDistributionsDao creates and returns a new DAO object for table data access.
|
||||
func NewRewardDistributionsDao() *RewardDistributionsDao {
|
||||
return &RewardDistributionsDao{
|
||||
group: "default",
|
||||
table: "reward_distributions",
|
||||
columns: rewardDistributionsColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *RewardDistributionsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *RewardDistributionsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *RewardDistributionsDao) Columns() RewardDistributionsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *RewardDistributionsDao) 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 *RewardDistributionsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).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 *RewardDistributionsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -1,83 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// RoleMenusDao is the data access object for the table role_menus.
|
||||
type RoleMenusDao 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 RoleMenusColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// RoleMenusColumns defines and stores column names for the table role_menus.
|
||||
type RoleMenusColumns struct {
|
||||
Id string // ID
|
||||
RoleId string // 角色ID
|
||||
MenuId string // 菜单ID
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// roleMenusColumns holds the columns for the table role_menus.
|
||||
var roleMenusColumns = RoleMenusColumns{
|
||||
Id: "id",
|
||||
RoleId: "role_id",
|
||||
MenuId: "menu_id",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewRoleMenusDao creates and returns a new DAO object for table data access.
|
||||
func NewRoleMenusDao() *RoleMenusDao {
|
||||
return &RoleMenusDao{
|
||||
group: "default",
|
||||
table: "role_menus",
|
||||
columns: roleMenusColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *RoleMenusDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *RoleMenusDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *RoleMenusDao) Columns() RoleMenusColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *RoleMenusDao) 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 *RoleMenusDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).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 *RoleMenusDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -1,91 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// StoreRewardsDao is the data access object for the table store_rewards.
|
||||
type StoreRewardsDao 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 StoreRewardsColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// StoreRewardsColumns defines and stores column names for the table store_rewards.
|
||||
type StoreRewardsColumns struct {
|
||||
Id string // 门店奖励ID
|
||||
StoreId string // 所属门店ID
|
||||
RewardTypeId string // 奖励类型ID
|
||||
RewardName string // 奖励名称
|
||||
Amount string // 奖励数量
|
||||
Total string // 该奖励总库存(NULL 表示无限)
|
||||
MerchantId string // 所属商户ID
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// storeRewardsColumns holds the columns for the table store_rewards.
|
||||
var storeRewardsColumns = StoreRewardsColumns{
|
||||
Id: "id",
|
||||
StoreId: "store_id",
|
||||
RewardTypeId: "reward_type_id",
|
||||
RewardName: "reward_name",
|
||||
Amount: "amount",
|
||||
Total: "total",
|
||||
MerchantId: "merchant_id",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewStoreRewardsDao creates and returns a new DAO object for table data access.
|
||||
func NewStoreRewardsDao() *StoreRewardsDao {
|
||||
return &StoreRewardsDao{
|
||||
group: "default",
|
||||
table: "store_rewards",
|
||||
columns: storeRewardsColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *StoreRewardsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *StoreRewardsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *StoreRewardsDao) Columns() StoreRewardsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *StoreRewardsDao) 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 *StoreRewardsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).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 *StoreRewardsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -1,87 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// StoreTaskRewardsDao is the data access object for the table store_task_rewards.
|
||||
type StoreTaskRewardsDao 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 StoreTaskRewardsColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// StoreTaskRewardsColumns defines and stores column names for the table store_task_rewards.
|
||||
type StoreTaskRewardsColumns struct {
|
||||
Id string // 门店奖励记录ID
|
||||
StoreId string // 门店ID
|
||||
TaskId string // 任务ID
|
||||
StoreRewardId string // 门店奖励ID
|
||||
IsEnabled string // 是否启用
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// storeTaskRewardsColumns holds the columns for the table store_task_rewards.
|
||||
var storeTaskRewardsColumns = StoreTaskRewardsColumns{
|
||||
Id: "id",
|
||||
StoreId: "store_id",
|
||||
TaskId: "task_id",
|
||||
StoreRewardId: "store_reward_id",
|
||||
IsEnabled: "is_enabled",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewStoreTaskRewardsDao creates and returns a new DAO object for table data access.
|
||||
func NewStoreTaskRewardsDao() *StoreTaskRewardsDao {
|
||||
return &StoreTaskRewardsDao{
|
||||
group: "default",
|
||||
table: "store_task_rewards",
|
||||
columns: storeTaskRewardsColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *StoreTaskRewardsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *StoreTaskRewardsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *StoreTaskRewardsDao) Columns() StoreTaskRewardsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *StoreTaskRewardsDao) 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 *StoreTaskRewardsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).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 *StoreTaskRewardsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -1,111 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// SystemOperationLogsDao is the data access object for the table system_operation_logs.
|
||||
type SystemOperationLogsDao 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 SystemOperationLogsColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// SystemOperationLogsColumns defines and stores column names for the table system_operation_logs.
|
||||
type SystemOperationLogsColumns struct {
|
||||
Id string // 日志ID
|
||||
OperatorType string // 操作者类型:1=系统管理员,2=商户管理员,3=门店管理员,4=普通用户
|
||||
OperatorId string // 操作者ID
|
||||
MerchantId string // 所属商户ID
|
||||
StoreId string // 所属门店ID
|
||||
Module string // 操作模块
|
||||
Action string // 操作类型
|
||||
TargetType string // 操作对象类型
|
||||
TargetId string // 操作对象ID
|
||||
Content string // 操作内容描述
|
||||
RequestMethod string // 请求方法
|
||||
RequestUrl string // 请求URL
|
||||
RequestParams string // 请求参数
|
||||
ResponseCode string // 响应状态码
|
||||
ResponseMessage string // 响应信息
|
||||
IpAddress string // 操作IP地址
|
||||
UserAgent string // 用户代理信息
|
||||
CreatedAt string // 操作时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// systemOperationLogsColumns holds the columns for the table system_operation_logs.
|
||||
var systemOperationLogsColumns = SystemOperationLogsColumns{
|
||||
Id: "id",
|
||||
OperatorType: "operator_type",
|
||||
OperatorId: "operator_id",
|
||||
MerchantId: "merchant_id",
|
||||
StoreId: "store_id",
|
||||
Module: "module",
|
||||
Action: "action",
|
||||
TargetType: "target_type",
|
||||
TargetId: "target_id",
|
||||
Content: "content",
|
||||
RequestMethod: "request_method",
|
||||
RequestUrl: "request_url",
|
||||
RequestParams: "request_params",
|
||||
ResponseCode: "response_code",
|
||||
ResponseMessage: "response_message",
|
||||
IpAddress: "ip_address",
|
||||
UserAgent: "user_agent",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewSystemOperationLogsDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemOperationLogsDao() *SystemOperationLogsDao {
|
||||
return &SystemOperationLogsDao{
|
||||
group: "default",
|
||||
table: "system_operation_logs",
|
||||
columns: systemOperationLogsColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemOperationLogsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemOperationLogsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemOperationLogsDao) Columns() SystemOperationLogsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemOperationLogsDao) 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 *SystemOperationLogsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).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 *SystemOperationLogsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -1,81 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// TasksDao is the data access object for the table tasks.
|
||||
type TasksDao 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 TasksColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// TasksColumns defines and stores column names for the table tasks.
|
||||
type TasksColumns struct {
|
||||
Id string // 任务ID
|
||||
QqTaskId string // QQ网吧任务ID
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// tasksColumns holds the columns for the table tasks.
|
||||
var tasksColumns = TasksColumns{
|
||||
Id: "id",
|
||||
QqTaskId: "qq_task_id",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewTasksDao creates and returns a new DAO object for table data access.
|
||||
func NewTasksDao() *TasksDao {
|
||||
return &TasksDao{
|
||||
group: "default",
|
||||
table: "tasks",
|
||||
columns: tasksColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *TasksDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *TasksDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *TasksDao) Columns() TasksColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *TasksDao) 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 *TasksDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).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 *TasksDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -1,93 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// UserLoginRecordsDao is the data access object for the table user_login_records.
|
||||
type UserLoginRecordsDao 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 UserLoginRecordsColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// UserLoginRecordsColumns defines and stores column names for the table user_login_records.
|
||||
type UserLoginRecordsColumns struct {
|
||||
Id string // 记录ID
|
||||
UserId string // 用户ID
|
||||
StoreId string // 登录门店ID
|
||||
LoginIp string // 登录IP地址
|
||||
LoginPlatform string // 登录平台:1=PC
|
||||
LoginType string // 登录方式:1=微信,2=手机号,3=账号密码,4=其他
|
||||
LoginStatus string // 登录状态:1=成功,2=失败
|
||||
FailReason string // 失败原因
|
||||
CreatedAt string // 登录时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// userLoginRecordsColumns holds the columns for the table user_login_records.
|
||||
var userLoginRecordsColumns = UserLoginRecordsColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
StoreId: "store_id",
|
||||
LoginIp: "login_ip",
|
||||
LoginPlatform: "login_platform",
|
||||
LoginType: "login_type",
|
||||
LoginStatus: "login_status",
|
||||
FailReason: "fail_reason",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewUserLoginRecordsDao creates and returns a new DAO object for table data access.
|
||||
func NewUserLoginRecordsDao() *UserLoginRecordsDao {
|
||||
return &UserLoginRecordsDao{
|
||||
group: "default",
|
||||
table: "user_login_records",
|
||||
columns: userLoginRecordsColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *UserLoginRecordsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *UserLoginRecordsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *UserLoginRecordsDao) Columns() UserLoginRecordsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *UserLoginRecordsDao) 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 *UserLoginRecordsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).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 *UserLoginRecordsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -1,91 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// UserTaskRecordsDao is the data access object for the table user_task_records.
|
||||
type UserTaskRecordsDao 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 UserTaskRecordsColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// UserTaskRecordsColumns defines and stores column names for the table user_task_records.
|
||||
type UserTaskRecordsColumns struct {
|
||||
Id string // 任务记录ID
|
||||
UserId string // 用户ID
|
||||
TaskId string // 任务ID
|
||||
Status string // 任务状态:1=未开始,2=进行中,3=已完成,4=已领取奖励
|
||||
Progress string // 任务进度
|
||||
FinishedAt string // 完成时间
|
||||
RewardReceivedAt string // 领取奖励时间
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间
|
||||
}
|
||||
|
||||
// userTaskRecordsColumns holds the columns for the table user_task_records.
|
||||
var userTaskRecordsColumns = UserTaskRecordsColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
TaskId: "task_id",
|
||||
Status: "status",
|
||||
Progress: "progress",
|
||||
FinishedAt: "finished_at",
|
||||
RewardReceivedAt: "reward_received_at",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewUserTaskRecordsDao creates and returns a new DAO object for table data access.
|
||||
func NewUserTaskRecordsDao() *UserTaskRecordsDao {
|
||||
return &UserTaskRecordsDao{
|
||||
group: "default",
|
||||
table: "user_task_records",
|
||||
columns: userTaskRecordsColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *UserTaskRecordsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *UserTaskRecordsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *UserTaskRecordsDao) Columns() UserTaskRecordsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *UserTaskRecordsDao) 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 *UserTaskRecordsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).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 *UserTaskRecordsDao) 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