Update GPT and add Profile
This commit is contained in:
@@ -6,6 +6,9 @@ from app.schemas.user import (
|
||||
UserWithTelegram,
|
||||
TokenResponse,
|
||||
TelegramLink,
|
||||
PasswordChange,
|
||||
UserStats,
|
||||
UserProfilePublic,
|
||||
)
|
||||
from app.schemas.marathon import (
|
||||
MarathonCreate,
|
||||
@@ -87,6 +90,9 @@ __all__ = [
|
||||
"UserWithTelegram",
|
||||
"TokenResponse",
|
||||
"TelegramLink",
|
||||
"PasswordChange",
|
||||
"UserStats",
|
||||
"UserProfilePublic",
|
||||
# Marathon
|
||||
"MarathonCreate",
|
||||
"MarathonUpdate",
|
||||
|
||||
@@ -58,3 +58,28 @@ class TokenResponse(BaseModel):
|
||||
class TelegramLink(BaseModel):
|
||||
telegram_id: int
|
||||
telegram_username: str | None = None
|
||||
|
||||
|
||||
class PasswordChange(BaseModel):
|
||||
current_password: str = Field(..., min_length=6)
|
||||
new_password: str = Field(..., min_length=6, max_length=100)
|
||||
|
||||
|
||||
class UserStats(BaseModel):
|
||||
"""Статистика пользователя по марафонам"""
|
||||
marathons_count: int
|
||||
wins_count: int
|
||||
completed_assignments: int
|
||||
total_points_earned: int
|
||||
|
||||
|
||||
class UserProfilePublic(BaseModel):
|
||||
"""Публичный профиль пользователя со статистикой"""
|
||||
id: int
|
||||
nickname: str
|
||||
avatar_url: str | None = None
|
||||
created_at: datetime
|
||||
stats: UserStats
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
Reference in New Issue
Block a user