feat: 接入旧站管理端并完整迁移后台能力

This commit is contained in:
yml
2026-11-12 22:03:01 +08:00
parent e5f923706b
commit a4441bba9a
509 changed files with 140714 additions and 1068 deletions
+18 -12
View File
@@ -3,18 +3,24 @@ package model
import "time"
type User struct {
ID uint64 `gorm:"primaryKey" json:"id"`
Phone string `gorm:"size:32;not null;uniqueIndex" json:"phone"`
PasswordHash string `gorm:"size:255;not null;default:''" json:"-"`
Nickname string `gorm:"size:64;not null;default:''" json:"nickname"`
AvatarURL string `gorm:"size:512;not null;default:''" json:"avatar_url"`
RealnameStatus string `gorm:"size:32;not null;default:'unverified'" json:"realname_status"`
RiskStatus string `gorm:"size:32;not null;default:'normal'" json:"risk_status"`
CreditScore int `gorm:"not null;default:100" json:"credit_score"`
DepositFreeQuotaCent int64 `gorm:"not null;default:0" json:"-"`
RenterGrowthPoints int64 `gorm:"not null;default:0;index:idx_users_renter_growth_level,priority:2" json:"renter_growth_points"`
RenterGrowthLevel string `gorm:"size:32;not null;default:'normal';index:idx_users_renter_growth_level,priority:1" json:"renter_growth_level"`
Status string `gorm:"size:32;not null;default:'active'" json:"status"`
ID uint64 `gorm:"primaryKey" json:"id"`
Phone string `gorm:"size:32;not null;uniqueIndex" json:"phone"`
PasswordHash string `gorm:"size:255;not null;default:''" json:"-"`
Nickname string `gorm:"size:64;not null;default:''" json:"nickname"`
AvatarURL string `gorm:"size:512;not null;default:''" json:"avatar_url"`
RealnameStatus string `gorm:"size:32;not null;default:'unverified'" json:"realname_status"`
RiskStatus string `gorm:"size:32;not null;default:'normal'" json:"risk_status"`
CreditScore int `gorm:"not null;default:100" json:"credit_score"`
DepositFreeQuotaCent int64 `gorm:"not null;default:0" json:"-"`
RenterGrowthPoints int64 `gorm:"not null;default:0;index:idx_users_renter_growth_level,priority:2" json:"renter_growth_points"`
RenterGrowthLevel string `gorm:"size:32;not null;default:'normal';index:idx_users_renter_growth_level,priority:1" json:"renter_growth_level"`
RenterGrowthLevelOverride string `gorm:"size:32;not null;default:''" json:"-"`
PointsAvailable int64 `gorm:"not null;default:0" json:"points_available"`
Status string `gorm:"size:32;not null;default:'active'" json:"status"`
QualityOwnerStatus string `gorm:"size:16;not null;default:'none';index:idx_users_quality_owner_status" json:"quality_owner_status"`
QualityOwnerDepositCent int64 `gorm:"not null;default:0" json:"quality_owner_deposit_cent"`
QualityOwnerDepositSource string `gorm:"size:16;not null;default:''" json:"quality_owner_deposit_source"`
QualityOwnerActivatedAt *time.Time `json:"quality_owner_activated_at"`
// 会话版本:递增后该用户已签发的全部令牌立即失效。
// 默认值对齐迁移 000052 的 users.token_version DEFAULT 0。
TokenVersion int64 `gorm:"not null;default:0" json:"-"`