代码拉取完成,页面将自动刷新
// Code generated by ent, DO NOT EDIT.
package member
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
uuid "github.com/gofrs/uuid/v5"
)
const (
// Label holds the string label denoting the member type in the database.
Label = "member"
// 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"
// FieldSort holds the string denoting the sort field in the database.
FieldSort = "sort"
// FieldCompanyID holds the string denoting the companyid field in the database.
FieldCompanyID = "company_id"
// FieldType holds the string denoting the type field in the database.
FieldType = "type"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldMobile holds the string denoting the mobile field in the database.
FieldMobile = "mobile"
// FieldAvatar holds the string denoting the avatar field in the database.
FieldAvatar = "avatar"
// FieldAccount holds the string denoting the account field in the database.
FieldAccount = "account"
// FieldPassword holds the string denoting the password field in the database.
FieldPassword = "password"
// FieldCountryCode holds the string denoting the countrycode field in the database.
FieldCountryCode = "country_code"
// EdgeDevices holds the string denoting the devices edge name in mutations.
EdgeDevices = "devices"
// EdgeCompanies holds the string denoting the companies edge name in mutations.
EdgeCompanies = "companies"
// Table holds the table name of the member in the database.
Table = "client_members"
// DevicesTable is the table that holds the devices relation/edge. The primary key declared below.
DevicesTable = "member_devices"
// DevicesInverseTable is the table name for the Device entity.
// It exists in this package in order to avoid circular dependency with the "device" package.
DevicesInverseTable = "equip_devices"
// CompaniesTable is the table that holds the companies relation/edge.
CompaniesTable = "client_members"
// CompaniesInverseTable is the table name for the Company entity.
// It exists in this package in order to avoid circular dependency with the "company" package.
CompaniesInverseTable = "client_companies"
// CompaniesColumn is the table column denoting the companies relation/edge.
CompaniesColumn = "company_members"
)
// Columns holds all SQL columns for member fields.
var Columns = []string{
FieldID,
FieldCreatedAt,
FieldUpdatedAt,
FieldStatus,
FieldSort,
FieldCompanyID,
FieldType,
FieldName,
FieldMobile,
FieldAvatar,
FieldAccount,
FieldPassword,
FieldCountryCode,
}
// ForeignKeys holds the SQL foreign-keys that are owned by the "client_members"
// table and are not defined as standalone fields in the schema.
var ForeignKeys = []string{
"company_members",
}
var (
// DevicesPrimaryKey and DevicesColumn2 are the table columns denoting the
// primary key for the devices relation (M2M).
DevicesPrimaryKey = []string{"member_id", "device_id"}
)
// 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 (
// 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
// DefaultSort holds the default value on creation for the "sort" field.
DefaultSort uint32
// DefaultType holds the default value on creation for the "type" field.
DefaultType int32
// DefaultCountryCode holds the default value on creation for the "countryCode" field.
DefaultCountryCode string
// DefaultID holds the default value on creation for the "id" field.
DefaultID func() uuid.UUID
)
// OrderOption defines the ordering options for the Member 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()
}
// BySort orders the results by the sort field.
func BySort(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSort, opts...).ToFunc()
}
// ByCompanyID orders the results by the companyID field.
func ByCompanyID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCompanyID, opts...).ToFunc()
}
// ByType orders the results by the type field.
func ByType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldType, opts...).ToFunc()
}
// ByName orders the results by the name field.
func ByName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldName, opts...).ToFunc()
}
// ByMobile orders the results by the mobile field.
func ByMobile(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMobile, opts...).ToFunc()
}
// ByAvatar orders the results by the avatar field.
func ByAvatar(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAvatar, opts...).ToFunc()
}
// ByAccount orders the results by the account field.
func ByAccount(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAccount, opts...).ToFunc()
}
// ByPassword orders the results by the password field.
func ByPassword(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPassword, opts...).ToFunc()
}
// ByCountryCode orders the results by the countryCode field.
func ByCountryCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCountryCode, opts...).ToFunc()
}
// ByDevicesCount orders the results by devices count.
func ByDevicesCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newDevicesStep(), opts...)
}
}
// ByDevices orders the results by devices terms.
func ByDevices(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newDevicesStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByCompaniesField orders the results by companies field.
func ByCompaniesField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newCompaniesStep(), sql.OrderByField(field, opts...))
}
}
func newDevicesStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(DevicesInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2M, false, DevicesTable, DevicesPrimaryKey...),
)
}
func newCompaniesStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(CompaniesInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, CompaniesTable, CompaniesColumn),
)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。