mingyang-admin-pay/rpc/ent/payorderextension/payorderextension.go

185 lines
6.8 KiB
Go

// Code generated by ent, DO NOT EDIT.
package payorderextension
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the payorderextension type in the database.
Label = "pay_order_extension"
// 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"
// FieldOrderID holds the string denoting the order_id field in the database.
FieldOrderID = "order_id"
// FieldChannelID holds the string denoting the channel_id field in the database.
FieldChannelID = "channel_id"
// FieldChannelExtras holds the string denoting the channel_extras field in the database.
FieldChannelExtras = "channel_extras"
// FieldChannelErrorCode holds the string denoting the channel_error_code field in the database.
FieldChannelErrorCode = "channel_error_code"
// FieldChannelErrorMsg holds the string denoting the channel_error_msg field in the database.
FieldChannelErrorMsg = "channel_error_msg"
// FieldChannelNotifyData holds the string denoting the channel_notify_data field in the database.
FieldChannelNotifyData = "channel_notify_data"
// EdgeChannel holds the string denoting the channel edge name in mutations.
EdgeChannel = "channel"
// EdgeOrder holds the string denoting the order edge name in mutations.
EdgeOrder = "order"
// Table holds the table name of the payorderextension in the database.
Table = "pay_order_extension"
// ChannelTable is the table that holds the channel relation/edge.
ChannelTable = "pay_order_extension"
// 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"
// OrderTable is the table that holds the order relation/edge.
OrderTable = "pay_order_extension"
// OrderInverseTable is the table name for the PayOrder entity.
// It exists in this package in order to avoid circular dependency with the "payorder" package.
OrderInverseTable = "pay_order"
// OrderColumn is the table column denoting the order relation/edge.
OrderColumn = "order_id"
)
// Columns holds all SQL columns for payorderextension fields.
var Columns = []string{
FieldID,
FieldCreatedAt,
FieldUpdatedAt,
FieldStatus,
FieldTenantID,
FieldDeletedAt,
FieldOrderID,
FieldChannelID,
FieldChannelExtras,
FieldChannelErrorCode,
FieldChannelErrorMsg,
FieldChannelNotifyData,
}
// 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
)
// OrderOption defines the ordering options for the PayOrderExtension 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()
}
// ByOrderID orders the results by the order_id field.
func ByOrderID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOrderID, opts...).ToFunc()
}
// ByChannelID orders the results by the channel_id field.
func ByChannelID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldChannelID, opts...).ToFunc()
}
// ByChannelErrorCode orders the results by the channel_error_code field.
func ByChannelErrorCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldChannelErrorCode, opts...).ToFunc()
}
// ByChannelErrorMsg orders the results by the channel_error_msg field.
func ByChannelErrorMsg(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldChannelErrorMsg, opts...).ToFunc()
}
// ByChannelNotifyData orders the results by the channel_notify_data field.
func ByChannelNotifyData(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldChannelNotifyData, 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...))
}
}
// ByOrderField orders the results by order field.
func ByOrderField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newOrderStep(), sql.OrderByField(field, opts...))
}
}
func newChannelStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(ChannelInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, false, ChannelTable, ChannelColumn),
)
}
func newOrderStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(OrderInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, false, OrderTable, OrderColumn),
)
}