书籍列表接口新增参数
This commit is contained in:
27
internal/dao/ad_event_logs.go
Normal file
27
internal/dao/ad_event_logs.go
Normal 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"
|
||||
)
|
||||
|
||||
// internalAdEventLogsDao is an internal type for wrapping the internal DAO implementation.
|
||||
type internalAdEventLogsDao = *internal.AdEventLogsDao
|
||||
|
||||
// adEventLogsDao is the data access object for the table ad_event_logs.
|
||||
// You can define custom methods on it to extend its functionality as needed.
|
||||
type adEventLogsDao struct {
|
||||
internalAdEventLogsDao
|
||||
}
|
||||
|
||||
var (
|
||||
// AdEventLogs is a globally accessible object for table ad_event_logs operations.
|
||||
AdEventLogs = adEventLogsDao{
|
||||
internal.NewAdEventLogsDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Add your custom methods and functionality below.
|
||||
27
internal/dao/ad_event_transitions.go
Normal file
27
internal/dao/ad_event_transitions.go
Normal 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"
|
||||
)
|
||||
|
||||
// internalAdEventTransitionsDao is an internal type for wrapping the internal DAO implementation.
|
||||
type internalAdEventTransitionsDao = *internal.AdEventTransitionsDao
|
||||
|
||||
// adEventTransitionsDao is the data access object for the table ad_event_transitions.
|
||||
// You can define custom methods on it to extend its functionality as needed.
|
||||
type adEventTransitionsDao struct {
|
||||
internalAdEventTransitionsDao
|
||||
}
|
||||
|
||||
var (
|
||||
// AdEventTransitions is a globally accessible object for table ad_event_transitions operations.
|
||||
AdEventTransitions = adEventTransitionsDao{
|
||||
internal.NewAdEventTransitionsDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Add your custom methods and functionality below.
|
||||
27
internal/dao/book_recommendations.go
Normal file
27
internal/dao/book_recommendations.go
Normal 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"
|
||||
)
|
||||
|
||||
// internalBookRecommendationsDao is an internal type for wrapping the internal DAO implementation.
|
||||
type internalBookRecommendationsDao = *internal.BookRecommendationsDao
|
||||
|
||||
// bookRecommendationsDao is the data access object for the table book_recommendations.
|
||||
// You can define custom methods on it to extend its functionality as needed.
|
||||
type bookRecommendationsDao struct {
|
||||
internalBookRecommendationsDao
|
||||
}
|
||||
|
||||
var (
|
||||
// BookRecommendations is a globally accessible object for table book_recommendations operations.
|
||||
BookRecommendations = bookRecommendationsDao{
|
||||
internal.NewBookRecommendationsDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Add your custom methods and functionality below.
|
||||
97
internal/dao/internal/ad_event_logs.go
Normal file
97
internal/dao/internal/ad_event_logs.go
Normal 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"
|
||||
)
|
||||
|
||||
// AdEventLogsDao is the data access object for the table ad_event_logs.
|
||||
type AdEventLogsDao 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 AdEventLogsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdEventLogsColumns defines and stores column names for the table ad_event_logs.
|
||||
type AdEventLogsColumns struct {
|
||||
Id string // 广告事件ID
|
||||
UserId string // 用户ID
|
||||
AdsPlatId string // 平台ID:1-META,2-ADMOB
|
||||
AdsCategoryId string // 广告类型:1-横幅,2-插页,3-激励插页,4-激励,5-原生,6-开屏
|
||||
AppPackage string // App包名
|
||||
Status string // 广告状态:1-拉取失败,2-拉取成功,3-显示失败,4-显示成功,5-未观看完成,6-观看完成,7-未点击,8-已点击,9-未下载,10-已下载
|
||||
StatusDesc string // 状态描述
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// adEventLogsColumns holds the columns for the table ad_event_logs.
|
||||
var adEventLogsColumns = AdEventLogsColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
AdsPlatId: "ads_plat_id",
|
||||
AdsCategoryId: "ads_category_id",
|
||||
AppPackage: "app_package",
|
||||
Status: "status",
|
||||
StatusDesc: "status_desc",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewAdEventLogsDao creates and returns a new DAO object for table data access.
|
||||
func NewAdEventLogsDao(handlers ...gdb.ModelHandler) *AdEventLogsDao {
|
||||
return &AdEventLogsDao{
|
||||
group: "default",
|
||||
table: "ad_event_logs",
|
||||
columns: adEventLogsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AdEventLogsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AdEventLogsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AdEventLogsDao) Columns() AdEventLogsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AdEventLogsDao) 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 *AdEventLogsDao) 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 *AdEventLogsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
89
internal/dao/internal/ad_event_transitions.go
Normal file
89
internal/dao/internal/ad_event_transitions.go
Normal 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"
|
||||
)
|
||||
|
||||
// AdEventTransitionsDao is the data access object for the table ad_event_transitions.
|
||||
type AdEventTransitionsDao 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 AdEventTransitionsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdEventTransitionsColumns defines and stores column names for the table ad_event_transitions.
|
||||
type AdEventTransitionsColumns struct {
|
||||
Id string // 状态流转记录ID
|
||||
EventId string // 所属广告事件ID,关联ad_event_logs.id
|
||||
FromStatus string // 原状态(首次记录为空)
|
||||
ToStatus string // 目标状态
|
||||
CreatedAt string // 状态变更时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// adEventTransitionsColumns holds the columns for the table ad_event_transitions.
|
||||
var adEventTransitionsColumns = AdEventTransitionsColumns{
|
||||
Id: "id",
|
||||
EventId: "event_id",
|
||||
FromStatus: "from_status",
|
||||
ToStatus: "to_status",
|
||||
CreatedAt: "created_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewAdEventTransitionsDao creates and returns a new DAO object for table data access.
|
||||
func NewAdEventTransitionsDao(handlers ...gdb.ModelHandler) *AdEventTransitionsDao {
|
||||
return &AdEventTransitionsDao{
|
||||
group: "default",
|
||||
table: "ad_event_transitions",
|
||||
columns: adEventTransitionsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AdEventTransitionsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AdEventTransitionsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AdEventTransitionsDao) Columns() AdEventTransitionsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AdEventTransitionsDao) 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 *AdEventTransitionsDao) 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 *AdEventTransitionsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -13,9 +13,10 @@ import (
|
||||
|
||||
// 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.
|
||||
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.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdminsColumns defines and stores column names for the table admins.
|
||||
@ -39,11 +40,12 @@ var adminsColumns = AdminsColumns{
|
||||
}
|
||||
|
||||
// NewAdminsDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminsDao() *AdminsDao {
|
||||
func NewAdminsDao(handlers ...gdb.ModelHandler) *AdminsDao {
|
||||
return &AdminsDao{
|
||||
group: "default",
|
||||
table: "admins",
|
||||
columns: adminsColumns,
|
||||
group: "default",
|
||||
table: "admins",
|
||||
columns: adminsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +71,11 @@ func (dao *AdminsDao) Group() string {
|
||||
|
||||
// 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)
|
||||
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.
|
||||
|
||||
@ -13,41 +13,45 @@ import (
|
||||
|
||||
// AuthorsDao is the data access object for the table authors.
|
||||
type AuthorsDao 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 AuthorsColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AuthorsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AuthorsColumns defines and stores column names for the table authors.
|
||||
type AuthorsColumns struct {
|
||||
Id string // 作者ID
|
||||
UserId string // 用户ID
|
||||
PenName string // 笔名
|
||||
Bio string // 作者简介
|
||||
Status string // 状态:1=正常,2=禁用
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
Id string // 作者ID
|
||||
UserId string // 用户ID
|
||||
PenName string // 笔名
|
||||
Bio string // 作者简介
|
||||
FollowerCount string // 粉丝数量
|
||||
Status string // 状态:1=正常,2=待审核, 3=未通过
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// authorsColumns holds the columns for the table authors.
|
||||
var authorsColumns = AuthorsColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
PenName: "pen_name",
|
||||
Bio: "bio",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
PenName: "pen_name",
|
||||
Bio: "bio",
|
||||
FollowerCount: "follower_count",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewAuthorsDao creates and returns a new DAO object for table data access.
|
||||
func NewAuthorsDao() *AuthorsDao {
|
||||
func NewAuthorsDao(handlers ...gdb.ModelHandler) *AuthorsDao {
|
||||
return &AuthorsDao{
|
||||
group: "default",
|
||||
table: "authors",
|
||||
columns: authorsColumns,
|
||||
group: "default",
|
||||
table: "authors",
|
||||
columns: authorsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,7 +77,11 @@ func (dao *AuthorsDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AuthorsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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.
|
||||
|
||||
@ -13,9 +13,10 @@ import (
|
||||
|
||||
// BookRatingsDao is the data access object for the table book_ratings.
|
||||
type BookRatingsDao 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 BookRatingsColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 BookRatingsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// BookRatingsColumns defines and stores column names for the table book_ratings.
|
||||
@ -39,11 +40,12 @@ var bookRatingsColumns = BookRatingsColumns{
|
||||
}
|
||||
|
||||
// NewBookRatingsDao creates and returns a new DAO object for table data access.
|
||||
func NewBookRatingsDao() *BookRatingsDao {
|
||||
func NewBookRatingsDao(handlers ...gdb.ModelHandler) *BookRatingsDao {
|
||||
return &BookRatingsDao{
|
||||
group: "default",
|
||||
table: "book_ratings",
|
||||
columns: bookRatingsColumns,
|
||||
group: "default",
|
||||
table: "book_ratings",
|
||||
columns: bookRatingsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +71,11 @@ func (dao *BookRatingsDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *BookRatingsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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.
|
||||
|
||||
95
internal/dao/internal/book_recommendations.go
Normal file
95
internal/dao/internal/book_recommendations.go
Normal 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"
|
||||
)
|
||||
|
||||
// BookRecommendationsDao is the data access object for the table book_recommendations.
|
||||
type BookRecommendationsDao 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 BookRecommendationsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// BookRecommendationsColumns defines and stores column names for the table book_recommendations.
|
||||
type BookRecommendationsColumns struct {
|
||||
Id string // 主键
|
||||
BookId string // 书籍ID,关联 books 表
|
||||
Type string // 推荐类型:1=首页Banner,2=编辑推荐,3=分类推荐等
|
||||
CoverUrl string // 推荐封面图(横图)
|
||||
SortOrder string // 展示排序,越小越靠前
|
||||
Status string // 是否启用:1=启用,0=禁用
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// bookRecommendationsColumns holds the columns for the table book_recommendations.
|
||||
var bookRecommendationsColumns = BookRecommendationsColumns{
|
||||
Id: "id",
|
||||
BookId: "book_id",
|
||||
Type: "type",
|
||||
CoverUrl: "cover_url",
|
||||
SortOrder: "sort_order",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewBookRecommendationsDao creates and returns a new DAO object for table data access.
|
||||
func NewBookRecommendationsDao(handlers ...gdb.ModelHandler) *BookRecommendationsDao {
|
||||
return &BookRecommendationsDao{
|
||||
group: "default",
|
||||
table: "book_recommendations",
|
||||
columns: bookRecommendationsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *BookRecommendationsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *BookRecommendationsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *BookRecommendationsDao) Columns() BookRecommendationsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *BookRecommendationsDao) 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 *BookRecommendationsDao) 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 *BookRecommendationsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -13,9 +13,10 @@ import (
|
||||
|
||||
// BooksDao is the data access object for the table books.
|
||||
type BooksDao 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 BooksColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 BooksColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// BooksColumns defines and stores column names for the table books.
|
||||
@ -38,6 +39,7 @@ type BooksColumns struct {
|
||||
DeletedAt string // 软删除时间戳
|
||||
IsRecommended string // 是否推荐:0=否,1=是
|
||||
IsFeatured string // 是否精选:0=否,1=是
|
||||
IsHot string // 是否热门:0=否,1=是
|
||||
Language string // 语言,如 zh=中文,en=英文,jp=日文
|
||||
}
|
||||
|
||||
@ -61,15 +63,17 @@ var booksColumns = BooksColumns{
|
||||
DeletedAt: "deleted_at",
|
||||
IsRecommended: "is_recommended",
|
||||
IsFeatured: "is_featured",
|
||||
IsHot: "is_hot",
|
||||
Language: "language",
|
||||
}
|
||||
|
||||
// NewBooksDao creates and returns a new DAO object for table data access.
|
||||
func NewBooksDao() *BooksDao {
|
||||
func NewBooksDao(handlers ...gdb.ModelHandler) *BooksDao {
|
||||
return &BooksDao{
|
||||
group: "default",
|
||||
table: "books",
|
||||
columns: booksColumns,
|
||||
group: "default",
|
||||
table: "books",
|
||||
columns: booksColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,7 +99,11 @@ func (dao *BooksDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *BooksDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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.
|
||||
|
||||
@ -13,9 +13,10 @@ import (
|
||||
|
||||
// BookshelvesDao is the data access object for the table bookshelves.
|
||||
type BookshelvesDao 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 BookshelvesColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 BookshelvesColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// BookshelvesColumns defines and stores column names for the table bookshelves.
|
||||
@ -43,11 +44,12 @@ var bookshelvesColumns = BookshelvesColumns{
|
||||
}
|
||||
|
||||
// NewBookshelvesDao creates and returns a new DAO object for table data access.
|
||||
func NewBookshelvesDao() *BookshelvesDao {
|
||||
func NewBookshelvesDao(handlers ...gdb.ModelHandler) *BookshelvesDao {
|
||||
return &BookshelvesDao{
|
||||
group: "default",
|
||||
table: "bookshelves",
|
||||
columns: bookshelvesColumns,
|
||||
group: "default",
|
||||
table: "bookshelves",
|
||||
columns: bookshelvesColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,7 +75,11 @@ func (dao *BookshelvesDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *BookshelvesDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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.
|
||||
|
||||
@ -13,9 +13,10 @@ import (
|
||||
|
||||
// CategoriesDao is the data access object for the table categories.
|
||||
type CategoriesDao 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 CategoriesColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 CategoriesColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// CategoriesColumns defines and stores column names for the table categories.
|
||||
@ -39,11 +40,12 @@ var categoriesColumns = CategoriesColumns{
|
||||
}
|
||||
|
||||
// NewCategoriesDao creates and returns a new DAO object for table data access.
|
||||
func NewCategoriesDao() *CategoriesDao {
|
||||
func NewCategoriesDao(handlers ...gdb.ModelHandler) *CategoriesDao {
|
||||
return &CategoriesDao{
|
||||
group: "default",
|
||||
table: "categories",
|
||||
columns: categoriesColumns,
|
||||
group: "default",
|
||||
table: "categories",
|
||||
columns: categoriesColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +71,11 @@ func (dao *CategoriesDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *CategoriesDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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.
|
||||
|
||||
@ -13,9 +13,10 @@ import (
|
||||
|
||||
// ChaptersDao is the data access object for the table chapters.
|
||||
type ChaptersDao 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 ChaptersColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 ChaptersColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// ChaptersColumns defines and stores column names for the table chapters.
|
||||
@ -49,11 +50,12 @@ var chaptersColumns = ChaptersColumns{
|
||||
}
|
||||
|
||||
// NewChaptersDao creates and returns a new DAO object for table data access.
|
||||
func NewChaptersDao() *ChaptersDao {
|
||||
func NewChaptersDao(handlers ...gdb.ModelHandler) *ChaptersDao {
|
||||
return &ChaptersDao{
|
||||
group: "default",
|
||||
table: "chapters",
|
||||
columns: chaptersColumns,
|
||||
group: "default",
|
||||
table: "chapters",
|
||||
columns: chaptersColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,7 +81,11 @@ func (dao *ChaptersDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *ChaptersDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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.
|
||||
|
||||
@ -13,9 +13,10 @@ import (
|
||||
|
||||
// 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.
|
||||
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.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// FeedbacksColumns defines and stores column names for the table feedbacks.
|
||||
@ -39,11 +40,12 @@ var feedbacksColumns = FeedbacksColumns{
|
||||
}
|
||||
|
||||
// NewFeedbacksDao creates and returns a new DAO object for table data access.
|
||||
func NewFeedbacksDao() *FeedbacksDao {
|
||||
func NewFeedbacksDao(handlers ...gdb.ModelHandler) *FeedbacksDao {
|
||||
return &FeedbacksDao{
|
||||
group: "default",
|
||||
table: "feedbacks",
|
||||
columns: feedbacksColumns,
|
||||
group: "default",
|
||||
table: "feedbacks",
|
||||
columns: feedbacksColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +71,11 @@ func (dao *FeedbacksDao) Group() string {
|
||||
|
||||
// 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)
|
||||
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.
|
||||
|
||||
95
internal/dao/internal/sign_in_reward_details.go
Normal file
95
internal/dao/internal/sign_in_reward_details.go
Normal 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"
|
||||
)
|
||||
|
||||
// SignInRewardDetailsDao is the data access object for the table sign_in_reward_details.
|
||||
type SignInRewardDetailsDao 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 SignInRewardDetailsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// SignInRewardDetailsColumns defines and stores column names for the table sign_in_reward_details.
|
||||
type SignInRewardDetailsColumns struct {
|
||||
Id string // 主键
|
||||
RuleId string // 规则ID,关联 sign_in_reward_rules 表
|
||||
DayNumber string // 签到天数(1到cycle_days)
|
||||
RewardType string // 奖励类型:1=积分
|
||||
Quantity string // 奖励数量,如积分数量或礼包数量
|
||||
Status string // 记录状态:1=启用,0=禁用
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// signInRewardDetailsColumns holds the columns for the table sign_in_reward_details.
|
||||
var signInRewardDetailsColumns = SignInRewardDetailsColumns{
|
||||
Id: "id",
|
||||
RuleId: "rule_id",
|
||||
DayNumber: "day_number",
|
||||
RewardType: "reward_type",
|
||||
Quantity: "quantity",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewSignInRewardDetailsDao creates and returns a new DAO object for table data access.
|
||||
func NewSignInRewardDetailsDao(handlers ...gdb.ModelHandler) *SignInRewardDetailsDao {
|
||||
return &SignInRewardDetailsDao{
|
||||
group: "default",
|
||||
table: "sign_in_reward_details",
|
||||
columns: signInRewardDetailsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SignInRewardDetailsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SignInRewardDetailsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SignInRewardDetailsDao) Columns() SignInRewardDetailsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SignInRewardDetailsDao) 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 *SignInRewardDetailsDao) 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 *SignInRewardDetailsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
95
internal/dao/internal/sign_in_reward_rules.go
Normal file
95
internal/dao/internal/sign_in_reward_rules.go
Normal 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"
|
||||
)
|
||||
|
||||
// SignInRewardRulesDao is the data access object for the table sign_in_reward_rules.
|
||||
type SignInRewardRulesDao 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 SignInRewardRulesColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// SignInRewardRulesColumns defines and stores column names for the table sign_in_reward_rules.
|
||||
type SignInRewardRulesColumns struct {
|
||||
Id string // 主键
|
||||
RuleName string // 规则名称,如“7天签到活动”
|
||||
CycleDays string // 奖励周期天数,如7天
|
||||
StartDate string // 活动开始日期
|
||||
EndDate string // 活动结束日期
|
||||
Status string // 规则状态:1=启用,0=禁用
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// signInRewardRulesColumns holds the columns for the table sign_in_reward_rules.
|
||||
var signInRewardRulesColumns = SignInRewardRulesColumns{
|
||||
Id: "id",
|
||||
RuleName: "rule_name",
|
||||
CycleDays: "cycle_days",
|
||||
StartDate: "start_date",
|
||||
EndDate: "end_date",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewSignInRewardRulesDao creates and returns a new DAO object for table data access.
|
||||
func NewSignInRewardRulesDao(handlers ...gdb.ModelHandler) *SignInRewardRulesDao {
|
||||
return &SignInRewardRulesDao{
|
||||
group: "default",
|
||||
table: "sign_in_reward_rules",
|
||||
columns: signInRewardRulesColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SignInRewardRulesDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SignInRewardRulesDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SignInRewardRulesDao) Columns() SignInRewardRulesColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SignInRewardRulesDao) 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 *SignInRewardRulesDao) 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 *SignInRewardRulesDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
81
internal/dao/internal/system.go
Normal file
81
internal/dao/internal/system.go
Normal 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"
|
||||
)
|
||||
|
||||
// SystemDao is the data access object for the table system.
|
||||
type SystemDao 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 SystemColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// SystemColumns defines and stores column names for the table system.
|
||||
type SystemColumns struct {
|
||||
Key string //
|
||||
Value string //
|
||||
}
|
||||
|
||||
// systemColumns holds the columns for the table system.
|
||||
var systemColumns = SystemColumns{
|
||||
Key: "key",
|
||||
Value: "value",
|
||||
}
|
||||
|
||||
// NewSystemDao creates and returns a new DAO object for table data access.
|
||||
func NewSystemDao(handlers ...gdb.ModelHandler) *SystemDao {
|
||||
return &SystemDao{
|
||||
group: "default",
|
||||
table: "system",
|
||||
columns: systemColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SystemDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SystemDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SystemDao) Columns() SystemColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SystemDao) 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 *SystemDao) 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 *SystemDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
93
internal/dao/internal/task_logs.go
Normal file
93
internal/dao/internal/task_logs.go
Normal 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"
|
||||
)
|
||||
|
||||
// TaskLogsDao is the data access object for the table task_logs.
|
||||
type TaskLogsDao 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 TaskLogsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// TaskLogsColumns defines and stores column names for the table task_logs.
|
||||
type TaskLogsColumns struct {
|
||||
Id string // 任务日志ID
|
||||
TaskId string // 任务ID,关联 tasks.id
|
||||
UserId string // 用户ID,关联 users.id
|
||||
RewardPoints string // 本次任务获得的积分
|
||||
ActionTime string // 操作时间(如完成时间)
|
||||
Status string // 日志状态:1=有效,2=无效
|
||||
Extra string // 扩展信息,例如来源、IP 等
|
||||
CreatedAt string // 创建时间
|
||||
}
|
||||
|
||||
// taskLogsColumns holds the columns for the table task_logs.
|
||||
var taskLogsColumns = TaskLogsColumns{
|
||||
Id: "id",
|
||||
TaskId: "task_id",
|
||||
UserId: "user_id",
|
||||
RewardPoints: "reward_points",
|
||||
ActionTime: "action_time",
|
||||
Status: "status",
|
||||
Extra: "extra",
|
||||
CreatedAt: "created_at",
|
||||
}
|
||||
|
||||
// NewTaskLogsDao creates and returns a new DAO object for table data access.
|
||||
func NewTaskLogsDao(handlers ...gdb.ModelHandler) *TaskLogsDao {
|
||||
return &TaskLogsDao{
|
||||
group: "default",
|
||||
table: "task_logs",
|
||||
columns: taskLogsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *TaskLogsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *TaskLogsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *TaskLogsDao) Columns() TaskLogsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *TaskLogsDao) 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 *TaskLogsDao) 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 *TaskLogsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
83
internal/dao/internal/task_types.go
Normal file
83
internal/dao/internal/task_types.go
Normal file
@ -0,0 +1,83 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// TaskTypesDao is the data access object for the table task_types.
|
||||
type TaskTypesDao 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 TaskTypesColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// TaskTypesColumns defines and stores column names for the table task_types.
|
||||
type TaskTypesColumns struct {
|
||||
Id string // 任务类型ID
|
||||
Name string // 任务类型名称,例如:广告、写一本书、首次登录
|
||||
Description string // 任务类型描述
|
||||
Status string // 状态:1=启用,2=禁用
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
}
|
||||
|
||||
// taskTypesColumns holds the columns for the table task_types.
|
||||
var taskTypesColumns = TaskTypesColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
Description: "description",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
}
|
||||
|
||||
// NewTaskTypesDao creates and returns a new DAO object for table data access.
|
||||
func NewTaskTypesDao() *TaskTypesDao {
|
||||
return &TaskTypesDao{
|
||||
group: "default",
|
||||
table: "task_types",
|
||||
columns: taskTypesColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *TaskTypesDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *TaskTypesDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *TaskTypesDao) Columns() TaskTypesColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *TaskTypesDao) 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 *TaskTypesDao) 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 *TaskTypesDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
95
internal/dao/internal/tasks.go
Normal file
95
internal/dao/internal/tasks.go
Normal 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"
|
||||
)
|
||||
|
||||
// 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.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// TasksColumns defines and stores column names for the table tasks.
|
||||
type TasksColumns struct {
|
||||
Id string // 任务ID
|
||||
TaskType string // 任务类型:1=首次登录,2=广告,3=发布书籍
|
||||
Title string // 任务标题
|
||||
Description string // 任务描述
|
||||
RewardPoints string // 完成任务奖励的积分数
|
||||
Status string // 状态:1=启用,2=禁用
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// tasksColumns holds the columns for the table tasks.
|
||||
var tasksColumns = TasksColumns{
|
||||
Id: "id",
|
||||
TaskType: "task_type",
|
||||
Title: "title",
|
||||
Description: "description",
|
||||
RewardPoints: "reward_points",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewTasksDao creates and returns a new DAO object for table data access.
|
||||
func NewTasksDao(handlers ...gdb.ModelHandler) *TasksDao {
|
||||
return &TasksDao{
|
||||
group: "default",
|
||||
table: "tasks",
|
||||
columns: tasksColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// 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 {
|
||||
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 *TasksDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -13,9 +13,10 @@ import (
|
||||
|
||||
// UserChapterPurchasesDao is the data access object for the table user_chapter_purchases.
|
||||
type UserChapterPurchasesDao 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 UserChapterPurchasesColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 UserChapterPurchasesColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// UserChapterPurchasesColumns defines and stores column names for the table user_chapter_purchases.
|
||||
@ -39,11 +40,12 @@ var userChapterPurchasesColumns = UserChapterPurchasesColumns{
|
||||
}
|
||||
|
||||
// NewUserChapterPurchasesDao creates and returns a new DAO object for table data access.
|
||||
func NewUserChapterPurchasesDao() *UserChapterPurchasesDao {
|
||||
func NewUserChapterPurchasesDao(handlers ...gdb.ModelHandler) *UserChapterPurchasesDao {
|
||||
return &UserChapterPurchasesDao{
|
||||
group: "default",
|
||||
table: "user_chapter_purchases",
|
||||
columns: userChapterPurchasesColumns,
|
||||
group: "default",
|
||||
table: "user_chapter_purchases",
|
||||
columns: userChapterPurchasesColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +71,11 @@ func (dao *UserChapterPurchasesDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *UserChapterPurchasesDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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.
|
||||
|
||||
@ -13,9 +13,10 @@ import (
|
||||
|
||||
// UserFollowAuthorsDao is the data access object for the table user_follow_authors.
|
||||
type UserFollowAuthorsDao 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 UserFollowAuthorsColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 UserFollowAuthorsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// UserFollowAuthorsColumns defines and stores column names for the table user_follow_authors.
|
||||
@ -35,11 +36,12 @@ var userFollowAuthorsColumns = UserFollowAuthorsColumns{
|
||||
}
|
||||
|
||||
// NewUserFollowAuthorsDao creates and returns a new DAO object for table data access.
|
||||
func NewUserFollowAuthorsDao() *UserFollowAuthorsDao {
|
||||
func NewUserFollowAuthorsDao(handlers ...gdb.ModelHandler) *UserFollowAuthorsDao {
|
||||
return &UserFollowAuthorsDao{
|
||||
group: "default",
|
||||
table: "user_follow_authors",
|
||||
columns: userFollowAuthorsColumns,
|
||||
group: "default",
|
||||
table: "user_follow_authors",
|
||||
columns: userFollowAuthorsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,7 +67,11 @@ func (dao *UserFollowAuthorsDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *UserFollowAuthorsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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.
|
||||
|
||||
@ -13,9 +13,10 @@ import (
|
||||
|
||||
// UserPointsLogsDao is the data access object for the table user_points_logs.
|
||||
type UserPointsLogsDao 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 UserPointsLogsColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 UserPointsLogsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// UserPointsLogsColumns defines and stores column names for the table user_points_logs.
|
||||
@ -41,11 +42,12 @@ var userPointsLogsColumns = UserPointsLogsColumns{
|
||||
}
|
||||
|
||||
// NewUserPointsLogsDao creates and returns a new DAO object for table data access.
|
||||
func NewUserPointsLogsDao() *UserPointsLogsDao {
|
||||
func NewUserPointsLogsDao(handlers ...gdb.ModelHandler) *UserPointsLogsDao {
|
||||
return &UserPointsLogsDao{
|
||||
group: "default",
|
||||
table: "user_points_logs",
|
||||
columns: userPointsLogsColumns,
|
||||
group: "default",
|
||||
table: "user_points_logs",
|
||||
columns: userPointsLogsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,7 +73,11 @@ func (dao *UserPointsLogsDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *UserPointsLogsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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.
|
||||
|
||||
@ -13,9 +13,10 @@ import (
|
||||
|
||||
// UserReadHistoryDao is the data access object for the table user_read_history.
|
||||
type UserReadHistoryDao 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 UserReadHistoryColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 UserReadHistoryColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// UserReadHistoryColumns defines and stores column names for the table user_read_history.
|
||||
@ -37,11 +38,12 @@ var userReadHistoryColumns = UserReadHistoryColumns{
|
||||
}
|
||||
|
||||
// NewUserReadHistoryDao creates and returns a new DAO object for table data access.
|
||||
func NewUserReadHistoryDao() *UserReadHistoryDao {
|
||||
func NewUserReadHistoryDao(handlers ...gdb.ModelHandler) *UserReadHistoryDao {
|
||||
return &UserReadHistoryDao{
|
||||
group: "default",
|
||||
table: "user_read_history",
|
||||
columns: userReadHistoryColumns,
|
||||
group: "default",
|
||||
table: "user_read_history",
|
||||
columns: userReadHistoryColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,7 +69,11 @@ func (dao *UserReadHistoryDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *UserReadHistoryDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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.
|
||||
|
||||
@ -13,9 +13,10 @@ import (
|
||||
|
||||
// UserReadRecordsDao is the data access object for the table user_read_records.
|
||||
type UserReadRecordsDao 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 UserReadRecordsColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 UserReadRecordsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// UserReadRecordsColumns defines and stores column names for the table user_read_records.
|
||||
@ -43,11 +44,12 @@ var userReadRecordsColumns = UserReadRecordsColumns{
|
||||
}
|
||||
|
||||
// NewUserReadRecordsDao creates and returns a new DAO object for table data access.
|
||||
func NewUserReadRecordsDao() *UserReadRecordsDao {
|
||||
func NewUserReadRecordsDao(handlers ...gdb.ModelHandler) *UserReadRecordsDao {
|
||||
return &UserReadRecordsDao{
|
||||
group: "default",
|
||||
table: "user_read_records",
|
||||
columns: userReadRecordsColumns,
|
||||
group: "default",
|
||||
table: "user_read_records",
|
||||
columns: userReadRecordsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,7 +75,11 @@ func (dao *UserReadRecordsDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *UserReadRecordsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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.
|
||||
|
||||
97
internal/dao/internal/user_sign_in_logs.go
Normal file
97
internal/dao/internal/user_sign_in_logs.go
Normal 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"
|
||||
)
|
||||
|
||||
// UserSignInLogsDao is the data access object for the table user_sign_in_logs.
|
||||
type UserSignInLogsDao 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 UserSignInLogsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// UserSignInLogsColumns defines and stores column names for the table user_sign_in_logs.
|
||||
type UserSignInLogsColumns struct {
|
||||
Id string // 主键
|
||||
UserId string // 用户ID,关联 users 表
|
||||
RuleId string // 规则ID,关联 sign_in_reward_rules 表
|
||||
RewardDetailId string // 奖励详情ID,关联 sign_in_reward_details 表
|
||||
SignInDate string // 签到日期
|
||||
Quantity string // 奖励数量,如积分数量或礼包数量
|
||||
Status string // 记录状态:1=有效,0=无效
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// userSignInLogsColumns holds the columns for the table user_sign_in_logs.
|
||||
var userSignInLogsColumns = UserSignInLogsColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
RuleId: "rule_id",
|
||||
RewardDetailId: "reward_detail_id",
|
||||
SignInDate: "sign_in_date",
|
||||
Quantity: "quantity",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewUserSignInLogsDao creates and returns a new DAO object for table data access.
|
||||
func NewUserSignInLogsDao(handlers ...gdb.ModelHandler) *UserSignInLogsDao {
|
||||
return &UserSignInLogsDao{
|
||||
group: "default",
|
||||
table: "user_sign_in_logs",
|
||||
columns: userSignInLogsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *UserSignInLogsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *UserSignInLogsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *UserSignInLogsDao) Columns() UserSignInLogsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *UserSignInLogsDao) 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 *UserSignInLogsDao) 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 *UserSignInLogsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -13,43 +13,49 @@ import (
|
||||
|
||||
// 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.
|
||||
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
|
||||
Username string // 用户名
|
||||
PasswordHash string // 密码哈希
|
||||
Avatar string // 头像URL
|
||||
Email string // 邮箱
|
||||
Points string // 积分
|
||||
CreatedAt string // 注册时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
Id string // 用户ID
|
||||
Username string // 用户名
|
||||
PasswordHash string // 密码哈希
|
||||
Avatar string // 头像URL
|
||||
Email string // 邮箱
|
||||
Points string // 积分
|
||||
CreatedAt string // 注册时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
BackgroundUrl string // 作者背景图
|
||||
AttentionCount string // 关注他人的数量 attention count
|
||||
}
|
||||
|
||||
// usersColumns holds the columns for the table users.
|
||||
var usersColumns = UsersColumns{
|
||||
Id: "id",
|
||||
Username: "username",
|
||||
PasswordHash: "password_hash",
|
||||
Avatar: "avatar",
|
||||
Email: "email",
|
||||
Points: "points",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
Id: "id",
|
||||
Username: "username",
|
||||
PasswordHash: "password_hash",
|
||||
Avatar: "avatar",
|
||||
Email: "email",
|
||||
Points: "points",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
BackgroundUrl: "background_url",
|
||||
AttentionCount: "attention_count",
|
||||
}
|
||||
|
||||
// NewUsersDao creates and returns a new DAO object for table data access.
|
||||
func NewUsersDao() *UsersDao {
|
||||
func NewUsersDao(handlers ...gdb.ModelHandler) *UsersDao {
|
||||
return &UsersDao{
|
||||
group: "default",
|
||||
table: "users",
|
||||
columns: usersColumns,
|
||||
group: "default",
|
||||
table: "users",
|
||||
columns: usersColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,7 +81,11 @@ func (dao *UsersDao) Group() string {
|
||||
|
||||
// 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)
|
||||
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.
|
||||
|
||||
27
internal/dao/sign_in_reward_details.go
Normal file
27
internal/dao/sign_in_reward_details.go
Normal 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"
|
||||
)
|
||||
|
||||
// internalSignInRewardDetailsDao is an internal type for wrapping the internal DAO implementation.
|
||||
type internalSignInRewardDetailsDao = *internal.SignInRewardDetailsDao
|
||||
|
||||
// signInRewardDetailsDao is the data access object for the table sign_in_reward_details.
|
||||
// You can define custom methods on it to extend its functionality as needed.
|
||||
type signInRewardDetailsDao struct {
|
||||
internalSignInRewardDetailsDao
|
||||
}
|
||||
|
||||
var (
|
||||
// SignInRewardDetails is a globally accessible object for table sign_in_reward_details operations.
|
||||
SignInRewardDetails = signInRewardDetailsDao{
|
||||
internal.NewSignInRewardDetailsDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Add your custom methods and functionality below.
|
||||
27
internal/dao/sign_in_reward_rules.go
Normal file
27
internal/dao/sign_in_reward_rules.go
Normal 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"
|
||||
)
|
||||
|
||||
// internalSignInRewardRulesDao is an internal type for wrapping the internal DAO implementation.
|
||||
type internalSignInRewardRulesDao = *internal.SignInRewardRulesDao
|
||||
|
||||
// signInRewardRulesDao is the data access object for the table sign_in_reward_rules.
|
||||
// You can define custom methods on it to extend its functionality as needed.
|
||||
type signInRewardRulesDao struct {
|
||||
internalSignInRewardRulesDao
|
||||
}
|
||||
|
||||
var (
|
||||
// SignInRewardRules is a globally accessible object for table sign_in_reward_rules operations.
|
||||
SignInRewardRules = signInRewardRulesDao{
|
||||
internal.NewSignInRewardRulesDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Add your custom methods and functionality below.
|
||||
27
internal/dao/system.go
Normal file
27
internal/dao/system.go
Normal 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"
|
||||
)
|
||||
|
||||
// internalSystemDao is an internal type for wrapping the internal DAO implementation.
|
||||
type internalSystemDao = *internal.SystemDao
|
||||
|
||||
// systemDao is the data access object for the table system.
|
||||
// You can define custom methods on it to extend its functionality as needed.
|
||||
type systemDao struct {
|
||||
internalSystemDao
|
||||
}
|
||||
|
||||
var (
|
||||
// System is a globally accessible object for table system operations.
|
||||
System = systemDao{
|
||||
internal.NewSystemDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Add your custom methods and functionality below.
|
||||
27
internal/dao/task_logs.go
Normal file
27
internal/dao/task_logs.go
Normal 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"
|
||||
)
|
||||
|
||||
// internalTaskLogsDao is an internal type for wrapping the internal DAO implementation.
|
||||
type internalTaskLogsDao = *internal.TaskLogsDao
|
||||
|
||||
// taskLogsDao is the data access object for the table task_logs.
|
||||
// You can define custom methods on it to extend its functionality as needed.
|
||||
type taskLogsDao struct {
|
||||
internalTaskLogsDao
|
||||
}
|
||||
|
||||
var (
|
||||
// TaskLogs is a globally accessible object for table task_logs operations.
|
||||
TaskLogs = taskLogsDao{
|
||||
internal.NewTaskLogsDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Add your custom methods and functionality below.
|
||||
27
internal/dao/task_types.go
Normal file
27
internal/dao/task_types.go
Normal 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"
|
||||
)
|
||||
|
||||
// internalTaskTypesDao is an internal type for wrapping the internal DAO implementation.
|
||||
type internalTaskTypesDao = *internal.TaskTypesDao
|
||||
|
||||
// taskTypesDao is the data access object for the table task_types.
|
||||
// You can define custom methods on it to extend its functionality as needed.
|
||||
type taskTypesDao struct {
|
||||
internalTaskTypesDao
|
||||
}
|
||||
|
||||
var (
|
||||
// TaskTypes is a globally accessible object for table task_types operations.
|
||||
TaskTypes = taskTypesDao{
|
||||
internal.NewTaskTypesDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Add your custom methods and functionality below.
|
||||
27
internal/dao/tasks.go
Normal file
27
internal/dao/tasks.go
Normal 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.
|
||||
27
internal/dao/user_sign_in_logs.go
Normal file
27
internal/dao/user_sign_in_logs.go
Normal 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"
|
||||
)
|
||||
|
||||
// internalUserSignInLogsDao is an internal type for wrapping the internal DAO implementation.
|
||||
type internalUserSignInLogsDao = *internal.UserSignInLogsDao
|
||||
|
||||
// userSignInLogsDao is the data access object for the table user_sign_in_logs.
|
||||
// You can define custom methods on it to extend its functionality as needed.
|
||||
type userSignInLogsDao struct {
|
||||
internalUserSignInLogsDao
|
||||
}
|
||||
|
||||
var (
|
||||
// UserSignInLogs is a globally accessible object for table user_sign_in_logs operations.
|
||||
UserSignInLogs = userSignInLogsDao{
|
||||
internal.NewUserSignInLogsDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Add your custom methods and functionality below.
|
||||
Reference in New Issue
Block a user