2023-12-01 21:19:44 +01:00
|
|
|
package models
|
|
|
|
|
|
|
|
import (
|
|
|
|
"gorm.io/gorm"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2023-12-06 23:25:34 +01:00
|
|
|
var DB *gorm.DB
|
|
|
|
|
2023-12-01 21:19:44 +01:00
|
|
|
type User struct {
|
|
|
|
gorm.Model
|
|
|
|
Username string
|
|
|
|
Email string
|
2023-12-15 15:42:29 +01:00
|
|
|
PasswordHash []byte `gorm:"size:60"`
|
2023-12-01 21:19:44 +01:00
|
|
|
LastLoginAt time.Time
|
|
|
|
}
|
2023-12-18 07:48:25 +01:00
|
|
|
|
|
|
|
type EmailConfirmation struct {
|
|
|
|
gorm.Model
|
|
|
|
UserID uint
|
|
|
|
User User
|
|
|
|
ConfirmationCode string
|
|
|
|
ExpiresAt time.Time
|
|
|
|
}
|