24 lines
426 B
Python
24 lines
426 B
Python
from pydantic import BaseModel
|
|
from typing import Annotated, Union
|
|
|
|
class Book(BaseModel):
|
|
id: int
|
|
|
|
|
|
class Token(BaseModel):
|
|
access_token: str
|
|
token_type: str
|
|
|
|
|
|
class TokenData(BaseModel):
|
|
email: Union[str, None] = None
|
|
|
|
|
|
class User(BaseModel):
|
|
email: Union[str, None] = None
|
|
full_name: Union[str, None] = None
|
|
disabled: Union[bool, None] = None
|
|
|
|
|
|
class UserInDB(User):
|
|
hashed_password: str |