381 lines
15 KiB
Go
381 lines
15 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package payorder
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the payorder type in the database.
|
|
Label = "pay_order"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
|
FieldCreatedAt = "created_at"
|
|
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
|
FieldUpdatedAt = "updated_at"
|
|
// FieldStatus holds the string denoting the status field in the database.
|
|
FieldStatus = "status"
|
|
// FieldTenantID holds the string denoting the tenant_id field in the database.
|
|
FieldTenantID = "tenant_id"
|
|
// FieldDeletedAt holds the string denoting the deleted_at field in the database.
|
|
FieldDeletedAt = "deleted_at"
|
|
// FieldChannelID holds the string denoting the channel_id field in the database.
|
|
FieldChannelID = "channel_id"
|
|
// FieldUserID holds the string denoting the user_id field in the database.
|
|
FieldUserID = "user_id"
|
|
// FieldSubject holds the string denoting the subject field in the database.
|
|
FieldSubject = "subject"
|
|
// FieldBody holds the string denoting the body field in the database.
|
|
FieldBody = "body"
|
|
// FieldNotifyURL holds the string denoting the notify_url field in the database.
|
|
FieldNotifyURL = "notify_url"
|
|
// FieldAmount holds the string denoting the amount field in the database.
|
|
FieldAmount = "amount"
|
|
// FieldPaySource holds the string denoting the pay_source field in the database.
|
|
FieldPaySource = "pay_source"
|
|
// FieldChannelFeeRate holds the string denoting the channel_fee_rate field in the database.
|
|
FieldChannelFeeRate = "channel_fee_rate"
|
|
// FieldChannelFee holds the string denoting the channel_fee field in the database.
|
|
FieldChannelFee = "channel_fee"
|
|
// FieldOrderStatus holds the string denoting the order_status field in the database.
|
|
FieldOrderStatus = "order_status"
|
|
// FieldUserIP holds the string denoting the user_ip field in the database.
|
|
FieldUserIP = "user_ip"
|
|
// FieldExpireTime holds the string denoting the expire_time field in the database.
|
|
FieldExpireTime = "expire_time"
|
|
// FieldPayNo holds the string denoting the pay_no field in the database.
|
|
FieldPayNo = "pay_no"
|
|
// FieldSuccessTime holds the string denoting the success_time field in the database.
|
|
FieldSuccessTime = "success_time"
|
|
// FieldExtensionID holds the string denoting the extension_id field in the database.
|
|
FieldExtensionID = "extension_id"
|
|
// FieldTransactionID holds the string denoting the transaction_id field in the database.
|
|
FieldTransactionID = "transaction_id"
|
|
// FieldCurrency holds the string denoting the currency field in the database.
|
|
FieldCurrency = "currency"
|
|
// FieldRefundPrice holds the string denoting the refund_price field in the database.
|
|
FieldRefundPrice = "refund_price"
|
|
// FieldChannelOrderNo holds the string denoting the channel_order_no field in the database.
|
|
FieldChannelOrderNo = "channel_order_no"
|
|
// FieldChannelUserID holds the string denoting the channel_user_id field in the database.
|
|
FieldChannelUserID = "channel_user_id"
|
|
// EdgeChannel holds the string denoting the channel edge name in mutations.
|
|
EdgeChannel = "channel"
|
|
// EdgeOrdersExtension holds the string denoting the orders_extension edge name in mutations.
|
|
EdgeOrdersExtension = "orders_extension"
|
|
// EdgeNotifyTask holds the string denoting the notify_task edge name in mutations.
|
|
EdgeNotifyTask = "notify_task"
|
|
// EdgeRefund holds the string denoting the refund edge name in mutations.
|
|
EdgeRefund = "refund"
|
|
// Table holds the table name of the payorder in the database.
|
|
Table = "pay_order"
|
|
// ChannelTable is the table that holds the channel relation/edge.
|
|
ChannelTable = "pay_order"
|
|
// ChannelInverseTable is the table name for the PayChannel entity.
|
|
// It exists in this package in order to avoid circular dependency with the "paychannel" package.
|
|
ChannelInverseTable = "pay_channel"
|
|
// ChannelColumn is the table column denoting the channel relation/edge.
|
|
ChannelColumn = "channel_id"
|
|
// OrdersExtensionTable is the table that holds the orders_extension relation/edge.
|
|
OrdersExtensionTable = "pay_order_extension"
|
|
// OrdersExtensionInverseTable is the table name for the PayOrderExtension entity.
|
|
// It exists in this package in order to avoid circular dependency with the "payorderextension" package.
|
|
OrdersExtensionInverseTable = "pay_order_extension"
|
|
// OrdersExtensionColumn is the table column denoting the orders_extension relation/edge.
|
|
OrdersExtensionColumn = "order_id"
|
|
// NotifyTaskTable is the table that holds the notify_task relation/edge.
|
|
NotifyTaskTable = "pay_notify_task"
|
|
// NotifyTaskInverseTable is the table name for the PayNotifyTask entity.
|
|
// It exists in this package in order to avoid circular dependency with the "paynotifytask" package.
|
|
NotifyTaskInverseTable = "pay_notify_task"
|
|
// NotifyTaskColumn is the table column denoting the notify_task relation/edge.
|
|
NotifyTaskColumn = "order_id"
|
|
// RefundTable is the table that holds the refund relation/edge.
|
|
RefundTable = "pay_refund"
|
|
// RefundInverseTable is the table name for the PayRefund entity.
|
|
// It exists in this package in order to avoid circular dependency with the "payrefund" package.
|
|
RefundInverseTable = "pay_refund"
|
|
// RefundColumn is the table column denoting the refund relation/edge.
|
|
RefundColumn = "order_id"
|
|
)
|
|
|
|
// Columns holds all SQL columns for payorder fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldCreatedAt,
|
|
FieldUpdatedAt,
|
|
FieldStatus,
|
|
FieldTenantID,
|
|
FieldDeletedAt,
|
|
FieldChannelID,
|
|
FieldUserID,
|
|
FieldSubject,
|
|
FieldBody,
|
|
FieldNotifyURL,
|
|
FieldAmount,
|
|
FieldPaySource,
|
|
FieldChannelFeeRate,
|
|
FieldChannelFee,
|
|
FieldOrderStatus,
|
|
FieldUserIP,
|
|
FieldExpireTime,
|
|
FieldPayNo,
|
|
FieldSuccessTime,
|
|
FieldExtensionID,
|
|
FieldTransactionID,
|
|
FieldCurrency,
|
|
FieldRefundPrice,
|
|
FieldChannelOrderNo,
|
|
FieldChannelUserID,
|
|
}
|
|
|
|
// ValidColumn reports if the column name is valid (part of the table columns).
|
|
func ValidColumn(column string) bool {
|
|
for i := range Columns {
|
|
if column == Columns[i] {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
var (
|
|
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
|
DefaultCreatedAt func() time.Time
|
|
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
|
DefaultUpdatedAt func() time.Time
|
|
// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
|
|
UpdateDefaultUpdatedAt func() time.Time
|
|
// DefaultStatus holds the default value on creation for the "status" field.
|
|
DefaultStatus uint8
|
|
// DefaultTenantID holds the default value on creation for the "tenant_id" field.
|
|
DefaultTenantID uint64
|
|
// DefaultAmount holds the default value on creation for the "amount" field.
|
|
DefaultAmount uint64
|
|
// DefaultChannelFeeRate holds the default value on creation for the "channel_fee_rate" field.
|
|
DefaultChannelFeeRate string
|
|
// DefaultChannelFee holds the default value on creation for the "channel_fee" field.
|
|
DefaultChannelFee uint64
|
|
// DefaultOrderStatus holds the default value on creation for the "order_status" field.
|
|
DefaultOrderStatus string
|
|
// DefaultCurrency holds the default value on creation for the "currency" field.
|
|
DefaultCurrency string
|
|
// DefaultRefundPrice holds the default value on creation for the "refund_price" field.
|
|
DefaultRefundPrice uint64
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the PayOrder queries.
|
|
type OrderOption func(*sql.Selector)
|
|
|
|
// ByID orders the results by the id field.
|
|
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCreatedAt orders the results by the created_at field.
|
|
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUpdatedAt orders the results by the updated_at field.
|
|
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByStatus orders the results by the status field.
|
|
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldStatus, opts...).ToFunc()
|
|
}
|
|
|
|
// ByTenantID orders the results by the tenant_id field.
|
|
func ByTenantID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldTenantID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByDeletedAt orders the results by the deleted_at field.
|
|
func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByChannelID orders the results by the channel_id field.
|
|
func ByChannelID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldChannelID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUserID orders the results by the user_id field.
|
|
func ByUserID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUserID, opts...).ToFunc()
|
|
}
|
|
|
|
// BySubject orders the results by the subject field.
|
|
func BySubject(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldSubject, opts...).ToFunc()
|
|
}
|
|
|
|
// ByBody orders the results by the body field.
|
|
func ByBody(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldBody, opts...).ToFunc()
|
|
}
|
|
|
|
// ByNotifyURL orders the results by the notify_url field.
|
|
func ByNotifyURL(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldNotifyURL, opts...).ToFunc()
|
|
}
|
|
|
|
// ByAmount orders the results by the amount field.
|
|
func ByAmount(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldAmount, opts...).ToFunc()
|
|
}
|
|
|
|
// ByPaySource orders the results by the pay_source field.
|
|
func ByPaySource(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldPaySource, opts...).ToFunc()
|
|
}
|
|
|
|
// ByChannelFeeRate orders the results by the channel_fee_rate field.
|
|
func ByChannelFeeRate(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldChannelFeeRate, opts...).ToFunc()
|
|
}
|
|
|
|
// ByChannelFee orders the results by the channel_fee field.
|
|
func ByChannelFee(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldChannelFee, opts...).ToFunc()
|
|
}
|
|
|
|
// ByOrderStatus orders the results by the order_status field.
|
|
func ByOrderStatus(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldOrderStatus, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUserIP orders the results by the user_ip field.
|
|
func ByUserIP(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUserIP, opts...).ToFunc()
|
|
}
|
|
|
|
// ByExpireTime orders the results by the expire_time field.
|
|
func ByExpireTime(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldExpireTime, opts...).ToFunc()
|
|
}
|
|
|
|
// ByPayNo orders the results by the pay_no field.
|
|
func ByPayNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldPayNo, opts...).ToFunc()
|
|
}
|
|
|
|
// BySuccessTime orders the results by the success_time field.
|
|
func BySuccessTime(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldSuccessTime, opts...).ToFunc()
|
|
}
|
|
|
|
// ByExtensionID orders the results by the extension_id field.
|
|
func ByExtensionID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldExtensionID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByTransactionID orders the results by the transaction_id field.
|
|
func ByTransactionID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldTransactionID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCurrency orders the results by the currency field.
|
|
func ByCurrency(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCurrency, opts...).ToFunc()
|
|
}
|
|
|
|
// ByRefundPrice orders the results by the refund_price field.
|
|
func ByRefundPrice(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldRefundPrice, opts...).ToFunc()
|
|
}
|
|
|
|
// ByChannelOrderNo orders the results by the channel_order_no field.
|
|
func ByChannelOrderNo(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldChannelOrderNo, opts...).ToFunc()
|
|
}
|
|
|
|
// ByChannelUserID orders the results by the channel_user_id field.
|
|
func ByChannelUserID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldChannelUserID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByChannelField orders the results by channel field.
|
|
func ByChannelField(field string, opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newChannelStep(), sql.OrderByField(field, opts...))
|
|
}
|
|
}
|
|
|
|
// ByOrdersExtensionCount orders the results by orders_extension count.
|
|
func ByOrdersExtensionCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newOrdersExtensionStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByOrdersExtension orders the results by orders_extension terms.
|
|
func ByOrdersExtension(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newOrdersExtensionStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
|
|
// ByNotifyTaskCount orders the results by notify_task count.
|
|
func ByNotifyTaskCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newNotifyTaskStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByNotifyTask orders the results by notify_task terms.
|
|
func ByNotifyTask(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newNotifyTaskStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
|
|
// ByRefundCount orders the results by refund count.
|
|
func ByRefundCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newRefundStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByRefund orders the results by refund terms.
|
|
func ByRefund(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newRefundStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
func newChannelStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(ChannelInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, false, ChannelTable, ChannelColumn),
|
|
)
|
|
}
|
|
func newOrdersExtensionStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(OrdersExtensionInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, true, OrdersExtensionTable, OrdersExtensionColumn),
|
|
)
|
|
}
|
|
func newNotifyTaskStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(NotifyTaskInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, true, NotifyTaskTable, NotifyTaskColumn),
|
|
)
|
|
}
|
|
func newRefundStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(RefundInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, true, RefundTable, RefundColumn),
|
|
)
|
|
}
|