package model import "time" type User struct { Base ShopID uint64 `gorm:"not null;index;uniqueIndex:uk_shop_username" json:"shop_id"` Username string `gorm:"size:50;uniqueIndex:uk_shop_username" json:"username"` PasswordHash string `gorm:"size:255" json:"-"` RealName string `gorm:"size:50" json:"real_name"` Phone string `gorm:"size:30" json:"phone"` Role string `gorm:"type:enum('admin','operator','readonly','superadmin');default:'operator'" json:"role"` IsActive bool `gorm:"default:true" json:"is_active"` LastLoginAt *time.Time `json:"last_login_at,omitempty"` CustomFields JSON `gorm:"type:json" json:"custom_fields,omitempty"` }