feat(user): 添加昵称字段
This commit is contained in:
1 parent
b24e1e41d7
commit
85265abb48
10 files changed
+292
-5
No files matched your search
@@ -22,6 +22,8 @@ const (
|
||||
FieldUsername = "username"
|
||||
// FieldPassword holds the string denoting the password field in the database.
|
||||
FieldPassword = "password"
|
||||
// FieldNickname holds the string denoting the nickname field in the database.
|
||||
FieldNickname = "nickname"
|
||||
// FieldEmail holds the string denoting the email field in the database.
|
||||
FieldEmail = "email"
|
||||
// FieldIP holds the string denoting the ip field in the database.
|
||||
@@ -46,6 +48,7 @@ var Columns = []string{
|
||||
FieldUpdatedAt,
|
||||
FieldUsername,
|
||||
FieldPassword,
|
||||
FieldNickname,
|
||||
FieldEmail,
|
||||
FieldIP,
|
||||
FieldAddr,
|
||||
@@ -76,6 +79,8 @@ var (
|
||||
UpdateDefaultUpdatedAt func() time.Time
|
||||
// UsernameValidator is a validator for the "username" field. It is called by the builders before save.
|
||||
UsernameValidator func(string) error
|
||||
// NicknameValidator is a validator for the "nickname" field. It is called by the builders before save.
|
||||
NicknameValidator 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.
|
||||
@@ -112,6 +117,11 @@ func ByPassword(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldPassword, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByNickname orders the results by the nickname field.
|
||||
func ByNickname(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldNickname, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByEmail orders the results by the email field.
|
||||
func ByEmail(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldEmail, opts...).ToFunc()
|
||||
|
||||
@@ -75,6 +75,11 @@ func Password(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldPassword, v))
|
||||
}
|
||||
|
||||
// Nickname applies equality check predicate on the "nickname" field. It's identical to NicknameEQ.
|
||||
func Nickname(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldNickname, 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))
|
||||
@@ -300,6 +305,81 @@ func PasswordContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldPassword, v))
|
||||
}
|
||||
|
||||
// NicknameEQ applies the EQ predicate on the "nickname" field.
|
||||
func NicknameEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldNickname, v))
|
||||
}
|
||||
|
||||
// NicknameNEQ applies the NEQ predicate on the "nickname" field.
|
||||
func NicknameNEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldNickname, v))
|
||||
}
|
||||
|
||||
// NicknameIn applies the In predicate on the "nickname" field.
|
||||
func NicknameIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldNickname, vs...))
|
||||
}
|
||||
|
||||
// NicknameNotIn applies the NotIn predicate on the "nickname" field.
|
||||
func NicknameNotIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldNickname, vs...))
|
||||
}
|
||||
|
||||
// NicknameGT applies the GT predicate on the "nickname" field.
|
||||
func NicknameGT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldNickname, v))
|
||||
}
|
||||
|
||||
// NicknameGTE applies the GTE predicate on the "nickname" field.
|
||||
func NicknameGTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldNickname, v))
|
||||
}
|
||||
|
||||
// NicknameLT applies the LT predicate on the "nickname" field.
|
||||
func NicknameLT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldNickname, v))
|
||||
}
|
||||
|
||||
// NicknameLTE applies the LTE predicate on the "nickname" field.
|
||||
func NicknameLTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldNickname, v))
|
||||
}
|
||||
|
||||
// NicknameContains applies the Contains predicate on the "nickname" field.
|
||||
func NicknameContains(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContains(FieldNickname, v))
|
||||
}
|
||||
|
||||
// NicknameHasPrefix applies the HasPrefix predicate on the "nickname" field.
|
||||
func NicknameHasPrefix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasPrefix(FieldNickname, v))
|
||||
}
|
||||
|
||||
// NicknameHasSuffix applies the HasSuffix predicate on the "nickname" field.
|
||||
func NicknameHasSuffix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasSuffix(FieldNickname, v))
|
||||
}
|
||||
|
||||
// NicknameIsNil applies the IsNil predicate on the "nickname" field.
|
||||
func NicknameIsNil() predicate.User {
|
||||
return predicate.User(sql.FieldIsNull(FieldNickname))
|
||||
}
|
||||
|
||||
// NicknameNotNil applies the NotNil predicate on the "nickname" field.
|
||||
func NicknameNotNil() predicate.User {
|
||||
return predicate.User(sql.FieldNotNull(FieldNickname))
|
||||
}
|
||||
|
||||
// NicknameEqualFold applies the EqualFold predicate on the "nickname" field.
|
||||
func NicknameEqualFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEqualFold(FieldNickname, v))
|
||||
}
|
||||
|
||||
// NicknameContainsFold applies the ContainsFold predicate on the "nickname" field.
|
||||
func NicknameContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldNickname, v))
|
||||
}
|
||||
|
||||
// EmailEQ applies the EQ predicate on the "email" field.
|
||||
func EmailEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldEmail, v))
|
||||
|
||||
Reference in new issue
Block a user