Files
nl-video-api/internal/dao/payment_order.go
2025-08-03 00:11:15 +08:00

91 lines
3.1 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package dao
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// internalPaymentOrderDao is internal type for wrapping internal DAO implements.
type internalPaymentOrderDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns PaymentOrderColumns // columns contains all the column names of Table for convenient usage.
}
// PaymentOrderColumns defines and stores column names for table nl_payment_order.
type PaymentOrderColumns struct {
Id string // 订单ID
OrderNo string // 订单号
UserId string // 用户ID
VipLevelId string // VIP等级ID
Amount string // 订单金额
PaymentMethod string // 支付方式
PaymentStatus string // 支付状态0待支付1已支付2已取消3已退款
PaymentTime string // 支付时间
ExpireTime string // 过期时间
Remark string // 备注
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
}
// paymentOrderColumns holds the columns for table nl_payment_order.
var paymentOrderColumns = PaymentOrderColumns{
Id: "id",
OrderNo: "order_no",
UserId: "user_id",
VipLevelId: "vip_level_id",
Amount: "amount",
PaymentMethod: "payment_method",
PaymentStatus: "payment_status",
PaymentTime: "payment_time",
ExpireTime: "expire_time",
Remark: "remark",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
}
// NewPaymentOrderDao creates and returns a new DAO object for table data access.
func NewPaymentOrderDao() *internalPaymentOrderDao {
return &internalPaymentOrderDao{
group: "default",
table: "nl_payment_order",
columns: paymentOrderColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *internalPaymentOrderDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *internalPaymentOrderDao) Table() string {
return dao.table
}
// Columns returns the columns of current dao.
func (dao *internalPaymentOrderDao) Columns() PaymentOrderColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *internalPaymentOrderDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *internalPaymentOrderDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
func (dao *internalPaymentOrderDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) error {
return dao.Ctx(ctx).Transaction(ctx, f)
}