生成表结构、

This commit is contained in:
2025-05-29 16:23:14 +08:00
parent e8a8e36d61
commit ea87bc829e
97 changed files with 3795 additions and 0 deletions

27
internal/dao/admins.go Normal file
View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalAdminsDao is an internal type for wrapping the internal DAO implementation.
type internalAdminsDao = *internal.AdminsDao
// adminsDao is the data access object for the table admins.
// You can define custom methods on it to extend its functionality as needed.
type adminsDao struct {
internalAdminsDao
}
var (
// Admins is a globally accessible object for table admins operations.
Admins = adminsDao{
internal.NewAdminsDao(),
}
)
// Add your custom methods and functionality below.

View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalCompetitionAwardsDao is an internal type for wrapping the internal DAO implementation.
type internalCompetitionAwardsDao = *internal.CompetitionAwardsDao
// competitionAwardsDao is the data access object for the table competition_awards.
// You can define custom methods on it to extend its functionality as needed.
type competitionAwardsDao struct {
internalCompetitionAwardsDao
}
var (
// CompetitionAwards is a globally accessible object for table competition_awards operations.
CompetitionAwards = competitionAwardsDao{
internal.NewCompetitionAwardsDao(),
}
)
// Add your custom methods and functionality below.

View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalCompetitionParticipantsDao is an internal type for wrapping the internal DAO implementation.
type internalCompetitionParticipantsDao = *internal.CompetitionParticipantsDao
// competitionParticipantsDao is the data access object for the table competition_participants.
// You can define custom methods on it to extend its functionality as needed.
type competitionParticipantsDao struct {
internalCompetitionParticipantsDao
}
var (
// CompetitionParticipants is a globally accessible object for table competition_participants operations.
CompetitionParticipants = competitionParticipantsDao{
internal.NewCompetitionParticipantsDao(),
}
)
// Add your custom methods and functionality below.

View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalCompetitionsDao is an internal type for wrapping the internal DAO implementation.
type internalCompetitionsDao = *internal.CompetitionsDao
// competitionsDao is the data access object for the table competitions.
// You can define custom methods on it to extend its functionality as needed.
type competitionsDao struct {
internalCompetitionsDao
}
var (
// Competitions is a globally accessible object for table competitions operations.
Competitions = competitionsDao{
internal.NewCompetitionsDao(),
}
)
// Add your custom methods and functionality below.

27
internal/dao/feedbacks.go Normal file
View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalFeedbacksDao is an internal type for wrapping the internal DAO implementation.
type internalFeedbacksDao = *internal.FeedbacksDao
// feedbacksDao is the data access object for the table feedbacks.
// You can define custom methods on it to extend its functionality as needed.
type feedbacksDao struct {
internalFeedbacksDao
}
var (
// Feedbacks is a globally accessible object for table feedbacks operations.
Feedbacks = feedbacksDao{
internal.NewFeedbacksDao(),
}
)
// Add your custom methods and functionality below.

View File

@ -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"
)
// AdminsDao is the data access object for the table admins.
type AdminsDao 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 AdminsColumns // columns contains all the column names of Table for convenient usage.
}
// AdminsColumns defines and stores column names for the table admins.
type AdminsColumns struct {
Id string // 管理员ID
Username string // 管理员用户名
PasswordHash string // 密码哈希
RealName string // 真实姓名
Phone string // 手机号
Email string // 邮箱
Role string // 角色1=超级管理员2=运营管理员3=客服管理员4=财务管理员
Status string // 状态1=正常2=禁用
LastLoginAt string // 最后登录时间
LastLoginIp string // 最后登录IP
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
DeletedAt string // 软删除时间戳
}
// adminsColumns holds the columns for the table admins.
var adminsColumns = AdminsColumns{
Id: "id",
Username: "username",
PasswordHash: "password_hash",
RealName: "real_name",
Phone: "phone",
Email: "email",
Role: "role",
Status: "status",
LastLoginAt: "last_login_at",
LastLoginIp: "last_login_ip",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewAdminsDao creates and returns a new DAO object for table data access.
func NewAdminsDao() *AdminsDao {
return &AdminsDao{
group: "default",
table: "admins",
columns: adminsColumns,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *AdminsDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *AdminsDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *AdminsDao) Columns() AdminsColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *AdminsDao) 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 *AdminsDao) 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 *AdminsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@ -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"
)
// 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)
}

