2020-06-05 01:09:55 +02:00
|
|
|
from fastapi import Query
|
2020-07-03 13:30:01 +02:00
|
|
|
from pydantic import BaseModel, EmailStr
|
2020-09-03 18:33:15 +02:00
|
|
|
from typing import Optional
|
2020-06-05 01:09:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
class RegisterSchema(BaseModel):
|
|
|
|
full_name: str
|
|
|
|
email: EmailStr
|
|
|
|
password: str
|
2020-09-03 18:33:15 +02:00
|
|
|
gender: int = Query(None, ge=1, le=3)
|
2020-06-21 15:55:46 +02:00
|
|
|
mobile: str = Query(None, min_length=8, max_length=13)
|
2020-09-03 18:33:15 +02:00
|
|
|
user_image: Optional[str] = None
|
|
|
|
user_type: int = Query(None, ge=1, le=2)
|
|
|
|
lang_type: int = Query(None, ge=1, le=2)
|
|
|
|
device_type: int = Query(None, ge=1, le=2)
|
2020-06-05 01:09:55 +02:00
|
|
|
device_id: str
|
|
|
|
|
|
|
|
|
|
|
|
class LoginSchema(BaseModel):
|
|
|
|
email: EmailStr
|
|
|
|
password: str
|
2020-09-03 18:33:15 +02:00
|
|
|
user_type: int = Query(None, ge=1, le=2)
|
|
|
|
lang_type: int = Query(None, ge=1, le=2)
|
2020-06-05 01:09:55 +02:00
|
|
|
device_id: str
|
|
|
|
|
|
|
|
|
|
|
|
class OTPSchema(BaseModel):
|
2020-09-03 18:33:15 +02:00
|
|
|
access_key: str
|
|
|
|
otp: int = Query(None, ge=6, le=6)
|