initial structure implemented

docs -> _docs
This commit is contained in:
Oleksandr Bezdieniezhnykh
2025-12-01 14:20:56 +02:00
parent 9134c5db06
commit abc26d5c20
360 changed files with 3881 additions and 101 deletions
+5
View File
@@ -0,0 +1,5 @@
from .base import FlightAPIBase
from .flight_api import FlightAPI
__all__ = ["FlightAPIBase", "FlightAPI"]
+69
View File
@@ -0,0 +1,69 @@
from abc import ABC, abstractmethod
from typing import AsyncIterator
from fastapi import UploadFile
from models.api import (
FlightCreateRequest,
FlightResponse,
FlightDetailResponse,
FlightStatusResponse,
DeleteResponse,
UpdateResponse,
BatchResponse,
UserFixRequest,
UserFixResponse,
ObjectGPSResponse,
)
from models.core import GPSPoint
class FlightAPIBase(ABC):
@abstractmethod
async def create_flight(self, request: FlightCreateRequest) -> FlightResponse:
pass
@abstractmethod
async def get_flight(self, flight_id: str) -> FlightDetailResponse:
pass
@abstractmethod
async def get_flight_status(self, flight_id: str) -> FlightStatusResponse:
pass
@abstractmethod
async def delete_flight(self, flight_id: str) -> DeleteResponse:
pass
@abstractmethod
async def update_waypoints(
self, flight_id: str, waypoints: list[GPSPoint]
) -> UpdateResponse:
pass
@abstractmethod
async def upload_batch(
self,
flight_id: str,
files: list[UploadFile],
start_sequence: int,
end_sequence: int,
batch_number: int,
) -> BatchResponse:
pass
@abstractmethod
async def submit_user_fix(
self, flight_id: str, request: UserFixRequest
) -> UserFixResponse:
pass
@abstractmethod
async def get_object_gps(
self, flight_id: str, frame_id: int, pixel: tuple[float, float]
) -> ObjectGPSResponse:
pass
@abstractmethod
def stream_events(self, flight_id: str) -> AsyncIterator[dict]:
pass
+61
View File
@@ -0,0 +1,61 @@
from typing import AsyncIterator
from fastapi import UploadFile
from .base import FlightAPIBase
from models.api import (
FlightCreateRequest,
FlightResponse,
FlightDetailResponse,
FlightStatusResponse,
DeleteResponse,
UpdateResponse,
BatchResponse,
UserFixRequest,
UserFixResponse,
ObjectGPSResponse,
)
from models.core import GPSPoint
class FlightAPI(FlightAPIBase):
async def create_flight(self, request: FlightCreateRequest) -> FlightResponse:
raise NotImplementedError
async def get_flight(self, flight_id: str) -> FlightDetailResponse:
raise NotImplementedError
async def get_flight_status(self, flight_id: str) -> FlightStatusResponse:
raise NotImplementedError
async def delete_flight(self, flight_id: str) -> DeleteResponse:
raise NotImplementedError
async def update_waypoints(
self, flight_id: str, waypoints: list[GPSPoint]
) -> UpdateResponse:
raise NotImplementedError
async def upload_batch(
self,
flight_id: str,
files: list[UploadFile],
start_sequence: int,
end_sequence: int,
batch_number: int,
) -> BatchResponse:
raise NotImplementedError
async def submit_user_fix(
self, flight_id: str, request: UserFixRequest
) -> UserFixResponse:
raise NotImplementedError
async def get_object_gps(
self, flight_id: str, frame_id: int, pixel: tuple[float, float]
) -> ObjectGPSResponse:
raise NotImplementedError
async def stream_events(self, flight_id: str) -> AsyncIterator[dict]:
raise NotImplementedError
yield