update
This commit is contained in:
17
internal/model/user.go
Normal file
17
internal/model/user.go
Normal file
@ -0,0 +1,17 @@
|
||||
package model
|
||||
|
||||
// User 注册用户(账号体系)。
|
||||
//
|
||||
// PasswordHash 的 json tag 为 "-",确保密码哈希永远不会被序列化返回。
|
||||
type User struct {
|
||||
ID uint32 `gorm:"primaryKey;column:id" json:"id"`
|
||||
CreatedAt uint32 `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt uint32 `gorm:"column:updated_at" json:"updated_at"`
|
||||
Username string `gorm:"column:username;size:64;uniqueIndex" json:"username"`
|
||||
Email string `gorm:"column:email;size:191;uniqueIndex" json:"email"`
|
||||
PasswordHash string `gorm:"column:password_hash;size:255" json:"-"`
|
||||
IsDeleted uint8 `gorm:"column:is_deleted" json:"is_deleted"`
|
||||
}
|
||||
|
||||
// TableName 指定表名。
|
||||
func (User) TableName() string { return "users" }
|
||||
Reference in New Issue
Block a user