feat: SHIFT-CMD-F zoek functionaliteit toegevoegd
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from fastapi import APIRouter, Depends
|
||||
|
||||
from backend.app.api.schemas import SearchResponse
|
||||
from backend.app.dependencies import get_search_service
|
||||
from backend.app.services.search_service import SearchService
|
||||
|
||||
router = APIRouter(prefix="/search")
|
||||
|
||||
|
||||
@router.get("", response_model=SearchResponse)
|
||||
async def search(
|
||||
path: str,
|
||||
query: str,
|
||||
service: SearchService = Depends(get_search_service),
|
||||
) -> SearchResponse:
|
||||
return service.search(path=path, query=query)
|
||||
@@ -166,3 +166,16 @@ class HistoryItem(BaseModel):
|
||||
|
||||
class HistoryListResponse(BaseModel):
|
||||
items: list[HistoryItem]
|
||||
|
||||
|
||||
class SearchResultItem(BaseModel):
|
||||
name: str
|
||||
path: str
|
||||
type: str
|
||||
parent_path: str
|
||||
root: str
|
||||
|
||||
|
||||
class SearchResponse(BaseModel):
|
||||
items: list[SearchResultItem]
|
||||
truncated: bool
|
||||
|
||||
Reference in New Issue
Block a user