22 lines
623 B
Go
22 lines
623 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
type UserRole string
|
|
|
|
const (
|
|
UserRoleAdmin UserRole = "admin"
|
|
UserRoleUser UserRole = "user"
|
|
)
|
|
|
|
type User struct {
|
|
ID int64 `db:"id" json:"id"`
|
|
Username string `db:"username" json:"username"`
|
|
Email string `db:"email" json:"email"`
|
|
PasswordHash string `db:"password_hash" json:"-"`
|
|
Role UserRole `db:"role" json:"role"`
|
|
Enabled bool `db:"enabled" json:"enabled"`
|
|
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
|
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
|
|
}
|