Files
olons_admin/server/internal/dao/internal/recharge_order.go
T
2026-10-10 20:56:17 +08:00

126 lines
4.7 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"
)
// RechargeOrderDao is the data access object for the table hg_recharge_order.
type RechargeOrderDao 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 RechargeOrderColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// RechargeOrderColumns defines and stores column names for the table hg_recharge_order.
type RechargeOrderColumns struct {
Id string // 主键
TenantId string // 租户ID
RechargeNo string // 充值单号
MemberId string // 会员ID
ChannelId string // 支付渠道ID
RequestAmount string // 申请金额(分)
PaidAmount string // 实付金额(分)
Currency string // 币种
ExternalNo string // 外部支付单号
VoucherAttachmentIds string // 打款凭证附件
RechargeType string // 充值类型
RechargeStatus string // 充值状态
Remark string // 会员备注
ReviewReasonCode string // 审核原因编码
ReviewReason string // 审核意见
ApprovalRequestId string // 审批单ID
LedgerId string // 入账台账ID
PaidAt string // 支付时间
ReviewedAt string // 审核时间
CreditedAt string // 入账时间
CreatedBy string // 创建者
UpdatedBy string // 更新者
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
}
// rechargeOrderColumns holds the columns for the table hg_recharge_order.
var rechargeOrderColumns = RechargeOrderColumns{
Id: "id",
TenantId: "tenant_id",
RechargeNo: "recharge_no",
MemberId: "member_id",
ChannelId: "channel_id",
RequestAmount: "request_amount",
PaidAmount: "paid_amount",
Currency: "currency",
ExternalNo: "external_no",
VoucherAttachmentIds: "voucher_attachment_ids",
RechargeType: "recharge_type",
RechargeStatus: "recharge_status",
Remark: "remark",
ReviewReasonCode: "review_reason_code",
ReviewReason: "review_reason",
ApprovalRequestId: "approval_request_id",
LedgerId: "ledger_id",
PaidAt: "paid_at",
ReviewedAt: "reviewed_at",
CreditedAt: "credited_at",
CreatedBy: "created_by",
UpdatedBy: "updated_by",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
}
// NewRechargeOrderDao creates and returns a new DAO object for table data access.
func NewRechargeOrderDao(handlers ...gdb.ModelHandler) *RechargeOrderDao {
return &RechargeOrderDao{
group: "default",
table: "hg_recharge_order",
columns: rechargeOrderColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *RechargeOrderDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *RechargeOrderDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *RechargeOrderDao) Columns() RechargeOrderColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *RechargeOrderDao) 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 *RechargeOrderDao) 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 *RechargeOrderDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}