package domain import "time" type User struct { ID uint `json:"id" gorm:"primaryKey"` TenantID string `json:"tenant_id" gorm:"type:uuid;not null;index:idx_tenant_email,unique;primaryKey"` Username string `json:"username" gorm:"uniqueIndex;size:64;not null"` Email string `json:"email" gorm:"index:idx_tenant_email,unique;size:128;not null"` Password string `json:"-" gorm:"size:256;not null"` Nickname string `json:"nickname" gorm:"size:64"` Avatar string `json:"avatar" gorm:"size:512"` Status int `json:"status" gorm:"default:1"` LastLogin *time.Time `json:"last_login,omitempty"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } func (User) TableName() string { return "users" }