fix: phone and email nullable.
This commit is contained in:
@ -6,13 +6,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type User struct {
|
type User struct {
|
||||||
ID uint `gorm:"primaryKey" json:"id"`
|
ID uint `gorm:"primaryKey" json:"id"`
|
||||||
Username string `gorm:"uniqueIndex;not null" json:"username"`
|
Username string `gorm:"uniqueIndex;not null" json:"username"`
|
||||||
Email string `gorm:"uniqueIndex;" json:"email"`
|
Email *string `gorm:"uniqueIndex;" json:"email"`
|
||||||
Phone string `gorm:"uniqueIndex;" json:"phone"`
|
Phone *string `gorm:"uniqueIndex;" json:"phone"`
|
||||||
Password string `gorm:"not null" json:"-"`
|
Password string `gorm:"not null" json:"-"`
|
||||||
CreatedAt int64 `json:"created_at"`
|
CreatedAt int64 `json:"created_at"`
|
||||||
UpdatedAt int64 `json:"updated_at"`
|
UpdatedAt int64 `json:"updated_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// HashPassword 密码加密
|
// HashPassword 密码加密
|
||||||
|
|||||||
Reference in New Issue
Block a user