20 lines
628 B
Go
20 lines
628 B
Go
package accounts
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type User struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
Email string `gorm:"uniqueIndex;not null" json:"email"`
|
|
PasswordHash string `gorm:"not null" json:"-"`
|
|
IsAdmin bool `gorm:"default:false" json:"is_admin"`
|
|
ApiToken string `gorm:"uniqueIndex" json:"api_token"`
|
|
ApiTokenExpiresAt *time.Time `json:"api_token_expires_at"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
|
}
|