odapi/app/schemas.py

29 lines
750 B
Python
Raw Normal View History

from fastapi import Query
from pydantic import BaseModel, EmailStr
class RegisterSchema(BaseModel):
full_name: str
email: EmailStr
password: str
2020-06-21 15:55:46 +02:00
gender: int = Query(None, le=1, ge=3)
mobile: str = Query(None, min_length=8, max_length=13)
user_image: str = None
2020-06-21 15:55:46 +02:00
user_type: int = Query(None, le=1, ge=2)
lang_type: int = Query(None, le=1, ge=2)
device_type: int = Query(None, le=1, ge=2)
device_id: str
class LoginSchema(BaseModel):
email: EmailStr
password: str
2020-06-21 15:55:46 +02:00
user_type: int = Query(None, le=1, ge=2)
lang_type: int = Query(None, le=1, ge=2)
device_id: str
class OTPSchema(BaseModel):
2020-06-21 15:55:46 +02:00
mobile: str = Query(None, min_length=8, max_length=13)
otp: int = Query(None, le=6, ge=6)