go-urlsh/models/user.go

22 lines
593 B
Go

package models
import (
"time"
"github.com/uptrace/bun"
)
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 {
UserName string `json:"username"`
Created time.Time `json:"created"`
MFAEnabled bool `json:"mfa_neabled"`
}