first commit

This commit is contained in:
2026-03-07 21:31:38 +03:00
commit a879ba7b50
68 changed files with 2487 additions and 0 deletions

32
app/media/schemas.py Normal file
View File

@@ -0,0 +1,32 @@
from pydantic import BaseModel, ConfigDict, Field
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