View File

@ -0,0 +1,87 @@
// ==========================================================================
// 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)
}

View File

@ -0,0 +1,99 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// 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)
}

View File

@ -0,0 +1,91 @@
// ==========================================================================
// 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"
)
// FeedbacksDao is the data access object for the table feedbacks.
type FeedbacksDao 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 FeedbacksColumns // columns contains all the column names of Table for convenient usage.
}
// FeedbacksColumns defines and stores column names for the table feedbacks.
type FeedbacksColumns struct {
Id string // 反馈唯一标识符
UserId string // 提交者用户ID
Title string // 反馈标题
Content string // 反馈内容
FeedbackType string // 反馈类型1=BUG2=建议3=投诉4=其他
Status string // 处理状态0=待处理1=处理中2=已处理3=已驳回
Reply string // 管理员回复内容
CreatedAt string // 反馈提交时间
UpdatedAt string // 反馈更新时间
DeletedAt string // 软删除时间戳
}
// feedbacksColumns holds the columns for the table feedbacks.
var feedbacksColumns = FeedbacksColumns{
Id: "id",
UserId: "user_id",
Title: "title",
Content: "content",
FeedbackType: "feedback_type",
Status: "status",
Reply: "reply",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewFeedbacksDao creates and returns a new DAO object for table data access.
func NewFeedbacksDao() *FeedbacksDao {
return &FeedbacksDao{
group: "default",
table: "feedbacks",
columns: feedbacksColumns,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *FeedbacksDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *FeedbacksDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *FeedbacksDao) Columns() FeedbacksColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *FeedbacksDao) 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 *FeedbacksDao) 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 *FeedbacksDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@ -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"
)
// MerchantAdminsDao is the data access object for the table merchant_admins.
type MerchantAdminsDao 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 MerchantAdminsColumns // columns contains all the column names of Table for convenient usage.
}
// MerchantAdminsColumns defines and stores column names for the table merchant_admins.
type MerchantAdminsColumns struct {
Id string // 商户管理员ID
MerchantId string // 所属商户ID
Username string // 用户名
PasswordHash string // 密码哈希
RealName string // 真实姓名
Phone string // 手机号
Email string // 邮箱
Role string // 角色1=超级管理员2=普通管理员
Status string // 状态1=正常2=禁用
LastLoginAt string // 最后登录时间
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
DeletedAt string // 软删除时间戳
}
// merchantAdminsColumns holds the columns for the table merchant_admins.
var merchantAdminsColumns = MerchantAdminsColumns{
Id: "id",
MerchantId: "merchant_id",
Username: "username",
PasswordHash: "password_hash",
RealName: "real_name",
Phone: "phone",
Email: "email",
Role: "role",
Status: "status",
LastLoginAt: "last_login_at",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewMerchantAdminsDao creates and returns a new DAO object for table data access.
func NewMerchantAdminsDao() *MerchantAdminsDao {
return &MerchantAdminsDao{
group: "default",
table: "merchant_admins",
columns: merchantAdminsColumns,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *MerchantAdminsDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *MerchantAdminsDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *MerchantAdminsDao) Columns() MerchantAdminsColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *MerchantAdminsDao) 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 *MerchantAdminsDao) 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 *MerchantAdminsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@ -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"
)
// MerchantsDao is the data access object for the table merchants.
type MerchantsDao 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 MerchantsColumns // columns contains all the column names of Table for convenient usage.
}
// MerchantsColumns defines and stores column names for the table merchants.
type MerchantsColumns struct {
Id string // 商户ID
Name string // 商户名称
BusinessLicense string // 营业执照号
LegalPerson string // 法人姓名
ContactName string // 联系人姓名
ContactPhone string // 联系人电话
ContactEmail string // 联系人邮箱
Address string // 商户地址
Status string // 状态1=正常2=禁用3=待审核
ExpireAt string // 服务到期时间
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
DeletedAt string // 软删除时间戳
}
// merchantsColumns holds the columns for the table merchants.
var merchantsColumns = MerchantsColumns{
Id: "id",
Name: "name",
BusinessLicense: "business_license",
LegalPerson: "legal_person",
ContactName: "contact_name",
ContactPhone: "contact_phone",
ContactEmail: "contact_email",
Address: "address",
Status: "status",
ExpireAt: "expire_at",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewMerchantsDao creates and returns a new DAO object for table data access.
func NewMerchantsDao() *MerchantsDao {
return &MerchantsDao{
group: "default",
table: "merchants",
columns: merchantsColumns,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *MerchantsDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *MerchantsDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *MerchantsDao) Columns() MerchantsColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *MerchantsDao) 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 *MerchantsDao) 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 *MerchantsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@ -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"
)
// 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)
}

