You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
767 B
Python
29 lines
767 B
Python
from typing import Dict, List, Optional
|
|
|
|
from fastapi import APIRouter, HTTPException, status
|
|
from fastapi.params import Query
|
|
|
|
from src.database.core import DbSession
|
|
from src.models import StandardResponse
|
|
|
|
from .service import get_all_target_reliability
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("", response_model=StandardResponse[List[Dict]])
|
|
async def get_target_reliability(
|
|
db_session: DbSession,
|
|
scope_name: Optional[str] = Query(None),
|
|
eaf_threshold: float = Query(100),
|
|
):
|
|
"""Get all scope pagination."""
|
|
results = await get_all_target_reliability(
|
|
db_session=db_session, scope_name=scope_name, eaf_threshold=eaf_threshold
|
|
)
|
|
|
|
return StandardResponse(
|
|
data=results,
|
|
message="Data retrieved successfully",
|
|
)
|