🎉 init
This commit is contained in:
237
common/ent/scaauthuserdevice/scaauthuserdevice.go
Normal file
237
common/ent/scaauthuserdevice/scaauthuserdevice.go
Normal file
@@ -0,0 +1,237 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package scaauthuserdevice
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the scaauthuserdevice type in the database.
|
||||
Label = "sca_auth_user_device"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldUserID holds the string denoting the user_id field in the database.
|
||||
FieldUserID = "user_id"
|
||||
// FieldIP holds the string denoting the ip field in the database.
|
||||
FieldIP = "ip"
|
||||
// FieldLocation holds the string denoting the location field in the database.
|
||||
FieldLocation = "location"
|
||||
// FieldAgent holds the string denoting the agent field in the database.
|
||||
FieldAgent = "agent"
|
||||
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
||||
FieldCreatedAt = "created_at"
|
||||
// FieldUpdateAt holds the string denoting the update_at field in the database.
|
||||
FieldUpdateAt = "update_at"
|
||||
// FieldDeleted holds the string denoting the deleted field in the database.
|
||||
FieldDeleted = "deleted"
|
||||
// FieldBrowser holds the string denoting the browser field in the database.
|
||||
FieldBrowser = "browser"
|
||||
// FieldOperatingSystem holds the string denoting the operating_system field in the database.
|
||||
FieldOperatingSystem = "operating_system"
|
||||
// FieldBrowserVersion holds the string denoting the browser_version field in the database.
|
||||
FieldBrowserVersion = "browser_version"
|
||||
// FieldMobile holds the string denoting the mobile field in the database.
|
||||
FieldMobile = "mobile"
|
||||
// FieldBot holds the string denoting the bot field in the database.
|
||||
FieldBot = "bot"
|
||||
// FieldMozilla holds the string denoting the mozilla field in the database.
|
||||
FieldMozilla = "mozilla"
|
||||
// FieldPlatform holds the string denoting the platform field in the database.
|
||||
FieldPlatform = "platform"
|
||||
// FieldEngineName holds the string denoting the engine_name field in the database.
|
||||
FieldEngineName = "engine_name"
|
||||
// FieldEngineVersion holds the string denoting the engine_version field in the database.
|
||||
FieldEngineVersion = "engine_version"
|
||||
// EdgeScaAuthUser holds the string denoting the sca_auth_user edge name in mutations.
|
||||
EdgeScaAuthUser = "sca_auth_user"
|
||||
// Table holds the table name of the scaauthuserdevice in the database.
|
||||
Table = "sca_auth_user_devices"
|
||||
// ScaAuthUserTable is the table that holds the sca_auth_user relation/edge.
|
||||
ScaAuthUserTable = "sca_auth_user_devices"
|
||||
// ScaAuthUserInverseTable is the table name for the ScaAuthUser entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "scaauthuser" package.
|
||||
ScaAuthUserInverseTable = "sca_auth_users"
|
||||
// ScaAuthUserColumn is the table column denoting the sca_auth_user relation/edge.
|
||||
ScaAuthUserColumn = "sca_auth_user_sca_auth_user_device"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for scaauthuserdevice fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldUserID,
|
||||
FieldIP,
|
||||
FieldLocation,
|
||||
FieldAgent,
|
||||
FieldCreatedAt,
|
||||
FieldUpdateAt,
|
||||
FieldDeleted,
|
||||
FieldBrowser,
|
||||
FieldOperatingSystem,
|
||||
FieldBrowserVersion,
|
||||
FieldMobile,
|
||||
FieldBot,
|
||||
FieldMozilla,
|
||||
FieldPlatform,
|
||||
FieldEngineName,
|
||||
FieldEngineVersion,
|
||||
}
|
||||
|
||||
// ForeignKeys holds the SQL foreign-keys that are owned by the "sca_auth_user_devices"
|
||||
// table and are not defined as standalone fields in the schema.
|
||||
var ForeignKeys = []string{
|
||||
"sca_auth_user_sca_auth_user_device",
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
}
|
||||
for i := range ForeignKeys {
|
||||
if column == ForeignKeys[i] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var (
|
||||
// UserIDValidator is a validator for the "user_id" field. It is called by the builders before save.
|
||||
UserIDValidator func(string) error
|
||||
// IPValidator is a validator for the "ip" field. It is called by the builders before save.
|
||||
IPValidator func(string) error
|
||||
// LocationValidator is a validator for the "location" field. It is called by the builders before save.
|
||||
LocationValidator func(string) error
|
||||
// AgentValidator is a validator for the "agent" field. It is called by the builders before save.
|
||||
AgentValidator func(string) error
|
||||
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
||||
DefaultCreatedAt func() time.Time
|
||||
// DefaultUpdateAt holds the default value on creation for the "update_at" field.
|
||||
DefaultUpdateAt func() time.Time
|
||||
// UpdateDefaultUpdateAt holds the default value on update for the "update_at" field.
|
||||
UpdateDefaultUpdateAt func() time.Time
|
||||
// DefaultDeleted holds the default value on creation for the "deleted" field.
|
||||
DefaultDeleted int
|
||||
// BrowserValidator is a validator for the "browser" field. It is called by the builders before save.
|
||||
BrowserValidator func(string) error
|
||||
// OperatingSystemValidator is a validator for the "operating_system" field. It is called by the builders before save.
|
||||
OperatingSystemValidator func(string) error
|
||||
// BrowserVersionValidator is a validator for the "browser_version" field. It is called by the builders before save.
|
||||
BrowserVersionValidator func(string) error
|
||||
// MozillaValidator is a validator for the "mozilla" field. It is called by the builders before save.
|
||||
MozillaValidator func(string) error
|
||||
// PlatformValidator is a validator for the "platform" field. It is called by the builders before save.
|
||||
PlatformValidator func(string) error
|
||||
// EngineNameValidator is a validator for the "engine_name" field. It is called by the builders before save.
|
||||
EngineNameValidator func(string) error
|
||||
// EngineVersionValidator is a validator for the "engine_version" field. It is called by the builders before save.
|
||||
EngineVersionValidator func(string) error
|
||||
)
|
||||
|
||||
// OrderOption defines the ordering options for the ScaAuthUserDevice 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()
|
||||
}
|
||||
|
||||
// ByUserID orders the results by the user_id field.
|
||||
func ByUserID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldUserID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByIP orders the results by the ip field.
|
||||
func ByIP(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldIP, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByLocation orders the results by the location field.
|
||||
func ByLocation(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldLocation, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByAgent orders the results by the agent field.
|
||||
func ByAgent(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldAgent, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCreatedAt orders the results by the created_at field.
|
||||
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByUpdateAt orders the results by the update_at field.
|
||||
func ByUpdateAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldUpdateAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByDeleted orders the results by the deleted field.
|
||||
func ByDeleted(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldDeleted, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByBrowser orders the results by the browser field.
|
||||
func ByBrowser(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldBrowser, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByOperatingSystem orders the results by the operating_system field.
|
||||
func ByOperatingSystem(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldOperatingSystem, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByBrowserVersion orders the results by the browser_version field.
|
||||
func ByBrowserVersion(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldBrowserVersion, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByMobile orders the results by the mobile field.
|
||||
func ByMobile(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldMobile, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByBot orders the results by the bot field.
|
||||
func ByBot(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldBot, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByMozilla orders the results by the mozilla field.
|
||||
func ByMozilla(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldMozilla, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByPlatform orders the results by the platform field.
|
||||
func ByPlatform(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldPlatform, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByEngineName orders the results by the engine_name field.
|
||||
func ByEngineName(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldEngineName, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByEngineVersion orders the results by the engine_version field.
|
||||
func ByEngineVersion(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldEngineVersion, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByScaAuthUserField orders the results by sca_auth_user field.
|
||||
func ByScaAuthUserField(field string, opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newScaAuthUserStep(), sql.OrderByField(field, opts...))
|
||||
}
|
||||
}
|
||||
func newScaAuthUserStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(ScaAuthUserInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, ScaAuthUserTable, ScaAuthUserColumn),
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user