diff --git a/schemas/auth.py b/schemas/auth.py new file mode 100644 index 0000000..0183ccd --- /dev/null +++ b/schemas/auth.py @@ -0,0 +1,28 @@ +from pydantic import BaseModel, Field +from typing import Optional + +class AuthBase(BaseModel): + token: str = Field(..., description="Authentication token") + user_id: str = Field(..., description="User identifier") + device_id: Optional[str] = Field(None, description="Device identifier") + +class AuthCreate(AuthBase): + class Config: + schema_extra = { + "example": { + "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9", + "user_id": "user123", + "device_id": "device456" + } + } + +class Auth(AuthBase): + class Config: + orm_mode = True + schema_extra = { + "example": { + "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9", + "user_id": "user123", + "device_id": "device456" + } + } \ No newline at end of file