This commit is contained in:
toom1996
2026-08-26 10:45:21 +08:00
parent 3cf1368e68
commit 30c9f21da4
48 changed files with 3442 additions and 0 deletions

17
internal/model/user.go Normal file
View 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" }