2021-06-28 09:08:09 +00:00
|
|
|
from datetime import datetime
|
|
|
|
from typing import Optional, Text
|
|
|
|
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
|
|
|
|
|
|
class User(BaseModel):
|
|
|
|
id: Optional[int]
|
|
|
|
# age: Optional[int]
|
|
|
|
username: Optional[Text]
|
|
|
|
# phone: Optional[Text]
|
|
|
|
password: Optional[Text]
|
|
|
|
|
|
|
|
|
|
|
|
class PayLoad(BaseModel):
|
|
|
|
user_id: int
|
|
|
|
device: Text
|
|
|
|
exp: datetime
|
|
|
|
iat: datetime
|
|
|
|
|
|
|
|
|
|
|
|
class CreateUser(BaseModel):
|
2021-06-29 10:26:46 +00:00
|
|
|
email: Text
|
2021-07-30 06:19:00 +00:00
|
|
|
# username: Optional[Text]
|
2021-06-28 09:08:09 +00:00
|
|
|
# age: Optional[int]
|
|
|
|
# phone: Optional[Text]
|
|
|
|
password: Optional[Text]
|
|
|
|
|
2021-06-29 10:26:46 +00:00
|
|
|
# TODO: update validations
|