refac: decorator calls

This commit is contained in:
Jörn-Michael Miehe 2023-10-24 19:39:43 +02:00
parent b7292af6ad
commit e428fea3da
5 changed files with 6 additions and 26 deletions

View file

@ -52,7 +52,6 @@ async def start_router() -> None:
@router.get(
"/list",
response_model=list[str],
responses=_ls.responses,
)
async def list_all_files(
@ -63,7 +62,6 @@ async def list_all_files(
@router.get(
"/find/{prefix}",
response_model=list[str],
responses=_fp.responses,
)
async def find_files_by_prefix(
@ -74,8 +72,8 @@ async def find_files_by_prefix(
@router.get(
"/get/{prefix}",
response_class=StreamingResponse,
responses=_fpu.responses,
response_class=StreamingResponse,
)
async def get_file_by_prefix(
prefix: str,

View file

@ -53,7 +53,6 @@ async def start_router() -> None:
@router.get(
"/list",
response_model=list[str],
responses=_ls.responses,
)
async def list_all_images(
@ -64,7 +63,6 @@ async def list_all_images(
@router.get(
"/find/{prefix}",
response_model=list[str],
responses=_fp.responses,
)
async def find_images_by_prefix(
@ -75,8 +73,8 @@ async def find_images_by_prefix(
@router.get(
"/get/{prefix}",
response_class=StreamingResponse,
responses=_fpu.responses,
response_class=StreamingResponse,
)
async def get_image_by_prefix(
prefix: str,
@ -97,10 +95,7 @@ async def get_image_by_prefix(
)
@router.get(
"/config",
response_model=ImageUIConfig,
)
@router.get("/config")
async def get_ui_config(
cfg: Config = Depends(get_config),
) -> ImageUIConfig:

View file

@ -46,20 +46,14 @@ async def get_version() -> str:
return version("ovdashboard-api")
@router.get(
"/config/server",
response_model=ServerUIConfig,
)
@router.get("/config/server")
async def get_server_ui_config(
cfg: Config = Depends(get_config),
) -> ServerUIConfig:
return cfg.server
@router.get(
"/config/logo",
response_model=LogoUIConfig,
)
@router.get("/config/logo")
async def get_logo_ui_config(
cfg: Config = Depends(get_config),
) -> LogoUIConfig:

View file

@ -51,7 +51,6 @@ async def start_router() -> None:
@router.get(
"/list",
response_model=list[str],
responses=_ls.responses,
)
async def list_all_texts(
@ -62,7 +61,6 @@ async def list_all_texts(
@router.get(
"/find/{prefix}",
response_model=list[str],
responses=_fp.responses,
)
async def find_texts_by_prefix(
@ -80,7 +78,6 @@ async def _get_raw_text_by_prefix(
@router.get(
"/get/raw/{prefix}",
response_model=str,
responses=_fpu.responses,
)
async def get_raw_text_by_prefix(
@ -91,7 +88,6 @@ async def get_raw_text_by_prefix(
@router.get(
"/get/html/{prefix}",
response_model=str,
responses=_fpu.responses,
)
async def get_html_by_prefix(

View file

@ -83,10 +83,7 @@ async def get_raw_ticker(
return ticker_content
@router.get(
"/config",
response_model=TickerUIConfig,
)
@router.get("/config")
async def get_ui_config(
cfg: Config = Depends(get_config),
) -> TickerUIConfig: