Files
backend/internal/models/user.go
2025-06-18 09:01:14 +03:00

35 lines
1014 B
Go

package models
import (
"time"
"github.com/google/uuid"
)
// User представляет структуру пользователя в таблице 'users'
type User struct {
ID int `json:"-"`
UUID uuid.UUID `json:"uuid"`
Username string `json:"username"`
Email string `json:"email"`
PasswordHash string `json:"-"`
Role string `json:"role"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// RegisterRequest определяет структуру JSON-запроса на регистрацию
type RegisterRequest struct {
Username string `json:"username"`
Email string `json:"email"`
Password string `json:"password"`
}
type Profile struct {
ID int `json:"-"`
UserID int `json:"-"`
SkinHash string `json:"skin_hash,omitempty"`
CapeHash string `json:"cape_hash,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}