This commit is contained in:
2026-01-18 18:20:40 +08:00
commit 20ed44aa74
178 changed files with 13789 additions and 0 deletions

View File

View File

@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"leke/internal/dao/internal"
)
// coachesDao is the data access object for the table coaches.
// You can define custom methods on it to extend its functionality as needed.
type coachesDao struct {
*internal.CoachesDao
}
var (
// Coaches is a globally accessible object for table coaches operations.
Coaches = coachesDao{internal.NewCoachesDao()}
)
// Add your custom methods and functionality below.

View File

@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"leke/internal/dao/internal"
)
// commentsDao is the data access object for the table comments.
// You can define custom methods on it to extend its functionality as needed.
type commentsDao struct {
*internal.CommentsDao
}
var (
// Comments is a globally accessible object for table comments operations.
Comments = commentsDao{internal.NewCommentsDao()}
)
// Add your custom methods and functionality below.

View File

@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"leke/internal/dao/internal"
)
// containmentRepoDao is the data access object for the table containment_repo.
// You can define custom methods on it to extend its functionality as needed.
type containmentRepoDao struct {
*internal.ContainmentRepoDao
}
var (
// ContainmentRepo is a globally accessible object for table containment_repo operations.
ContainmentRepo = containmentRepoDao{internal.NewContainmentRepoDao()}
)
// Add your custom methods and functionality below.

View File

@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"leke/internal/dao/internal"
)
// departmentDao is the data access object for the table department.
// You can define custom methods on it to extend its functionality as needed.
type departmentDao struct {
*internal.DepartmentDao
}
var (
// Department is a globally accessible object for table department operations.
Department = departmentDao{internal.NewDepartmentDao()}
)
// Add your custom methods and functionality below.

View File

@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"leke/internal/dao/internal"
)
// fansDao is the data access object for the table fans.
// You can define custom methods on it to extend its functionality as needed.
type fansDao struct {
*internal.FansDao
}
var (
// Fans is a globally accessible object for table fans operations.
Fans = fansDao{internal.NewFansDao()}
)
// Add your custom methods and functionality below.

View File

@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"leke/internal/dao/internal"
)
// forumCommentsDao is the data access object for the table forum_comments.
// You can define custom methods on it to extend its functionality as needed.
type forumCommentsDao struct {
*internal.ForumCommentsDao
}
var (
// ForumComments is a globally accessible object for table forum_comments operations.
ForumComments = forumCommentsDao{internal.NewForumCommentsDao()}
)
// Add your custom methods and functionality below.

View File

@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"leke/internal/dao/internal"
)
// forumPostsDao is the data access object for the table forum_posts.
// You can define custom methods on it to extend its functionality as needed.
type forumPostsDao struct {
*internal.ForumPostsDao
}
var (
// ForumPosts is a globally accessible object for table forum_posts operations.
ForumPosts = forumPostsDao{internal.NewForumPostsDao()}
)
// Add your custom methods and functionality below.

View File

@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"leke/internal/dao/internal"
)
// groupClassEnrollmentsDao is the data access object for the table group_class_enrollments.
// You can define custom methods on it to extend its functionality as needed.
type groupClassEnrollmentsDao struct {
*internal.GroupClassEnrollmentsDao
}
var (
// GroupClassEnrollments is a globally accessible object for table group_class_enrollments operations.
GroupClassEnrollments = groupClassEnrollmentsDao{internal.NewGroupClassEnrollmentsDao()}
)
// Add your custom methods and functionality below.

View File

