From 3915f61cfb41e15d961893ea5efd6dff3262048f Mon Sep 17 00:00:00 2001 From: Iam54r1n4 Date: Sat, 8 Feb 2025 01:03:30 +0000 Subject: [PATCH] Rename endpoints function name --- core/scripts/webpanel/routers/api/v1/config/ip.py | 4 ++-- core/scripts/webpanel/routers/api/v1/config/normalsub.py | 4 ++-- core/scripts/webpanel/routers/api/v1/config/singbox.py | 4 ++-- core/scripts/webpanel/routers/api/v1/config/telegram.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/scripts/webpanel/routers/api/v1/config/ip.py b/core/scripts/webpanel/routers/api/v1/config/ip.py index 497a788..0e56cbb 100644 --- a/core/scripts/webpanel/routers/api/v1/config/ip.py +++ b/core/scripts/webpanel/routers/api/v1/config/ip.py @@ -9,7 +9,7 @@ router = APIRouter() @router.get('/add') -async def add(): +async def add_ip_api(): try: cli_api.add_ip_address() return DetailResponse(detail='IP addresses added successfully.') @@ -18,7 +18,7 @@ async def add(): @router.post('/edit', response_model=DetailResponse) -async def edit(body: EditInputBody): +async def edit_ip_api(body: EditInputBody): try: if not body.ipv4 and not body.ipv6: raise HTTPException(status_code=400, detail='Error: You must specify either ipv4 or ipv6') diff --git a/core/scripts/webpanel/routers/api/v1/config/normalsub.py b/core/scripts/webpanel/routers/api/v1/config/normalsub.py index bb39ea2..93e933f 100644 --- a/core/scripts/webpanel/routers/api/v1/config/normalsub.py +++ b/core/scripts/webpanel/routers/api/v1/config/normalsub.py @@ -7,7 +7,7 @@ router = APIRouter() @router.post('/start', response_model=DetailResponse, summary='Start NormalSub') -async def start(body: StartInputBody): +async def normal_sub_start_api(body: StartInputBody): """ Starts the NormalSub service using the provided domain and port. @@ -32,7 +32,7 @@ async def start(body: StartInputBody): @router.delete('/stop', response_model=DetailResponse, summary='Stop NormalSub') -async def stop(): +async def normal_sub_stop_api(): """ Stops the NormalSub service. diff --git a/core/scripts/webpanel/routers/api/v1/config/singbox.py b/core/scripts/webpanel/routers/api/v1/config/singbox.py index e4bf66c..5d93934 100644 --- a/core/scripts/webpanel/routers/api/v1/config/singbox.py +++ b/core/scripts/webpanel/routers/api/v1/config/singbox.py @@ -7,7 +7,7 @@ router = APIRouter() @router.post('/start', response_model=DetailResponse, summary='Start Singbox') -async def start(body: StartInputBody): +async def singbox_start_api(body: StartInputBody): """ Start the Singbox service. @@ -27,7 +27,7 @@ async def start(body: StartInputBody): @router.delete('/stop', response_model=DetailResponse, summary='Stop Singbox') -async def stop(): +async def singbox_stop_api(): """ Stop the Singbox service. diff --git a/core/scripts/webpanel/routers/api/v1/config/telegram.py b/core/scripts/webpanel/routers/api/v1/config/telegram.py index 4e6cde9..a504187 100644 --- a/core/scripts/webpanel/routers/api/v1/config/telegram.py +++ b/core/scripts/webpanel/routers/api/v1/config/telegram.py @@ -7,7 +7,7 @@ router = APIRouter() @router.post('/start', response_model=DetailResponse, summary='Start Telegram Bot') -async def start(body: StartInputBody): +async def telegram_start_api(body: StartInputBody): """ Starts the Telegram bot. @@ -25,7 +25,7 @@ async def start(body: StartInputBody): @router.delete('/stop', response_model=DetailResponse, summary='Stop Telegram Bot') -async def stop(): +async def telegram_stop_api(): """ Stops the Telegram bot.