Files
2026-04-03 01:31:20 +08:00

139 lines
4.9 KiB
Go

// Code generated by ent, DO NOT EDIT.
package modelpricing
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the modelpricing type in the database.
Label = "model_pricing"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldModelID holds the string denoting the model_id field in the database.
FieldModelID = "model_id"
// FieldAccessLevel holds the string denoting the access_level field in the database.
FieldAccessLevel = "access_level"
// FieldIsFree holds the string denoting the is_free field in the database.
FieldIsFree = "is_free"
// FieldInputPrice holds the string denoting the input_price field in the database.
FieldInputPrice = "input_price"
// FieldOutputPrice holds the string denoting the output_price field in the database.
FieldOutputPrice = "output_price"
// 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"
// EdgeModel holds the string denoting the model edge name in mutations.
EdgeModel = "model"
// Table holds the table name of the modelpricing in the database.
Table = "model_pricings"
// ModelTable is the table that holds the model relation/edge.
ModelTable = "model_pricings"
// ModelInverseTable is the table name for the Model entity.
// It exists in this package in order to avoid circular dependency with the "model" package.
ModelInverseTable = "models"
// ModelColumn is the table column denoting the model relation/edge.
ModelColumn = "model_id"
)
// Columns holds all SQL columns for modelpricing fields.
var Columns = []string{
FieldID,
FieldModelID,
FieldAccessLevel,
FieldIsFree,
FieldInputPrice,
FieldOutputPrice,
FieldCreatedAt,
FieldUpdatedAt,
}
// 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 (
// AccessLevelValidator is a validator for the "access_level" field. It is called by the builders before save.
AccessLevelValidator func(string) error
// DefaultIsFree holds the default value on creation for the "is_free" field.
DefaultIsFree bool
// DefaultInputPrice holds the default value on creation for the "input_price" field.
DefaultInputPrice int64
// DefaultOutputPrice holds the default value on creation for the "output_price" field.
DefaultOutputPrice int64
// 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
)
// OrderOption defines the ordering options for the ModelPricing 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()
}
// ByModelID orders the results by the model_id field.
func ByModelID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldModelID, opts...).ToFunc()
}
// ByAccessLevel orders the results by the access_level field.
func ByAccessLevel(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAccessLevel, opts...).ToFunc()
}
// ByIsFree orders the results by the is_free field.
func ByIsFree(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIsFree, opts...).ToFunc()
}
// ByInputPrice orders the results by the input_price field.
func ByInputPrice(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldInputPrice, opts...).ToFunc()
}
// ByOutputPrice orders the results by the output_price field.
func ByOutputPrice(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOutputPrice, 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()
}
// ByModelField orders the results by model field.
func ByModelField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newModelStep(), sql.OrderByField(field, opts...))
}
}
func newModelStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(ModelInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2O, true, ModelTable, ModelColumn),
)
}