27 lines
497 B
Python
27 lines
497 B
Python
from __future__ import annotations
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import EmailStr
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
|
|
class UserCreate(BaseModel):
|
|
email: EmailStr
|
|
password: str
|
|
|
|
|
|
class Token(BaseModel):
|
|
access_token: str
|
|
refresh_token: str
|
|
token_type: str = "bearer"
|
|
|
|
|
|
class UserRead(BaseModel):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: int
|
|
email: EmailStr
|
|
is_active: bool
|
|
created_at: datetime
|