desktop_app/app/core/models/search_models.py
2025-10-04 02:25:12 +03:00

27 lines
679 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from uuid import UUID
from datetime import datetime
from typing import Optional, List, Any
from pydantic import BaseModel, Field
class UserSearchResult(BaseModel):
user_id: UUID
login: str
full_name: Optional[str] = None
custom_name: Optional[str] = None
created_at: datetime = Field(..., description="Дата регистрации")
profile: Optional[Any] = Field(None, description="Модель как у /profile/{user_id}")
class SearchData(BaseModel):
users: List[UserSearchResult]
groups: List[Any] = []
channels: List[Any] = []
messages: List[Any] = []
class SearchResponse(BaseModel):
status: str
data: SearchData