Files
2026-09-20 01:06:13 +08:00

20 lines
937 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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"`
// Tier 用户等级:free / vip。仅作账号标记(后台可提级 VIP);图片质量模型已统一,tier 不再影响图片 URL。
Tier string `gorm:"column:tier;size:16" json:"tier"`
}
// TableName 指定表名。
func (User) TableName() string { return "users" }