Files
pulse-api/internal/model/user.go
2026-02-06 11:19:55 +00:00

46 lines
1.1 KiB
Go

package model
import (
"time"
)
type User struct {
ID int64 `db:"id" json:"id"`
Email string `db:"email" json:"email"`
Username string `db:"username" json:"username"`
PasswordHash string `db:"password_hash" json:"-"`
EmailVerified bool `db:"email_verified" json:"email_verified"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
type RegisterRequest struct {
Email string `json:"email"`
Username string `json:"username"`
Password string `json:"password"`
}
type LoginRequest struct {
Email string `json:"email"`
Password string `json:"password"`
}
type UpdateProfileRequest struct {
Username string `json:"username,omitempty"`
}
type ChangePasswordRequest struct {
OldPassword string `json:"old_password"`
NewPassword string `json:"new_password"`
}
type AuthResponse struct {
User *User `json:"user"`
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
}
type RefreshRequest struct {
RefreshToken string `json:"refresh_token"`
}