feat(user): 添加昵称字段

This commit is contained in:
unclesam committed 2026-07-08 03:49:01 +08:00
1 parent b24e1e41d7
commit 85265abb48
10 files changed
+292 -5

No files matched your search

+10
View File
@@ -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()