92 lines
3.4 KiB
Go
92 lines
3.4 KiB
Go
// ==========================================================================
|
||
// 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"
|
||
)
|
||
|
||
// RewardCallbackDao is the data access object for the table reward_callback.
|
||
type RewardCallbackDao 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 RewardCallbackColumns // columns contains all the column names of Table for convenient usage.
|
||
}
|
||
|
||
// RewardCallbackColumns defines and stores column names for the table reward_callback.
|
||
type RewardCallbackColumns struct {
|
||
Id string //
|
||
Uid string // 用户账号
|
||
OrderId string // 订单号必须保证全局唯一(保证接口幂等)
|
||
PrizeChannelId string // 券渠道 ID
|
||
PrizeId string // 券 ID
|
||
PrizeType string // 奖励类型,1 网鱼积分,2 网鱼经验值,3 网鱼兑换码
|
||
PrizeSubType string // 奖励子类型,默认为 0,有多种子类型时可用,如 1,5 元网费充值券,2、满 30-5 满减券等
|
||
Num string // 奖励个数,默认 1,比如经验值 10
|
||
CustomInfo string // 透传字段 (json串)
|
||
AppId string // 业务 id(标识业务方,由游戏人生提供)
|
||
}
|
||
|
||
// rewardCallbackColumns holds the columns for the table reward_callback.
|
||
var rewardCallbackColumns = RewardCallbackColumns{
|
||
Id: "id",
|
||
Uid: "uid",
|
||
OrderId: "order_id",
|
||
PrizeChannelId: "prize_channel_id",
|
||
PrizeId: "prize_id",
|
||
PrizeType: "prize_type",
|
||
PrizeSubType: "prize_sub_type",
|
||
Num: "num",
|
||
CustomInfo: "custom_info",
|
||
AppId: "app_id",
|
||
}
|
||
|
||
// NewRewardCallbackDao creates and returns a new DAO object for table data access.
|
||
func NewRewardCallbackDao() *RewardCallbackDao {
|
||
return &RewardCallbackDao{
|
||
group: "default",
|
||
table: "reward_callback",
|
||
columns: rewardCallbackColumns,
|
||
}
|
||
}
|
||
|
||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||
func (dao *RewardCallbackDao) DB() gdb.DB {
|
||
return g.DB(dao.group)
|
||
}
|
||
|
||
// Table returns the table name of the current DAO.
|
||
func (dao *RewardCallbackDao) Table() string {
|
||
return dao.table
|
||
}
|
||
|
||
// Columns returns all column names of the current DAO.
|
||
func (dao *RewardCallbackDao) Columns() RewardCallbackColumns {
|
||
return dao.columns
|
||
}
|
||
|
||
// Group returns the database configuration group name of the current DAO.
|
||
func (dao *RewardCallbackDao) 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 *RewardCallbackDao) 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 *RewardCallbackDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||
}
|