Schemas updated
This commit is contained in:
0
ApiServices/AuthService/endpoints/__init__.py
Normal file
0
ApiServices/AuthService/endpoints/__init__.py
Normal file
20
ApiServices/AuthService/endpoints/routes.py
Normal file
20
ApiServices/AuthService/endpoints/routes.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from fastapi import APIRouter
|
||||
from .test_template.route import test_template_route
|
||||
|
||||
|
||||
def get_routes() -> list[APIRouter]:
|
||||
return [test_template_route]
|
||||
|
||||
|
||||
def get_safe_endpoint_urls() -> list[tuple[str, str]]:
|
||||
return [
|
||||
("/", "GET"),
|
||||
("/docs", "GET"),
|
||||
("/redoc", "GET"),
|
||||
("/openapi.json", "GET"),
|
||||
("/auth/register", "POST"),
|
||||
("/auth/login", "POST"),
|
||||
("/metrics", "GET"),
|
||||
("/test/template", "GET"),
|
||||
("/test/template", "POST"),
|
||||
]
|
||||
40
ApiServices/AuthService/endpoints/test_template/route.py
Normal file
40
ApiServices/AuthService/endpoints/test_template/route.py
Normal file
@@ -0,0 +1,40 @@
|
||||
from fastapi import APIRouter, Request, Response
|
||||
|
||||
test_template_route = APIRouter(prefix="/test", tags=["Test"])
|
||||
|
||||
|
||||
@test_template_route.get(path="/template", description="Test Template Route")
|
||||
def test_template(request: Request, response: Response):
|
||||
"""
|
||||
Test Template Route
|
||||
"""
|
||||
headers = dict(request.headers)
|
||||
response.headers["X-Header"] = "Test Header GET"
|
||||
return {
|
||||
"completed": True,
|
||||
"message": "Test Template Route",
|
||||
"info": {
|
||||
"host": headers.get("host", "Not Found"),
|
||||
"user_agent": headers.get("user-agent", "Not Found"),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@test_template_route.post(
|
||||
path="/template",
|
||||
description="Test Template Route with Post Method",
|
||||
)
|
||||
def test_template_post(request: Request, response: Response):
|
||||
"""
|
||||
Test Template Route with Post Method
|
||||
"""
|
||||
headers = dict(request.headers)
|
||||
response.headers["X-Header"] = "Test Header POST"
|
||||
return {
|
||||
"completed": True,
|
||||
"message": "Test Template Route with Post Method",
|
||||
"info": {
|
||||
"host": headers.get("host", "Not Found"),
|
||||
"user_agent": headers.get("user-agent", "Not Found"),
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user