mirror of
https://github.com/shadoll/scatcher.git
synced 2025-12-20 03:26:59 +00:00
Add schemas
This commit is contained in:
7
schema/answer.py
Normal file
7
schema/answer.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from pydantic import BaseModel
|
||||
from schema.status import Status
|
||||
|
||||
|
||||
class Answer(BaseModel):
|
||||
status: Status
|
||||
message: str
|
||||
11
schema/methods.py
Normal file
11
schema/methods.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class Methods(str, Enum):
|
||||
GET = "GET"
|
||||
POST = "POST"
|
||||
PUT = "PUT"
|
||||
DELETE = "DELETE"
|
||||
PATCH = "PATCH"
|
||||
OPTIONS = "OPTIONS"
|
||||
HEAD = "HEAD"
|
||||
10
schema/request_data.py
Normal file
10
schema/request_data.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from pydantic import BaseModel
|
||||
from schema.methods import Methods
|
||||
|
||||
|
||||
class RequestData(BaseModel):
|
||||
data: dict
|
||||
method: Methods = Methods.GET
|
||||
url: str
|
||||
headers: dict
|
||||
time: str
|
||||
7
schema/status.py
Normal file
7
schema/status.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class Status(str, Enum):
|
||||
ok = "ok"
|
||||
success = "success"
|
||||
error = "error"
|
||||
Reference in New Issue
Block a user