Files
juwan-backend/app/users/rpc/internal/models/users/users.go
T
2026-03-31 22:12:06 +08:00

168 lines
5.8 KiB
Go

// Code generated by ent, DO NOT EDIT.
package users
import (
"time"
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the users type in the database.
Label = "users"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldUsername holds the string denoting the username field in the database.
FieldUsername = "username"
// FieldPasswordHash holds the string denoting the password_hash field in the database.
FieldPasswordHash = "password_hash"
// FieldEmail holds the string denoting the email field in the database.
FieldEmail = "email"
// FieldPhone holds the string denoting the phone field in the database.
FieldPhone = "phone"
// FieldNickname holds the string denoting the nickname field in the database.
FieldNickname = "nickname"
// FieldAvatar holds the string denoting the avatar field in the database.
FieldAvatar = "avatar"
// FieldBio holds the string denoting the bio field in the database.
FieldBio = "bio"
// FieldCurrentRole holds the string denoting the current_role field in the database.
FieldCurrentRole = "current_role"
// FieldVerificationStatus holds the string denoting the verificationstatus field in the database.
FieldVerificationStatus = "verification_status"
// FieldIsAdmin holds the string denoting the is_admin field in the database.
FieldIsAdmin = "is_admin"
// 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"
// FieldDeletedAt holds the string denoting the deleted_at field in the database.
FieldDeletedAt = "deleted_at"
// FieldVerifiedRoles holds the string denoting the verified_roles field in the database.
FieldVerifiedRoles = "verified_roles"
// Table holds the table name of the users in the database.
Table = "users"
)
// Columns holds all SQL columns for users fields.
var Columns = []string{
FieldID,
FieldUsername,
FieldPasswordHash,
FieldEmail,
FieldPhone,
FieldNickname,
FieldAvatar,
FieldBio,
FieldCurrentRole,
FieldVerificationStatus,
FieldIsAdmin,
FieldCreatedAt,
FieldUpdatedAt,
FieldDeletedAt,
FieldVerifiedRoles,
}
// 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 (
// DefaultNickname holds the default value on creation for the "nickname" field.
DefaultNickname string
// DefaultAvatar holds the default value on creation for the "avatar" field.
DefaultAvatar string
// DefaultBio holds the default value on creation for the "bio" field.
DefaultBio string
// DefaultCurrentRole holds the default value on creation for the "current_role" field.
DefaultCurrentRole string
// CurrentRoleValidator is a validator for the "current_role" field. It is called by the builders before save.
CurrentRoleValidator func(string) error
// DefaultIsAdmin holds the default value on creation for the "is_admin" field.
DefaultIsAdmin bool
// 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
)
// OrderOption defines the ordering options for the Users 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()
}
// ByUsername orders the results by the username field.
func ByUsername(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUsername, opts...).ToFunc()
}
// ByPasswordHash orders the results by the password_hash field.
func ByPasswordHash(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPasswordHash, opts...).ToFunc()
}
// ByEmail orders the results by the email field.
func ByEmail(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEmail, opts...).ToFunc()
}
// ByPhone orders the results by the phone field.
func ByPhone(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPhone, opts...).ToFunc()
}
// ByNickname orders the results by the nickname field.
func ByNickname(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldNickname, opts...).ToFunc()
}
// ByAvatar orders the results by the avatar field.
func ByAvatar(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAvatar, opts...).ToFunc()
}
// ByBio orders the results by the bio field.
func ByBio(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldBio, opts...).ToFunc()
}
// ByCurrentRole orders the results by the current_role field.
func ByCurrentRole(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCurrentRole, opts...).ToFunc()
}
// ByIsAdmin orders the results by the is_admin field.
func ByIsAdmin(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIsAdmin, 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()
}
// ByDeletedAt orders the results by the deleted_at field.
func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
}
// ByVerifiedRoles orders the results by the verified_roles field.
func ByVerifiedRoles(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldVerifiedRoles, opts...).ToFunc()
}