Files
sm-user-plugin/models/throttle.go
2026-09-22 13:53:16 +02:00

23 lines
690 B
Go

package models
import "time"
// Throttle is one failed-login counter, keyed by user and optional IP.
type Throttle struct {
ID uint `gorm:"column:id;primaryKey"`
UserID uint `gorm:"column:user_id"`
IPAddress *string `gorm:"column:ip_address"`
Attempts int `gorm:"column:attempts"`
IsSuspended bool `gorm:"column:is_suspended"`
SuspendedAt *time.Time `gorm:"column:suspended_at"`
IsBanned bool `gorm:"column:is_banned"`
CreatedAt time.Time `gorm:"column:created_at"`
UpdatedAt time.Time `gorm:"column:updated_at"`
}
func (Throttle) TableName() string { return "user_throttle" }
func init() {
Register(Throttle{})
}