View File

@ -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"
)
// 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)
}

View File

@ -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"
)
// StoreAdminsDao is the data access object for the table store_admins.
type StoreAdminsDao 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 StoreAdminsColumns // columns contains all the column names of Table for convenient usage.
}
// StoreAdminsColumns defines and stores column names for the table store_admins.
type StoreAdminsColumns struct {
Id string // 门店管理员ID
StoreId string // 所属门店ID
Username string // 用户名
PasswordHash string // 密码哈希
RealName string // 真实姓名
Phone string // 手机号
Email string // 邮箱
Role string // 角色1=店长2=收银员3=网管
Status string // 状态1=正常2=禁用
LastLoginAt string // 最后登录时间
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
DeletedAt string // 软删除时间戳
}
// storeAdminsColumns holds the columns for the table store_admins.
var storeAdminsColumns = StoreAdminsColumns{
Id: "id",
StoreId: "store_id",
Username: "username",
PasswordHash: "password_hash",
RealName: "real_name",
Phone: "phone",
Email: "email",
Role: "role",
Status: "status",
LastLoginAt: "last_login_at",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewStoreAdminsDao creates and returns a new DAO object for table data access.
func NewStoreAdminsDao() *StoreAdminsDao {
return &StoreAdminsDao{
group: "default",
table: "store_admins",
columns: storeAdminsColumns,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *StoreAdminsDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *StoreAdminsDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *StoreAdminsDao) Columns() StoreAdminsColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *StoreAdminsDao) 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 *StoreAdminsDao) 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 *StoreAdminsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@ -0,0 +1,91 @@
// ==========================================================================
// 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
RewardType string // 奖励类型1=积分2=优惠券3=商品4=抽奖券
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",
RewardType: "reward_type",
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)
}

View File

@ -0,0 +1,87 @@
// ==========================================================================
// 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)
}

View File

@ -0,0 +1,95 @@
// ==========================================================================
// 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"
)
// StoresDao is the data access object for the table stores.
type StoresDao 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 StoresColumns // columns contains all the column names of Table for convenient usage.
}
// StoresColumns defines and stores column names for the table stores.
type StoresColumns struct {
Id string // 门店ID
MerchantId string // 所属商户ID
Name string // 门店名称
StoreCode string // 门店编号
Address string // 门店地址
ContactName string // 联系人姓名
ContactPhone string // 联系人电话
BusinessHours string // 营业时间
Status string // 状态1=正常营业2=暂停营业3=已关闭
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
DeletedAt string // 软删除时间戳
}
// storesColumns holds the columns for the table stores.
var storesColumns = StoresColumns{
Id: "id",
MerchantId: "merchant_id",
Name: "name",
StoreCode: "store_code",
Address: "address",
ContactName: "contact_name",
ContactPhone: "contact_phone",
BusinessHours: "business_hours",
Status: "status",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewStoresDao creates and returns a new DAO object for table data access.
func NewStoresDao() *StoresDao {
return &StoresDao{
group: "default",
table: "stores",
columns: storesColumns,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *StoresDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *StoresDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *StoresDao) Columns() StoresColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *StoresDao) 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 *StoresDao) 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 *StoresDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@ -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"
)
// 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)
}

View File

@ -0,0 +1,81 @@
// ==========================================================================
// 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)
}

View File

@ -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"
)
// 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
MerchantId string // 所属商户ID
LoginIp string // 登录IP地址
LoginDevice string // 登录设备信息
LoginPlatform string // 登录平台1=Web2=iOS3=Android4=微信小程序5=支付宝小程序6=其他
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",
MerchantId: "merchant_id",
LoginIp: "login_ip",
LoginDevice: "login_device",
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)
}

View File

@ -0,0 +1,91 @@
// ==========================================================================
// 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 // 任务状态0=未开始1=进行中2=已完成3=已领取奖励
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)
}

