You've already forked golang-base-project
@ -1,9 +1,17 @@
|
||||
package models
|
||||
|
||||
import "gorm.io/gorm"
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Session struct {
|
||||
gorm.Model
|
||||
Identifier string
|
||||
UserID uint
|
||||
ExpiresAt time.Time
|
||||
}
|
||||
|
||||
func (s Session) HasExpired() bool {
|
||||
return s.ExpiresAt.Before(time.Now())
|
||||
}
|
||||
|
Reference in New Issue
Block a user