feat(schema): 添加基础混入定义公共时间字段
This commit is contained in:
1 parent
5281459fcb
commit
fe86c081f4
16 files changed
+1715
-14
No files matched your search
@@ -3,6 +3,8 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
@@ -11,6 +13,20 @@ const (
|
||||
Label = "user"
|
||||
// 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"
|
||||
// FieldUsername holds the string denoting the username field in the database.
|
||||
FieldUsername = "username"
|
||||
// FieldPassword holds the string denoting the password field in the database.
|
||||
FieldPassword = "password"
|
||||
// FieldEmail holds the string denoting the email field in the database.
|
||||
FieldEmail = "email"
|
||||
// FieldIP holds the string denoting the ip field in the database.
|
||||
FieldIP = "ip"
|
||||
// FieldAddr holds the string denoting the addr field in the database.
|
||||
FieldAddr = "addr"
|
||||
// Table holds the table name of the user in the database.
|
||||
Table = "users"
|
||||
)
|
||||
@@ -18,6 +34,13 @@ const (
|
||||
// Columns holds all SQL columns for user fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldCreatedAt,
|
||||
FieldUpdatedAt,
|
||||
FieldUsername,
|
||||
FieldPassword,
|
||||
FieldEmail,
|
||||
FieldIP,
|
||||
FieldAddr,
|
||||
}
|
||||
|
||||
// ValidColumn reports if the column name is valid (part of the table columns).
|
||||
@@ -30,6 +53,23 @@ func ValidColumn(column string) bool {
|
||||
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
|
||||
// UsernameValidator is a validator for the "username" field. It is called by the builders before save.
|
||||
UsernameValidator func(string) error
|
||||
// EmailValidator is a validator for the "email" field. It is called by the builders before save.
|
||||
EmailValidator func(string) error
|
||||
// IPValidator is a validator for the "ip" field. It is called by the builders before save.
|
||||
IPValidator func(string) error
|
||||
// AddrValidator is a validator for the "addr" field. It is called by the builders before save.
|
||||
AddrValidator func(string) error
|
||||
)
|
||||
|
||||
// OrderOption defines the ordering options for the User queries.
|
||||
type OrderOption func(*sql.Selector)
|
||||
|
||||
@@ -37,3 +77,38 @@ type OrderOption func(*sql.Selector)
|
||||
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()
|
||||
}
|
||||
|
||||
// ByUsername orders the results by the username field.
|
||||
func ByUsername(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldUsername, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByPassword orders the results by the password field.
|
||||
func ByPassword(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldPassword, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByEmail orders the results by the email field.
|
||||
func ByEmail(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldEmail, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByIP orders the results by the ip field.
|
||||
func ByIP(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldIP, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByAddr orders the results by the addr field.
|
||||
func ByAddr(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldAddr, opts...).ToFunc()
|
||||
}
|
||||
@@ -4,6 +4,7 @@ package user
|
||||
|
||||
import (
|
||||
"EnGin/internal/ent/predicate"
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
@@ -53,6 +54,476 @@ func IDLTE(id int) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
|
||||
func CreatedAt(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
|
||||
func UpdatedAt(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// Username applies equality check predicate on the "username" field. It's identical to UsernameEQ.
|
||||
func Username(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldUsername, v))
|
||||
}
|
||||
|
||||
// Password applies equality check predicate on the "password" field. It's identical to PasswordEQ.
|
||||
func Password(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldPassword, v))
|
||||
}
|
||||
|
||||
// Email applies equality check predicate on the "email" field. It's identical to EmailEQ.
|
||||
func Email(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldEmail, v))
|
||||
}
|
||||
|
||||
// IP applies equality check predicate on the "ip" field. It's identical to IPEQ.
|
||||
func IP(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldIP, v))
|
||||
}
|
||||
|
||||
// Addr applies equality check predicate on the "addr" field. It's identical to AddrEQ.
|
||||
func Addr(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldAddr, v))
|
||||
}
|
||||
|
||||
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
|
||||
func CreatedAtEQ(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
|
||||
func CreatedAtNEQ(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtIn applies the In predicate on the "created_at" field.
|
||||
func CreatedAtIn(vs ...time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
|
||||
func CreatedAtNotIn(vs ...time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldCreatedAt, vs...))
|
||||
}
|
||||
|
||||
// CreatedAtGT applies the GT predicate on the "created_at" field.
|
||||
func CreatedAtGT(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
|
||||
func CreatedAtGTE(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLT applies the LT predicate on the "created_at" field.
|
||||
func CreatedAtLT(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
|
||||
func CreatedAtLTE(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldCreatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
|
||||
func UpdatedAtEQ(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
|
||||
func UpdatedAtNEQ(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtIn applies the In predicate on the "updated_at" field.
|
||||
func UpdatedAtIn(vs ...time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldUpdatedAt, vs...))
|
||||
}
|
||||
|
||||
// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
|
||||
func UpdatedAtNotIn(vs ...time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldUpdatedAt, vs...))
|
||||
}
|
||||
|
||||
// UpdatedAtGT applies the GT predicate on the "updated_at" field.
|
||||
func UpdatedAtGT(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
|
||||
func UpdatedAtGTE(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtLT applies the LT predicate on the "updated_at" field.
|
||||
func UpdatedAtLT(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
|
||||
func UpdatedAtLTE(v time.Time) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldUpdatedAt, v))
|
||||
}
|
||||
|
||||
// UsernameEQ applies the EQ predicate on the "username" field.
|
||||
func UsernameEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameNEQ applies the NEQ predicate on the "username" field.
|
||||
func UsernameNEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameIn applies the In predicate on the "username" field.
|
||||
func UsernameIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldUsername, vs...))
|
||||
}
|
||||
|
||||
// UsernameNotIn applies the NotIn predicate on the "username" field.
|
||||
func UsernameNotIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldUsername, vs...))
|
||||
}
|
||||
|
||||
// UsernameGT applies the GT predicate on the "username" field.
|
||||
func UsernameGT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameGTE applies the GTE predicate on the "username" field.
|
||||
func UsernameGTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameLT applies the LT predicate on the "username" field.
|
||||
func UsernameLT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameLTE applies the LTE predicate on the "username" field.
|
||||
func UsernameLTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameContains applies the Contains predicate on the "username" field.
|
||||
func UsernameContains(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContains(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameHasPrefix applies the HasPrefix predicate on the "username" field.
|
||||
func UsernameHasPrefix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasPrefix(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameHasSuffix applies the HasSuffix predicate on the "username" field.
|
||||
func UsernameHasSuffix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasSuffix(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameEqualFold applies the EqualFold predicate on the "username" field.
|
||||
func UsernameEqualFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEqualFold(FieldUsername, v))
|
||||
}
|
||||
|
||||
// UsernameContainsFold applies the ContainsFold predicate on the "username" field.
|
||||
func UsernameContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldUsername, v))
|
||||
}
|
||||
|
||||
// PasswordEQ applies the EQ predicate on the "password" field.
|
||||
func PasswordEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordNEQ applies the NEQ predicate on the "password" field.
|
||||
func PasswordNEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordIn applies the In predicate on the "password" field.
|
||||
func PasswordIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldPassword, vs...))
|
||||
}
|
||||
|
||||
// PasswordNotIn applies the NotIn predicate on the "password" field.
|
||||
func PasswordNotIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldPassword, vs...))
|
||||
}
|
||||
|
||||
// PasswordGT applies the GT predicate on the "password" field.
|
||||
func PasswordGT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordGTE applies the GTE predicate on the "password" field.
|
||||
func PasswordGTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordLT applies the LT predicate on the "password" field.
|
||||
func PasswordLT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordLTE applies the LTE predicate on the "password" field.
|
||||
func PasswordLTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordContains applies the Contains predicate on the "password" field.
|
||||
func PasswordContains(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContains(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordHasPrefix applies the HasPrefix predicate on the "password" field.
|
||||
func PasswordHasPrefix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasPrefix(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordHasSuffix applies the HasSuffix predicate on the "password" field.
|
||||
func PasswordHasSuffix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasSuffix(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordEqualFold applies the EqualFold predicate on the "password" field.
|
||||
func PasswordEqualFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEqualFold(FieldPassword, v))
|
||||
}
|
||||
|
||||
// PasswordContainsFold applies the ContainsFold predicate on the "password" field.
|
||||
func PasswordContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldPassword, v))
|
||||
}
|
||||
|
||||
// EmailEQ applies the EQ predicate on the "email" field.
|
||||
func EmailEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldEmail, v))
|
||||
}
|
||||
|
||||
// EmailNEQ applies the NEQ predicate on the "email" field.
|
||||
func EmailNEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldEmail, v))
|
||||
}
|
||||
|
||||
// EmailIn applies the In predicate on the "email" field.
|
||||
func EmailIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldEmail, vs...))
|
||||
}
|
||||
|
||||
// EmailNotIn applies the NotIn predicate on the "email" field.
|
||||
func EmailNotIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldEmail, vs...))
|
||||
}
|
||||
|
||||
// EmailGT applies the GT predicate on the "email" field.
|
||||
func EmailGT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldEmail, v))
|
||||
}
|
||||
|
||||
// EmailGTE applies the GTE predicate on the "email" field.
|
||||
func EmailGTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldEmail, v))
|
||||
}
|
||||
|
||||
// EmailLT applies the LT predicate on the "email" field.
|
||||
func EmailLT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldEmail, v))
|
||||
}
|
||||
|
||||
// EmailLTE applies the LTE predicate on the "email" field.
|
||||
func EmailLTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldEmail, v))
|
||||
}
|
||||
|
||||
// EmailContains applies the Contains predicate on the "email" field.
|
||||
func EmailContains(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContains(FieldEmail, v))
|
||||
}
|
||||
|
||||
// EmailHasPrefix applies the HasPrefix predicate on the "email" field.
|
||||
func EmailHasPrefix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasPrefix(FieldEmail, v))
|
||||
}
|
||||
|
||||
// EmailHasSuffix applies the HasSuffix predicate on the "email" field.
|
||||
func EmailHasSuffix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasSuffix(FieldEmail, v))
|
||||
}
|
||||
|
||||
// EmailIsNil applies the IsNil predicate on the "email" field.
|
||||
func EmailIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldEmail))
|
||||
}
|
||||
|
||||
// EmailNotNil applies the NotNil predicate on the "email" field.
|
||||
func EmailNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldEmail))
|
||||
}
|
||||
|
||||
// EmailEqualFold applies the EqualFold predicate on the "email" field.
|
||||
func EmailEqualFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEqualFold(FieldEmail, v))
|
||||
}
|
||||
|
||||
// EmailContainsFold applies the ContainsFold predicate on the "email" field.
|
||||
func EmailContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldEmail, v))
|
||||
}
|
||||
|
||||
// IPEQ applies the EQ predicate on the "ip" field.
|
||||
func IPEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldIP, v))
|
||||
}
|
||||
|
||||
// IPNEQ applies the NEQ predicate on the "ip" field.
|
||||
func IPNEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldIP, v))
|
||||
}
|
||||
|
||||
// IPIn applies the In predicate on the "ip" field.
|
||||
func IPIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldIP, vs...))
|
||||
}
|
||||
|
||||
// IPNotIn applies the NotIn predicate on the "ip" field.
|
||||
func IPNotIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldIP, vs...))
|
||||
}
|
||||
|
||||
// IPGT applies the GT predicate on the "ip" field.
|
||||
func IPGT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldIP, v))
|
||||
}
|
||||
|
||||
// IPGTE applies the GTE predicate on the "ip" field.
|
||||
func IPGTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldIP, v))
|
||||
}
|
||||
|
||||
// IPLT applies the LT predicate on the "ip" field.
|
||||
func IPLT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldIP, v))
|
||||
}
|
||||
|
||||
// IPLTE applies the LTE predicate on the "ip" field.
|
||||
func IPLTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldIP, v))
|
||||
}
|
||||
|
||||
// IPContains applies the Contains predicate on the "ip" field.
|
||||
func IPContains(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContains(FieldIP, v))
|
||||
}
|
||||
|
||||
// IPHasPrefix applies the HasPrefix predicate on the "ip" field.
|
||||
func IPHasPrefix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasPrefix(FieldIP, v))
|
||||
}
|
||||
|
||||
// IPHasSuffix applies the HasSuffix predicate on the "ip" field.
|
||||
func IPHasSuffix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasSuffix(FieldIP, v))
|
||||
}
|
||||
|
||||
// IPIsNil applies the IsNil predicate on the "ip" field.
|
||||
func IPIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldIP))
|
||||
}
|
||||
|
||||
// IPNotNil applies the NotNil predicate on the "ip" field.
|
||||
func IPNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldIP))
|
||||
}
|
||||
|
||||
// IPEqualFold applies the EqualFold predicate on the "ip" field.
|
||||
func IPEqualFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEqualFold(FieldIP, v))
|
||||
}
|
||||
|
||||
// IPContainsFold applies the ContainsFold predicate on the "ip" field.
|
||||
func IPContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldIP, v))
|
||||
}
|
||||
|
||||
// AddrEQ applies the EQ predicate on the "addr" field.
|
||||
func AddrEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldAddr, v))
|
||||
}
|
||||
|
||||
// AddrNEQ applies the NEQ predicate on the "addr" field.
|
||||
func AddrNEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldAddr, v))
|
||||
}
|
||||
|
||||
// AddrIn applies the In predicate on the "addr" field.
|
||||
func AddrIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldAddr, vs...))
|
||||
}
|
||||
|
||||
// AddrNotIn applies the NotIn predicate on the "addr" field.
|
||||
func AddrNotIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldAddr, vs...))
|
||||
}
|
||||
|
||||
// AddrGT applies the GT predicate on the "addr" field.
|
||||
func AddrGT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldAddr, v))
|
||||
}
|
||||
|
||||
// AddrGTE applies the GTE predicate on the "addr" field.
|
||||
func AddrGTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldAddr, v))
|
||||
}
|
||||
|
||||
// AddrLT applies the LT predicate on the "addr" field.
|
||||
func AddrLT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldAddr, v))
|
||||
}
|
||||
|
||||
// AddrLTE applies the LTE predicate on the "addr" field.
|
||||
func AddrLTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldAddr, v))
|
||||
}
|
||||
|
||||
// AddrContains applies the Contains predicate on the "addr" field.
|
||||
func AddrContains(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContains(FieldAddr, v))
|
||||
}
|
||||
|
||||
// AddrHasPrefix applies the HasPrefix predicate on the "addr" field.
|
||||
func AddrHasPrefix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasPrefix(FieldAddr, v))
|
||||
}
|
||||
|
||||
// AddrHasSuffix applies the HasSuffix predicate on the "addr" field.
|
||||
func AddrHasSuffix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasSuffix(FieldAddr, v))
|
||||
}
|
||||
|
||||
// AddrIsNil applies the IsNil predicate on the "addr" field.
|
||||
func AddrIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldAddr))
|
||||
}
|
||||
|
||||
// AddrNotNil applies the NotNil predicate on the "addr" field.
|
||||
func AddrNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldAddr))
|
||||
}
|
||||
|
||||
// AddrEqualFold applies the EqualFold predicate on the "addr" field.
|
||||
func AddrEqualFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEqualFold(FieldAddr, v))
|
||||
}
|
||||
|
||||
// AddrContainsFold applies the ContainsFold predicate on the "addr" field.
|
||||
func AddrContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldAddr, v))
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.User) predicate.User {
|
||||
return predicate.User(sql.AndPredicates(predicates...))
|
||||
|
||||
Reference in new issue
Block a user