go-urlsh/models/user.go

23 lines
594 B
Go
Raw Normal View History

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"`
2024-05-06 21:38:51 +02:00
LastLogin time.Time `bun:"last_login" json:"last_login"`
2023-04-27 10:37:42 +02:00
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
}