Files
backend_v2/internal/model/user.go
toom1996 74ba700598 update
2026-09-07 00:01:48 +08:00

20 lines
919 B
Go
Raw 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 string `gorm:"column:tier;size:16" json:"tier"`
}
// TableName 指定表名。
func (User) TableName() string { return "users" }