View File

@ -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"
)
// UsersDao is the data access object for the table users.
type UsersDao 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 UsersColumns // columns contains all the column names of Table for convenient usage.
}
// UsersColumns defines and stores column names for the table users.
type UsersColumns struct {
Id string // 用户唯一标识符
WxOpenId string // 微信 OpenID
Username string // 用户名
Nickname string // 昵称
Avatar string // 用户头像URL
PasswordHash string // 密码哈希
Email string // 邮箱地址
PhoneNumber string // 手机号
WxPopenId string // 微信 PopenID
QqPopenId string // QQ PopenID
FirstVisitAt string // 首次访问时间
LastLoginAt string // 最后登录时间
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
DeletedAt string // 软删除时间
}
// usersColumns holds the columns for the table users.
var usersColumns = UsersColumns{
Id: "id",
WxOpenId: "wx_open_id",
Username: "username",
Nickname: "nickname",
Avatar: "avatar",
PasswordHash: "password_hash",
Email: "email",
PhoneNumber: "phone_number",
WxPopenId: "wx_popen_id",
QqPopenId: "qq_popen_id",
FirstVisitAt: "first_visit_at",
LastLoginAt: "last_login_at",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewUsersDao creates and returns a new DAO object for table data access.
func NewUsersDao() *UsersDao {
return &UsersDao{
group: "default",
table: "users",
columns: usersColumns,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *UsersDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *UsersDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *UsersDao) Columns() UsersColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *UsersDao) 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 *UsersDao) 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 *UsersDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalMerchantAdminsDao is an internal type for wrapping the internal DAO implementation.
type internalMerchantAdminsDao = *internal.MerchantAdminsDao
// merchantAdminsDao is the data access object for the table merchant_admins.
// You can define custom methods on it to extend its functionality as needed.
type merchantAdminsDao struct {
internalMerchantAdminsDao
}
var (
// MerchantAdmins is a globally accessible object for table merchant_admins operations.
MerchantAdmins = merchantAdminsDao{
internal.NewMerchantAdminsDao(),
}
)
// Add your custom methods and functionality below.

27
internal/dao/merchants.go Normal file
View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalMerchantsDao is an internal type for wrapping the internal DAO implementation.
type internalMerchantsDao = *internal.MerchantsDao
// merchantsDao is the data access object for the table merchants.
// You can define custom methods on it to extend its functionality as needed.
type merchantsDao struct {
internalMerchantsDao
}
var (
// Merchants is a globally accessible object for table merchants operations.
Merchants = merchantsDao{
internal.NewMerchantsDao(),
}
)
// Add your custom methods and functionality below.

27
internal/dao/notices.go Normal file
View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalNoticesDao is an internal type for wrapping the internal DAO implementation.
type internalNoticesDao = *internal.NoticesDao
// noticesDao is the data access object for the table notices.
// You can define custom methods on it to extend its functionality as needed.
type noticesDao struct {
internalNoticesDao
}
var (
// Notices is a globally accessible object for table notices operations.
Notices = noticesDao{
internal.NewNoticesDao(),
}
)
// Add your custom methods and functionality below.

View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalRewardDistributionsDao is an internal type for wrapping the internal DAO implementation.
type internalRewardDistributionsDao = *internal.RewardDistributionsDao
// rewardDistributionsDao is the data access object for the table reward_distributions.
// You can define custom methods on it to extend its functionality as needed.
type rewardDistributionsDao struct {
internalRewardDistributionsDao
}
var (
// RewardDistributions is a globally accessible object for table reward_distributions operations.
RewardDistributions = rewardDistributionsDao{
internal.NewRewardDistributionsDao(),
}
)
// Add your custom methods and functionality below.

View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalStoreAdminsDao is an internal type for wrapping the internal DAO implementation.
type internalStoreAdminsDao = *internal.StoreAdminsDao
// storeAdminsDao is the data access object for the table store_admins.
// You can define custom methods on it to extend its functionality as needed.
type storeAdminsDao struct {
internalStoreAdminsDao
}
var (
// StoreAdmins is a globally accessible object for table store_admins operations.
StoreAdmins = storeAdminsDao{
internal.NewStoreAdminsDao(),
}
)
// Add your custom methods and functionality below.

