Files
Messenger/app/media/schemas.py
benya 99e7c70901
Some checks failed
CI / test (push) Failing after 21s
feat: realtime sync, settings UX and chat list improvements
- add chat_updated realtime event and dynamic chat subscriptions

- auto-join invite links in web app

- implement Telegram-like settings panel (general/notifications/privacy)

- add browser notification preferences and keyboard send mode

- improve chat list with last message preview/time and online badge

- rework chat members UI with context actions and role crowns
2026-03-08 10:59:44 +03:00

45 lines
1003 B
Python

from pydantic import BaseModel, ConfigDict, Field
from datetime import datetime
class UploadUrlRequest(BaseModel):
file_name: str = Field(min_length=1, max_length=255)
file_type: str = Field(min_length=1, max_length=64)
file_size: int = Field(gt=0)
class UploadUrlResponse(BaseModel):
upload_url: str
file_url: str
object_key: str
expires_in: int
required_headers: dict[str, str]
class AttachmentCreateRequest(BaseModel):
message_id: int
file_url: str = Field(min_length=1, max_length=1024)
file_type: str = Field(min_length=1, max_length=64)
file_size: int = Field(gt=0)
class AttachmentRead(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: int
message_id: int
file_url: str
file_type: str
file_size: int
class ChatAttachmentRead(BaseModel):
id: int
message_id: int
sender_id: int
message_type: str
message_created_at: datetime
file_url: str
file_type: str
file_size: int