refac: decorator calls
This commit is contained in:
parent
b7292af6ad
commit
e428fea3da
5 changed files with 6 additions and 26 deletions
|
@ -52,7 +52,6 @@ async def start_router() -> None:
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/list",
|
"/list",
|
||||||
response_model=list[str],
|
|
||||||
responses=_ls.responses,
|
responses=_ls.responses,
|
||||||
)
|
)
|
||||||
async def list_all_files(
|
async def list_all_files(
|
||||||
|
@ -63,7 +62,6 @@ async def list_all_files(
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/find/{prefix}",
|
"/find/{prefix}",
|
||||||
response_model=list[str],
|
|
||||||
responses=_fp.responses,
|
responses=_fp.responses,
|
||||||
)
|
)
|
||||||
async def find_files_by_prefix(
|
async def find_files_by_prefix(
|
||||||
|
@ -74,8 +72,8 @@ async def find_files_by_prefix(
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/get/{prefix}",
|
"/get/{prefix}",
|
||||||
response_class=StreamingResponse,
|
|
||||||
responses=_fpu.responses,
|
responses=_fpu.responses,
|
||||||
|
response_class=StreamingResponse,
|
||||||
)
|
)
|
||||||
async def get_file_by_prefix(
|
async def get_file_by_prefix(
|
||||||
prefix: str,
|
prefix: str,
|
||||||
|
|
|
@ -53,7 +53,6 @@ async def start_router() -> None:
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/list",
|
"/list",
|
||||||
response_model=list[str],
|
|
||||||
responses=_ls.responses,
|
responses=_ls.responses,
|
||||||
)
|
)
|
||||||
async def list_all_images(
|
async def list_all_images(
|
||||||
|
@ -64,7 +63,6 @@ async def list_all_images(
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/find/{prefix}",
|
"/find/{prefix}",
|
||||||
response_model=list[str],
|
|
||||||
responses=_fp.responses,
|
responses=_fp.responses,
|
||||||
)
|
)
|
||||||
async def find_images_by_prefix(
|
async def find_images_by_prefix(
|
||||||
|
@ -75,8 +73,8 @@ async def find_images_by_prefix(
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/get/{prefix}",
|
"/get/{prefix}",
|
||||||
response_class=StreamingResponse,
|
|
||||||
responses=_fpu.responses,
|
responses=_fpu.responses,
|
||||||
|
response_class=StreamingResponse,
|
||||||
)
|
)
|
||||||
async def get_image_by_prefix(
|
async def get_image_by_prefix(
|
||||||
prefix: str,
|
prefix: str,
|
||||||
|
@ -97,10 +95,7 @@ async def get_image_by_prefix(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get("/config")
|
||||||
"/config",
|
|
||||||
response_model=ImageUIConfig,
|
|
||||||
)
|
|
||||||
async def get_ui_config(
|
async def get_ui_config(
|
||||||
cfg: Config = Depends(get_config),
|
cfg: Config = Depends(get_config),
|
||||||
) -> ImageUIConfig:
|
) -> ImageUIConfig:
|
||||||
|
|
|
@ -46,20 +46,14 @@ async def get_version() -> str:
|
||||||
return version("ovdashboard-api")
|
return version("ovdashboard-api")
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get("/config/server")
|
||||||
"/config/server",
|
|
||||||
response_model=ServerUIConfig,
|
|
||||||
)
|
|
||||||
async def get_server_ui_config(
|
async def get_server_ui_config(
|
||||||
cfg: Config = Depends(get_config),
|
cfg: Config = Depends(get_config),
|
||||||
) -> ServerUIConfig:
|
) -> ServerUIConfig:
|
||||||
return cfg.server
|
return cfg.server
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get("/config/logo")
|
||||||
"/config/logo",
|
|
||||||
response_model=LogoUIConfig,
|
|
||||||
)
|
|
||||||
async def get_logo_ui_config(
|
async def get_logo_ui_config(
|
||||||
cfg: Config = Depends(get_config),
|
cfg: Config = Depends(get_config),
|
||||||
) -> LogoUIConfig:
|
) -> LogoUIConfig:
|
||||||
|
|
|
@ -51,7 +51,6 @@ async def start_router() -> None:
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/list",
|
"/list",
|
||||||
response_model=list[str],
|
|
||||||
responses=_ls.responses,
|
responses=_ls.responses,
|
||||||
)
|
)
|
||||||
async def list_all_texts(
|
async def list_all_texts(
|
||||||
|
@ -62,7 +61,6 @@ async def list_all_texts(
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/find/{prefix}",
|
"/find/{prefix}",
|
||||||
response_model=list[str],
|
|
||||||
responses=_fp.responses,
|
responses=_fp.responses,
|
||||||
)
|
)
|
||||||
async def find_texts_by_prefix(
|
async def find_texts_by_prefix(
|
||||||
|
@ -80,7 +78,6 @@ async def _get_raw_text_by_prefix(
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/get/raw/{prefix}",
|
"/get/raw/{prefix}",
|
||||||
response_model=str,
|
|
||||||
responses=_fpu.responses,
|
responses=_fpu.responses,
|
||||||
)
|
)
|
||||||
async def get_raw_text_by_prefix(
|
async def get_raw_text_by_prefix(
|
||||||
|
@ -91,7 +88,6 @@ async def get_raw_text_by_prefix(
|
||||||
|
|
||||||
@router.get(
|
@router.get(
|
||||||
"/get/html/{prefix}",
|
"/get/html/{prefix}",
|
||||||
response_model=str,
|
|
||||||
responses=_fpu.responses,
|
responses=_fpu.responses,
|
||||||
)
|
)
|
||||||
async def get_html_by_prefix(
|
async def get_html_by_prefix(
|
||||||
|
|
|
@ -83,10 +83,7 @@ async def get_raw_ticker(
|
||||||
return ticker_content
|
return ticker_content
|
||||||
|
|
||||||
|
|
||||||
@router.get(
|
@router.get("/config")
|
||||||
"/config",
|
|
||||||
response_model=TickerUIConfig,
|
|
||||||
)
|
|
||||||
async def get_ui_config(
|
async def get_ui_config(
|
||||||
cfg: Config = Depends(get_config),
|
cfg: Config = Depends(get_config),
|
||||||
) -> TickerUIConfig:
|
) -> TickerUIConfig:
|
||||||
|
|
Loading…
Reference in a new issue