2023-04-27 10:37:42 +02:00
|
|
|
package models
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
2024-05-04 17:06:01 +02:00
|
|
|
|
|
|
|
"github.com/uptrace/bun"
|
2023-04-27 10:37:42 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type User struct {
|
|
|
|
bun.BaseModel `bun:"table:users"`
|
|
|
|
UserName string `bun:"username,pk" json:"username"`
|
|
|
|
Created time.Time `bun:"created,notnull,default:now()" json:"created"`
|
|
|
|
LastLogin time.Time `bun:"lastlogin" json:"last_login"`
|
|
|
|
PasswordSalt string `bun:"salt" json:"password_salt"`
|
|
|
|
PasswordHash string `bun:"password" json:"password_hash"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type UserResponse struct {
|
2024-05-04 17:06:01 +02:00
|
|
|
UserName string `json:"username"`
|
|
|
|
Created time.Time `json:"created"`
|
|
|
|
MFAEnabled bool `json:"mfa_neabled"`
|
2023-04-27 10:37:42 +02:00
|
|
|
}
|