init: 初始化 AssetX 项目仓库
包含 webapp(Next.js 用户端)、webapp-back(Go 后端)、 antdesign(管理后台)、landingpage(营销落地页)、 数据库 SQL 和配置文件。
This commit is contained in:
27
webapp-back/models/user.go
Normal file
27
webapp-back/models/user.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// User represents the users table
|
||||
// Web3 native: wallet_address is the primary key (no numeric id, no auth_user_id)
|
||||
type User struct {
|
||||
WalletAddress string `gorm:"primaryKey;size:42" json:"wallet_address"`
|
||||
Nickname string `gorm:"size:100" json:"nickname"`
|
||||
Avatar string `gorm:"type:text" json:"avatar"`
|
||||
Bio string `gorm:"type:text" json:"bio"`
|
||||
ReferrerWallet *string `gorm:"size:42;index" json:"referrer_wallet,omitempty"`
|
||||
InviteCode string `gorm:"size:20;unique;index" json:"invite_code"`
|
||||
DirectInvitesCount int `gorm:"default:0" json:"direct_invites_count"`
|
||||
MemberTier string `gorm:"size:50;default:'Bronze'" json:"member_tier"`
|
||||
VIPLevel int `gorm:"default:1" json:"vip_level"`
|
||||
TotalPoints int64 `gorm:"default:0" json:"total_points"`
|
||||
GlobalRank *int `gorm:"index" json:"global_rank,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
func (User) TableName() string {
|
||||
return "users"
|
||||
}
|
||||
Reference in New Issue
Block a user