mirror of
https://github.com/ijaric/voice_assistant.git
synced 2025-12-16 09:56:16 +00:00
feat: new file structure
This commit is contained in:
0
src/assistant/lib/api/__init__.py
Normal file
0
src/assistant/lib/api/__init__.py
Normal file
0
src/assistant/lib/api/v1/__init__.py
Normal file
0
src/assistant/lib/api/v1/__init__.py
Normal file
3
src/assistant/lib/api/v1/handlers/__init__.py
Normal file
3
src/assistant/lib/api/v1/handlers/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from .health import basic_router
|
||||
|
||||
__all__ = ["basic_router"]
|
||||
5
src/assistant/lib/api/v1/handlers/health/__init__.py
Normal file
5
src/assistant/lib/api/v1/handlers/health/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from .liveness_probe import basic_router
|
||||
|
||||
__all__ = [
|
||||
"basic_router",
|
||||
]
|
||||
15
src/assistant/lib/api/v1/handlers/health/liveness_probe.py
Normal file
15
src/assistant/lib/api/v1/handlers/health/liveness_probe.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import fastapi
|
||||
|
||||
import lib.api.v1.schemas as api_shemas
|
||||
|
||||
basic_router = fastapi.APIRouter()
|
||||
|
||||
|
||||
@basic_router.get(
|
||||
"/",
|
||||
response_model=api_shemas.HealthResponse,
|
||||
summary="Статус работоспособности",
|
||||
description="Проверяет доступность сервиса FastAPI.",
|
||||
)
|
||||
async def health():
|
||||
return api_shemas.HealthResponse(status="healthy")
|
||||
3
src/assistant/lib/api/v1/schemas/__init__.py
Normal file
3
src/assistant/lib/api/v1/schemas/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from .base import HealthResponse
|
||||
|
||||
__all__ = ["HealthResponse"]
|
||||
5
src/assistant/lib/api/v1/schemas/base.py
Normal file
5
src/assistant/lib/api/v1/schemas/base.py
Normal file
@@ -0,0 +1,5 @@
|
||||
import pydantic
|
||||
|
||||
|
||||
class HealthResponse(pydantic.BaseModel):
|
||||
status: str = pydantic.Field(default=..., examples=["healthy"], description="Схема доступности сервиса")
|
||||
Reference in New Issue
Block a user