View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalStoreRewardsDao is an internal type for wrapping the internal DAO implementation.
type internalStoreRewardsDao = *internal.StoreRewardsDao
// storeRewardsDao is the data access object for the table store_rewards.
// You can define custom methods on it to extend its functionality as needed.
type storeRewardsDao struct {
internalStoreRewardsDao
}
var (
// StoreRewards is a globally accessible object for table store_rewards operations.
StoreRewards = storeRewardsDao{
internal.NewStoreRewardsDao(),
}
)
// Add your custom methods and functionality below.

View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalStoreTaskRewardsDao is an internal type for wrapping the internal DAO implementation.
type internalStoreTaskRewardsDao = *internal.StoreTaskRewardsDao
// storeTaskRewardsDao is the data access object for the table store_task_rewards.
// You can define custom methods on it to extend its functionality as needed.
type storeTaskRewardsDao struct {
internalStoreTaskRewardsDao
}
var (
// StoreTaskRewards is a globally accessible object for table store_task_rewards operations.
StoreTaskRewards = storeTaskRewardsDao{
internal.NewStoreTaskRewardsDao(),
}
)
// Add your custom methods and functionality below.

27
internal/dao/stores.go Normal file
View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalStoresDao is an internal type for wrapping the internal DAO implementation.
type internalStoresDao = *internal.StoresDao
// storesDao is the data access object for the table stores.
// You can define custom methods on it to extend its functionality as needed.
type storesDao struct {
internalStoresDao
}
var (
// Stores is a globally accessible object for table stores operations.
Stores = storesDao{
internal.NewStoresDao(),
}
)
// Add your custom methods and functionality below.

View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalSystemOperationLogsDao is an internal type for wrapping the internal DAO implementation.
type internalSystemOperationLogsDao = *internal.SystemOperationLogsDao
// systemOperationLogsDao is the data access object for the table system_operation_logs.
// You can define custom methods on it to extend its functionality as needed.
type systemOperationLogsDao struct {
internalSystemOperationLogsDao
}
var (
// SystemOperationLogs is a globally accessible object for table system_operation_logs operations.
SystemOperationLogs = systemOperationLogsDao{
internal.NewSystemOperationLogsDao(),
}
)
// Add your custom methods and functionality below.

27
internal/dao/tasks.go Normal file
View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalTasksDao is an internal type for wrapping the internal DAO implementation.
type internalTasksDao = *internal.TasksDao
// tasksDao is the data access object for the table tasks.
// You can define custom methods on it to extend its functionality as needed.
type tasksDao struct {
internalTasksDao
}
var (
// Tasks is a globally accessible object for table tasks operations.
Tasks = tasksDao{
internal.NewTasksDao(),
}
)
// Add your custom methods and functionality below.

View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalUserLoginRecordsDao is an internal type for wrapping the internal DAO implementation.
type internalUserLoginRecordsDao = *internal.UserLoginRecordsDao
// userLoginRecordsDao is the data access object for the table user_login_records.
// You can define custom methods on it to extend its functionality as needed.
type userLoginRecordsDao struct {
internalUserLoginRecordsDao
}
var (
// UserLoginRecords is a globally accessible object for table user_login_records operations.
UserLoginRecords = userLoginRecordsDao{
internal.NewUserLoginRecordsDao(),
}
)
// Add your custom methods and functionality below.

View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalUserTaskRecordsDao is an internal type for wrapping the internal DAO implementation.
type internalUserTaskRecordsDao = *internal.UserTaskRecordsDao
// userTaskRecordsDao is the data access object for the table user_task_records.
// You can define custom methods on it to extend its functionality as needed.
type userTaskRecordsDao struct {
internalUserTaskRecordsDao
}
var (
// UserTaskRecords is a globally accessible object for table user_task_records operations.
UserTaskRecords = userTaskRecordsDao{
internal.NewUserTaskRecordsDao(),
}
)
// Add your custom methods and functionality below.

27
internal/dao/users.go Normal file
View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalUsersDao is an internal type for wrapping the internal DAO implementation.
type internalUsersDao = *internal.UsersDao
// usersDao is the data access object for the table users.
// You can define custom methods on it to extend its functionality as needed.
type usersDao struct {
internalUsersDao
}
var (
// Users is a globally accessible object for table users operations.
Users = usersDao{
internal.NewUsersDao(),
}
)
// Add your custom methods and functionality below.