from fastapi import APIRouter, Depends, Form from fastapi.responses import JSONResponse from app.db_local_storage.in_memory_db import query_response_storage from app.modules.querySearch.controllers.querySearch_controller import ( QuerySearchController, ) from app.modules.querySearch.dependecies import get_query_search_controller router = APIRouter() @router.post("/query_search") async def handle_query_search( q: str = Form(...), controller: QuerySearchController = Depends(get_query_search_controller), ): return await controller.handle_query_search(q) @router.get("/get_messages") async def get_messages(): return JSONResponse(status_code=200, content={"data": query_response_storage})