go-urlsh/models/user.go

21 lines
545 B
Go
Raw Normal View History

2023-04-27 10:37:42 +02:00
package models
import (
"github.com/uptrace/bun"
"time"
)
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"`
}