195 lines
7.5 KiB
Go
195 lines
7.5 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package shops
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the shops type in the database.
|
|
Label = "shops"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldOwnerID holds the string denoting the owner_id field in the database.
|
|
FieldOwnerID = "owner_id"
|
|
// FieldName holds the string denoting the name field in the database.
|
|
FieldName = "name"
|
|
// FieldBanner holds the string denoting the banner field in the database.
|
|
FieldBanner = "banner"
|
|
// FieldDescription holds the string denoting the description field in the database.
|
|
FieldDescription = "description"
|
|
// FieldRating holds the string denoting the rating field in the database.
|
|
FieldRating = "rating"
|
|
// FieldTotalOrders holds the string denoting the total_orders field in the database.
|
|
FieldTotalOrders = "total_orders"
|
|
// FieldPlayerCount holds the string denoting the player_count field in the database.
|
|
FieldPlayerCount = "player_count"
|
|
// FieldCommissionType holds the string denoting the commission_type field in the database.
|
|
FieldCommissionType = "commission_type"
|
|
// FieldCommissionValue holds the string denoting the commission_value field in the database.
|
|
FieldCommissionValue = "commission_value"
|
|
// FieldAllowMultiShop holds the string denoting the allow_multi_shop field in the database.
|
|
FieldAllowMultiShop = "allow_multi_shop"
|
|
// FieldAllowIndependentOrders holds the string denoting the allow_independent_orders field in the database.
|
|
FieldAllowIndependentOrders = "allow_independent_orders"
|
|
// FieldDispatchMode holds the string denoting the dispatch_mode field in the database.
|
|
FieldDispatchMode = "dispatch_mode"
|
|
// FieldAnnouncements holds the string denoting the announcements field in the database.
|
|
FieldAnnouncements = "announcements"
|
|
// FieldTemplateConfig holds the string denoting the template_config field in the database.
|
|
FieldTemplateConfig = "template_config"
|
|
// 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"
|
|
// Table holds the table name of the shops in the database.
|
|
Table = "shops"
|
|
)
|
|
|
|
// Columns holds all SQL columns for shops fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldOwnerID,
|
|
FieldName,
|
|
FieldBanner,
|
|
FieldDescription,
|
|
FieldRating,
|
|
FieldTotalOrders,
|
|
FieldPlayerCount,
|
|
FieldCommissionType,
|
|
FieldCommissionValue,
|
|
FieldAllowMultiShop,
|
|
FieldAllowIndependentOrders,
|
|
FieldDispatchMode,
|
|
FieldAnnouncements,
|
|
FieldTemplateConfig,
|
|
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 (
|
|
// NameValidator is a validator for the "name" field. It is called by the builders before save.
|
|
NameValidator func(string) error
|
|
// DefaultRating holds the default value on creation for the "rating" field.
|
|
DefaultRating decimal.Decimal
|
|
// DefaultTotalOrders holds the default value on creation for the "total_orders" field.
|
|
DefaultTotalOrders int
|
|
// DefaultPlayerCount holds the default value on creation for the "player_count" field.
|
|
DefaultPlayerCount int
|
|
// DefaultCommissionType holds the default value on creation for the "commission_type" field.
|
|
DefaultCommissionType string
|
|
// CommissionTypeValidator is a validator for the "commission_type" field. It is called by the builders before save.
|
|
CommissionTypeValidator func(string) error
|
|
// DefaultAllowMultiShop holds the default value on creation for the "allow_multi_shop" field.
|
|
DefaultAllowMultiShop bool
|
|
// DefaultAllowIndependentOrders holds the default value on creation for the "allow_independent_orders" field.
|
|
DefaultAllowIndependentOrders bool
|
|
// DefaultDispatchMode holds the default value on creation for the "dispatch_mode" field.
|
|
DefaultDispatchMode string
|
|
// DispatchModeValidator is a validator for the "dispatch_mode" field. It is called by the builders before save.
|
|
DispatchModeValidator func(string) error
|
|
// 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 Shops 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()
|
|
}
|
|
|
|
// ByOwnerID orders the results by the owner_id field.
|
|
func ByOwnerID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldOwnerID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByName orders the results by the name field.
|
|
func ByName(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldName, opts...).ToFunc()
|
|
}
|
|
|
|
// ByBanner orders the results by the banner field.
|
|
func ByBanner(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldBanner, opts...).ToFunc()
|
|
}
|
|
|
|
// ByDescription orders the results by the description field.
|
|
func ByDescription(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldDescription, opts...).ToFunc()
|
|
}
|
|
|
|
// ByRating orders the results by the rating field.
|
|
func ByRating(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldRating, opts...).ToFunc()
|
|
}
|
|
|
|
// ByTotalOrders orders the results by the total_orders field.
|
|
func ByTotalOrders(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldTotalOrders, opts...).ToFunc()
|
|
}
|
|
|
|
// ByPlayerCount orders the results by the player_count field.
|
|
func ByPlayerCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldPlayerCount, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCommissionType orders the results by the commission_type field.
|
|
func ByCommissionType(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCommissionType, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCommissionValue orders the results by the commission_value field.
|
|
func ByCommissionValue(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCommissionValue, opts...).ToFunc()
|
|
}
|
|
|
|
// ByAllowMultiShop orders the results by the allow_multi_shop field.
|
|
func ByAllowMultiShop(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldAllowMultiShop, opts...).ToFunc()
|
|
}
|
|
|
|
// ByAllowIndependentOrders orders the results by the allow_independent_orders field.
|
|
func ByAllowIndependentOrders(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldAllowIndependentOrders, opts...).ToFunc()
|
|
}
|
|
|
|
// ByDispatchMode orders the results by the dispatch_mode field.
|
|
func ByDispatchMode(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldDispatchMode, opts...).ToFunc()
|
|
}
|
|
|
|
// ByAnnouncements orders the results by the announcements field.
|
|
func ByAnnouncements(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldAnnouncements, 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()
|
|
}
|