package models import "time" type User struct { ID int64 `gorm:"primaryKey" json:"id"` Email string `gorm:"column:email;uniqueIndex" json:"email"` PasswordHash string `gorm:"column:password_hash" json:"-"` Role string `gorm:"column:role" json:"role"` Active bool `gorm:"column:active" json:"active"` LastLoginAt *time.Time `gorm:"column:last_login_at" json:"last_login_at,omitempty"` CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"` } func (User) TableName() string { return "users" }