@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"leke/internal/dao/internal"
)
// groupClassesDao is the data access object for the table group_classes.
// You can define custom methods on it to extend its functionality as needed.
type groupClassesDao struct {
*internal.GroupClassesDao
}
var (
// GroupClasses is a globally accessible object for table group_classes operations.
GroupClasses = groupClassesDao{internal.NewGroupClassesDao()}
)
// Add your custom methods and functionality below.

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"
)
// CoachesDao is the data access object for the table coaches.
type CoachesDao 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 CoachesColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// CoachesColumns defines and stores column names for the table coaches.
type CoachesColumns struct {
Id string // 教练ID
UserId string // 对应的用户ID如果教练也要登录的话
Name string // 教练姓名
Phone string // 教练电话
Specialty string // 擅长方向,比如瑜伽、力量、减脂
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
}
// coachesColumns holds the columns for the table coaches.
var coachesColumns = CoachesColumns{
Id: "id",
UserId: "user_id",
Name: "name",
Phone: "phone",
Specialty: "specialty",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
}
// NewCoachesDao creates and returns a new DAO object for table data access.
func NewCoachesDao(handlers ...gdb.ModelHandler) *CoachesDao {
return &CoachesDao{
group: "default",
table: "coaches",
columns: coachesColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *CoachesDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *CoachesDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *CoachesDao) Columns() CoachesColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *CoachesDao) 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 *CoachesDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *CoachesDao) 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,103 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// CommentsDao is the data access object for the table comments.
type CommentsDao 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 CommentsColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// CommentsColumns defines and stores column names for the table comments.
type CommentsColumns struct {
Id string // 评论ID
UserId string // 评论用户ID
TargetType string // 被评论对象类型(如 post/image/video 等)
TargetId string // 被评论对象ID
ParentId string // 父评论ID回复某条评论时填写
RootId string // 根评论ID同一楼的顶层评论ID便于树查询
Content string // 评论内容
Status string // 状态1正常 0屏蔽 2删除
LikeCount string // 点赞数
ReplyCount string // 回复数
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
DeletedAt string // 软删除时间
}
// commentsColumns holds the columns for the table comments.
var commentsColumns = CommentsColumns{
Id: "id",
UserId: "user_id",
TargetType: "target_type",
TargetId: "target_id",
ParentId: "parent_id",
RootId: "root_id",
Content: "content",
Status: "status",
LikeCount: "like_count",
ReplyCount: "reply_count",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewCommentsDao creates and returns a new DAO object for table data access.
func NewCommentsDao(handlers ...gdb.ModelHandler) *CommentsDao {
return &CommentsDao{
group: "default",
table: "comments",
columns: commentsColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *CommentsDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *CommentsDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *CommentsDao) Columns() CommentsColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *CommentsDao) 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 *CommentsDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *CommentsDao) 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"
)
// ContainmentRepoDao is the data access object for the table containment_repo.
type ContainmentRepoDao 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 ContainmentRepoColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// ContainmentRepoColumns defines and stores column names for the table containment_repo.
type ContainmentRepoColumns struct {
Id string // auto-increment primary key
AnomalyName string // name of the anomaly (异常体的名字)
AgentName string // agent (特工)
RepoName string // containment repository name or code (收容库)
Department string // 部门
}
// containmentRepoColumns holds the columns for the table containment_repo.
var containmentRepoColumns = ContainmentRepoColumns{
Id: "id",
AnomalyName: "anomaly_name",
AgentName: "agent_name",
RepoName: "repo_name",
Department: "department",
}
// NewContainmentRepoDao creates and returns a new DAO object for table data access.
func NewContainmentRepoDao(handlers ...gdb.ModelHandler) *ContainmentRepoDao {
return &ContainmentRepoDao{
group: "default",
table: "containment_repo",
columns: containmentRepoColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *ContainmentRepoDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *ContainmentRepoDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *ContainmentRepoDao) Columns() ContainmentRepoColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *ContainmentRepoDao) 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 *ContainmentRepoDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *ContainmentRepoDao) 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"
)
// DepartmentDao is the data access object for the table department.
type DepartmentDao 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 DepartmentColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// DepartmentColumns defines and stores column names for the table department.
type DepartmentColumns struct {
Id string // 自增主键
UserId string // 所属用户ID对应 users.id
BranchName string // 分部名称
TerminalCount string // 分部散逸端的数量
Weather string // 分部当前天气/气候描述
ManagerName string // 分部经理名称
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
Location string // 地址
}
// departmentColumns holds the columns for the table department.
var departmentColumns = DepartmentColumns{
Id: "id",
UserId: "user_id",
BranchName: "branch_name",
TerminalCount: "terminal_count",
Weather: "weather",
ManagerName: "manager_name",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
Location: "location",
}
// NewDepartmentDao creates and returns a new DAO object for table data access.
func NewDepartmentDao(handlers ...gdb.ModelHandler) *DepartmentDao {
return &DepartmentDao{
group: "default",
table: "department",
columns: departmentColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *DepartmentDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *DepartmentDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *DepartmentDao) Columns() DepartmentColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *DepartmentDao) 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 *DepartmentDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *DepartmentDao) 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"
)
// FansDao is the data access object for the table fans.
type FansDao 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 FansColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// FansColumns defines and stores column names for the table fans.
type FansColumns struct {
Id string // 自增主键
UserId string // 用户ID被关注者本人
FanId string // 粉丝用户ID
Status string // 状态1=粉丝 0=取关/无效
Remark string // 备注名user_id 对 fan_id 的备注/分组)
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
}
// fansColumns holds the columns for the table fans.
var fansColumns = FansColumns{
Id: "id",
UserId: "user_id",
FanId: "fan_id",
Status: "status",
Remark: "remark",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
}
// NewFansDao creates and returns a new DAO object for table data access.
func NewFansDao(handlers ...gdb.ModelHandler) *FansDao {
return &FansDao{
group: "default",
table: "fans",
columns: fansColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *FansDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *FansDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *FansDao) Columns() FansColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *FansDao) 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 *FansDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *FansDao) 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"
)
// ForumCommentsDao is the data access object for the table forum_comments.
type ForumCommentsDao 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 ForumCommentsColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// ForumCommentsColumns defines and stores column names for the table forum_comments.
type ForumCommentsColumns struct {
Id string // 评论ID主键
UserId string // 评论发布者ID关联users.id无外键
PostId string // 所属帖子ID关联forum_posts.id无外键
ParentId string // 父评论IDNULL=根评论非NULL=回复某条评论)
Content string // 评论内容支持emoji
Status string // 评论状态normal=正常 deleted=软删除 audit=审核中 reject=审核驳回
LikeCount string // 点赞数
ReplyCount string // 回复数(冗余字段)
CreatedAt string // 评论创建时间
UpdatedAt string // 评论更新时间
DeletedAt string // 软删除时间
}
// forumCommentsColumns holds the columns for the table forum_comments.
var forumCommentsColumns = ForumCommentsColumns{
Id: "id",
UserId: "user_id",
PostId: "post_id",
ParentId: "parent_id",
Content: "content",
Status: "status",
LikeCount: "like_count",
ReplyCount: "reply_count",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewForumCommentsDao creates and returns a new DAO object for table data access.
func NewForumCommentsDao(handlers ...gdb.ModelHandler) *ForumCommentsDao {
return &ForumCommentsDao{
group: "default",
table: "forum_comments",
columns: forumCommentsColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *ForumCommentsDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *ForumCommentsDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *ForumCommentsDao) Columns() ForumCommentsColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *ForumCommentsDao) 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 *ForumCommentsDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *ForumCommentsDao) 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"
)
// ForumPostsDao is the data access object for the table forum_posts.
type ForumPostsDao 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 ForumPostsColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// ForumPostsColumns defines and stores column names for the table forum_posts.
type ForumPostsColumns struct {
Id string // 帖子ID主键
UserId string // 发帖用户ID关联users.id无外键
Title string // 帖子标题
Content string // 帖子正文(支持富文本/emoji
CoverImage string // 帖子封面图URL
Status string // 帖子状态normal=正常 deleted=软删除 audit=审核中 reject=审核驳回
ViewCount string // 浏览量(冗余字段)
LikeCount string // 点赞数(冗余字段)
CommentCount string // 评论数(冗余字段)
CreatedAt string // 发帖时间
UpdatedAt string // 更新时间
DeletedAt string // 软删除时间
}
// forumPostsColumns holds the columns for the table forum_posts.
var forumPostsColumns = ForumPostsColumns{
Id: "id",
UserId: "user_id",
Title: "title",
Content: "content",
CoverImage: "cover_image",
Status: "status",
ViewCount: "view_count",
LikeCount: "like_count",
CommentCount: "comment_count",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewForumPostsDao creates and returns a new DAO object for table data access.
func NewForumPostsDao(handlers ...gdb.ModelHandler) *ForumPostsDao {
return &ForumPostsDao{
group: "default",
table: "forum_posts",
columns: forumPostsColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *ForumPostsDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *ForumPostsDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *ForumPostsDao) Columns() ForumPostsColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *ForumPostsDao) 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 *ForumPostsDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *ForumPostsDao) 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,89 @@
// ==========================================================================
// 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"
)
// GroupClassEnrollmentsDao is the data access object for the table group_class_enrollments.
type GroupClassEnrollmentsDao 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 GroupClassEnrollmentsColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// GroupClassEnrollmentsColumns defines and stores column names for the table group_class_enrollments.
type GroupClassEnrollmentsColumns struct {
Id string // 报名ID
ClassId string // 团课ID
UserId string // 用户ID
Status string // 状态booked已报名checked_in已签到cancelled已取消
EnrolledAt string // 报名时间
CheckedInAt string // 签到时间
}
// groupClassEnrollmentsColumns holds the columns for the table group_class_enrollments.
var groupClassEnrollmentsColumns = GroupClassEnrollmentsColumns{
Id: "id",
ClassId: "class_id",
UserId: "user_id",
Status: "status",
EnrolledAt: "enrolled_at",
CheckedInAt: "checked_in_at",
}
// NewGroupClassEnrollmentsDao creates and returns a new DAO object for table data access.
func NewGroupClassEnrollmentsDao(handlers ...gdb.ModelHandler) *GroupClassEnrollmentsDao {
return &GroupClassEnrollmentsDao{
group: "default",
table: "group_class_enrollments",
columns: groupClassEnrollmentsColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *GroupClassEnrollmentsDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *GroupClassEnrollmentsDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *GroupClassEnrollmentsDao) Columns() GroupClassEnrollmentsColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *GroupClassEnrollmentsDao) 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 *GroupClassEnrollmentsDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *GroupClassEnrollmentsDao) 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"
)
// GroupClassesDao is the data access object for the table group_classes.
type GroupClassesDao 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 GroupClassesColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// GroupClassesColumns defines and stores column names for the table group_classes.
type GroupClassesColumns struct {
Id string // 团课ID
Title string // 课程名称,如:燃脂搏击、瑜伽
Description string // 课程介绍
CoachId string // 授课教练ID
Location string // 上课地点/门店/教室
StartTime string // 开始时间
EndTime string // 结束时间
MaxCapacity string // 最大人数
Price string // 价格0表示免费或已包含在会员卡内
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
}
// groupClassesColumns holds the columns for the table group_classes.
var groupClassesColumns = GroupClassesColumns{
Id: "id",
Title: "title",
Description: "description",
CoachId: "coach_id",
Location: "location",
StartTime: "start_time",
EndTime: "end_time",
MaxCapacity: "max_capacity",
Price: "price",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
}
// NewGroupClassesDao creates and returns a new DAO object for table data access.
func NewGroupClassesDao(handlers ...gdb.ModelHandler) *GroupClassesDao {
return &GroupClassesDao{
group: "default",
table: "group_classes",
columns: groupClassesColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *GroupClassesDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *GroupClassesDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *GroupClassesDao) Columns() GroupClassesColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *GroupClassesDao) 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 *GroupClassesDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *GroupClassesDao) 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,127 @@
// ==========================================================================
// 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"
)
// RoleCardsDao is the data access object for the table role_cards.
type RoleCardsDao 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 RoleCardsColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// RoleCardsColumns defines and stores column names for the table role_cards.
type RoleCardsColumns struct {
Id string // 角色卡ID
UserId string // 所属用户ID
DepartmentId string // 所属部门ID
Commendation string // 嘉奖次数
Reprimand string // 申戒次数
BlueTrack string // 蓝轨0-40
YellowTrack string // 黄轨0-40
RedTrack string // 红轨0-40
ArcAbnormal string // ARC异常
ArcReality string // ARC现实
ArcPosition string // ARC职位
AgentName string // 特工名字
CodeName string // 代号
Gender string // 性别
QaMeticulous string // Meticulousness (0-100, QA)
QaDeception string // Deception (0-100, QA)
QaVigor string // Vigor / Drive (0-100, QA)
QaEmpathy string // Empathy (0-100, QA)
QaInitiative string // Initiative (0-100, QA)
QaResilience string // Resilience / Persistence (0-100, QA)
QaPresence string // Presence / Charisma (0-100, QA)
QaProfessional string // Professionalism (0-100, QA)
QaDiscretion string // Discretion / Low profile (0-100, QA)
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
}
// roleCardsColumns holds the columns for the table role_cards.
var roleCardsColumns = RoleCardsColumns{
Id: "id",
UserId: "user_id",
DepartmentId: "department_id",
Commendation: "commendation",
Reprimand: "reprimand",
BlueTrack: "blue_track",
YellowTrack: "yellow_track",
RedTrack: "red_track",
ArcAbnormal: "arc_abnormal",
ArcReality: "arc_reality",
ArcPosition: "arc_position",
AgentName: "agent_name",
CodeName: "code_name",
Gender: "gender",
QaMeticulous: "qa_meticulous",
QaDeception: "qa_deception",
QaVigor: "qa_vigor",
QaEmpathy: "qa_empathy",
QaInitiative: "qa_initiative",
QaResilience: "qa_resilience",
QaPresence: "qa_presence",
QaProfessional: "qa_professional",
QaDiscretion: "qa_discretion",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
}
// NewRoleCardsDao creates and returns a new DAO object for table data access.
func NewRoleCardsDao(handlers ...gdb.ModelHandler) *RoleCardsDao {
return &RoleCardsDao{
group: "default",
table: "role_cards",
columns: roleCardsColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *RoleCardsDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *RoleCardsDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *RoleCardsDao) Columns() RoleCardsColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *RoleCardsDao) 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 *RoleCardsDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *RoleCardsDao) 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"
)
// SubscribeDao is the data access object for the table subscribe.
type SubscribeDao 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 SubscribeColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SubscribeColumns defines and stores column names for the table subscribe.
type SubscribeColumns struct {
Id string // 自增主键
UserId string // 用户ID关注者本人
FollowId string // 被关注的用户ID
Status string // 状态1=关注中 0=取消关注
Remark string // 备注名user_id 对 follow_id 的备注)
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
}
// subscribeColumns holds the columns for the table subscribe.
var subscribeColumns = SubscribeColumns{
Id: "id",
UserId: "user_id",
FollowId: "follow_id",
Status: "status",
Remark: "remark",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
}
// NewSubscribeDao creates and returns a new DAO object for table data access.
func NewSubscribeDao(handlers ...gdb.ModelHandler) *SubscribeDao {
return &SubscribeDao{
group: "default",
table: "subscribe",
columns: subscribeColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SubscribeDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SubscribeDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SubscribeDao) Columns() SubscribeColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SubscribeDao) 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 *SubscribeDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SubscribeDao) 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,115 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TrpgRoomDao is the data access object for the table trpg_room.
type TrpgRoomDao 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 TrpgRoomColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TrpgRoomColumns defines and stores column names for the table trpg_room.
type TrpgRoomColumns struct {
Id string // 自增主键
RoomId string // 房间全局唯一ID建议UUID
RoomCode string // 房间号(玩家看到/输入的房间号)
RoomName string // 房间名称
HostId string // 主持人用户IDGM/KP/经理对应用户表id
HostNickname string // 主持人昵称(冗余字段,可选)
MaxPlayers string // 最大玩家人数(不含主持人,可按需要约定)
CurrentPlayers string // 当前玩家人数(不含主持人)
HasPassword string // 是否有密码0无 1有
RoomPassword string // 房间密码(建议存加密/哈希后的密码)
IsPrivate string // 是否私密房0公开 1私密
Status string // 房间状态0未开始 1进行中 2已结束 3已关闭
SystemName string // 规则系统:如 COC、DND5E 等
ScenarioName string // 模组/剧本名称
Description string // 房间简介/招募说明
CreatedAt string // 房间创建时间
StartedAt string // 开团时间
EndedAt string // 结束时间
UpdatedAt string // 信息最近更新时间
}
// trpgRoomColumns holds the columns for the table trpg_room.
var trpgRoomColumns = TrpgRoomColumns{
Id: "id",
RoomId: "room_id",
RoomCode: "room_code",
RoomName: "room_name",
HostId: "host_id",
HostNickname: "host_nickname",
MaxPlayers: "max_players",
CurrentPlayers: "current_players",
HasPassword: "has_password",
RoomPassword: "room_password",
IsPrivate: "is_private",
Status: "status",
SystemName: "system_name",
ScenarioName: "scenario_name",
Description: "description",
CreatedAt: "created_at",
StartedAt: "started_at",
EndedAt: "ended_at",
UpdatedAt: "updated_at",
}
// NewTrpgRoomDao creates and returns a new DAO object for table data access.
func NewTrpgRoomDao(handlers ...gdb.ModelHandler) *TrpgRoomDao {
return &TrpgRoomDao{
group: "default",
table: "trpg_room",
columns: trpgRoomColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TrpgRoomDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TrpgRoomDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TrpgRoomDao) Columns() TrpgRoomColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TrpgRoomDao) 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 *TrpgRoomDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TrpgRoomDao) 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"
)
// UserDepartmentDao is the data access object for the table user_department.
type UserDepartmentDao 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 UserDepartmentColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// UserDepartmentColumns defines and stores column names for the table user_department.
type UserDepartmentColumns struct {
Id string //
UserId string // 用户ID对应 users.id
DeptId string // 部门ID对应 department.id
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
}
// userDepartmentColumns holds the columns for the table user_department.
var userDepartmentColumns = UserDepartmentColumns{
Id: "id",
UserId: "user_id",
DeptId: "dept_id",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
}
// NewUserDepartmentDao creates and returns a new DAO object for table data access.
func NewUserDepartmentDao(handlers ...gdb.ModelHandler) *UserDepartmentDao {
return &UserDepartmentDao{
group: "default",
table: "user_department",
columns: userDepartmentColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *UserDepartmentDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *UserDepartmentDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *UserDepartmentDao) Columns() UserDepartmentColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *UserDepartmentDao) 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 *UserDepartmentDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *UserDepartmentDao) 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,117 @@
// ==========================================================================
// 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.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// UsersColumns defines and stores column names for the table users.
type UsersColumns struct {
Id string // 用户ID
Account string // 账号
Password string // 密码哈希
Nickname string // 昵称
Gender string // 性别0未知 1男 2女
BirthDate string // 生日
UserType string // 用户类型normal普通用户vip为VIP用户
VipStartAt string // VIP开始时间
VipEndAt string // VIP结束时间
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
RealityRole string // 现实身份/角色
AbnormalRole string // 异常身份/角色
JobTitle string // 职位
Commendation string //
Admonition string //
Email string //
RedTrace string // 红轨
YellowTrace string // 黄轨
BlueTrace string // 蓝轨
}
// usersColumns holds the columns for the table users.
var usersColumns = UsersColumns{
Id: "id",
Account: "account",
Password: "password",
Nickname: "nickname",
Gender: "gender",
BirthDate: "birth_date",
UserType: "user_type",
VipStartAt: "vip_start_at",
VipEndAt: "vip_end_at",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
RealityRole: "reality_role",
AbnormalRole: "abnormal_role",
JobTitle: "job_title",
Commendation: "Commendation",
Admonition: "Admonition",
Email: "email",
RedTrace: "red_trace",
YellowTrace: "yellow_trace",
BlueTrace: "blue_trace",
}
// NewUsersDao creates and returns a new DAO object for table data access.
func NewUsersDao(handlers ...gdb.ModelHandler) *UsersDao {
return &UsersDao{
group: "default",
table: "users",
columns: usersColumns,
handlers: handlers,
}
}
// 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 {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *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,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"
)
// WorkoutLogsDao is the data access object for the table workout_logs.
type WorkoutLogsDao 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 WorkoutLogsColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// WorkoutLogsColumns defines and stores column names for the table workout_logs.
type WorkoutLogsColumns struct {
Id string // 健身记录ID
UserId string // 关联的用户ID
WorkoutDate string // 健身日期
StartTime string // 开始时间
EndTime string // 结束时间
DurationMinutes string // 时长(分钟)
Calories string // 估算消耗的卡路里
Description string // 本次训练的备注,比如训练内容、部位等
CreatedAt string // 记录创建时间
}
// workoutLogsColumns holds the columns for the table workout_logs.
var workoutLogsColumns = WorkoutLogsColumns{
Id: "id",
UserId: "user_id",
WorkoutDate: "workout_date",
StartTime: "start_time",
EndTime: "end_time",
DurationMinutes: "duration_minutes",
Calories: "calories",
Description: "description",
CreatedAt: "created_at",
}
// NewWorkoutLogsDao creates and returns a new DAO object for table data access.
func NewWorkoutLogsDao(handlers ...gdb.ModelHandler) *WorkoutLogsDao {
return &WorkoutLogsDao{
group: "default",
table: "workout_logs",
columns: workoutLogsColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *WorkoutLogsDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *WorkoutLogsDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *WorkoutLogsDao) Columns() WorkoutLogsColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *WorkoutLogsDao) 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 *WorkoutLogsDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *WorkoutLogsDao) 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,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"leke/internal/dao/internal"
)
// roleCardsDao is the data access object for the table role_cards.
// You can define custom methods on it to extend its functionality as needed.
type roleCardsDao struct {
*internal.RoleCardsDao
}
var (
// RoleCards is a globally accessible object for table role_cards operations.
RoleCards = roleCardsDao{internal.NewRoleCardsDao()}
)
// Add your custom methods and functionality below.

View File

@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"leke/internal/dao/internal"
)
// subscribeDao is the data access object for the table subscribe.
// You can define custom methods on it to extend its functionality as needed.
type subscribeDao struct {
*internal.SubscribeDao
}
var (
// Subscribe is a globally accessible object for table subscribe operations.
Subscribe = subscribeDao{internal.NewSubscribeDao()}
)
// Add your custom methods and functionality below.

View File

@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"leke/internal/dao/internal"
)
// trpgRoomDao is the data access object for the table trpg_room.
// You can define custom methods on it to extend its functionality as needed.
type trpgRoomDao struct {
*internal.TrpgRoomDao
}
var (
// TrpgRoom is a globally accessible object for table trpg_room operations.
TrpgRoom = trpgRoomDao{internal.NewTrpgRoomDao()}
)
// Add your custom methods and functionality below.

View File

@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"leke/internal/dao/internal"
)
// userDepartmentDao is the data access object for the table user_department.
// You can define custom methods on it to extend its functionality as needed.
type userDepartmentDao struct {
*internal.UserDepartmentDao
}
var (
// UserDepartment is a globally accessible object for table user_department operations.
UserDepartment = userDepartmentDao{internal.NewUserDepartmentDao()}
)
// Add your custom methods and functionality below.

View File

@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"leke/internal/dao/internal"
)
// 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 {
*internal.UsersDao
}
var (
// Users is a globally accessible object for table users operations.
Users = usersDao{internal.NewUsersDao()}
)
// Add your custom methods and functionality below.

View File

@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"leke/internal/dao/internal"
)
// workoutLogsDao is the data access object for the table workout_logs.
// You can define custom methods on it to extend its functionality as needed.
type workoutLogsDao struct {
*internal.WorkoutLogsDao
}
var (
// WorkoutLogs is a globally accessible object for table workout_logs operations.
WorkoutLogs = workoutLogsDao{internal.NewWorkoutLogsDao()}
)
// Add your custom methods and functionality below.