Rename endpoints function name
This commit is contained in:
@ -9,7 +9,7 @@ router = APIRouter()
|
|||||||
|
|
||||||
|
|
||||||
@router.get('/add')
|
@router.get('/add')
|
||||||
async def add():
|
async def add_ip_api():
|
||||||
try:
|
try:
|
||||||
cli_api.add_ip_address()
|
cli_api.add_ip_address()
|
||||||
return DetailResponse(detail='IP addresses added successfully.')
|
return DetailResponse(detail='IP addresses added successfully.')
|
||||||
@ -18,7 +18,7 @@ async def add():
|
|||||||
|
|
||||||
|
|
||||||
@router.post('/edit', response_model=DetailResponse)
|
@router.post('/edit', response_model=DetailResponse)
|
||||||
async def edit(body: EditInputBody):
|
async def edit_ip_api(body: EditInputBody):
|
||||||
try:
|
try:
|
||||||
if not body.ipv4 and not body.ipv6:
|
if not body.ipv4 and not body.ipv6:
|
||||||
raise HTTPException(status_code=400, detail='Error: You must specify either ipv4 or ipv6')
|
raise HTTPException(status_code=400, detail='Error: You must specify either ipv4 or ipv6')
|
||||||
|
|||||||
@ -7,7 +7,7 @@ router = APIRouter()
|
|||||||
|
|
||||||
|
|
||||||
@router.post('/start', response_model=DetailResponse, summary='Start NormalSub')
|
@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.
|
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')
|
@router.delete('/stop', response_model=DetailResponse, summary='Stop NormalSub')
|
||||||
async def stop():
|
async def normal_sub_stop_api():
|
||||||
"""
|
"""
|
||||||
Stops the NormalSub service.
|
Stops the NormalSub service.
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ router = APIRouter()
|
|||||||
|
|
||||||
|
|
||||||
@router.post('/start', response_model=DetailResponse, summary='Start Singbox')
|
@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.
|
Start the Singbox service.
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ async def start(body: StartInputBody):
|
|||||||
|
|
||||||
|
|
||||||
@router.delete('/stop', response_model=DetailResponse, summary='Stop Singbox')
|
@router.delete('/stop', response_model=DetailResponse, summary='Stop Singbox')
|
||||||
async def stop():
|
async def singbox_stop_api():
|
||||||
"""
|
"""
|
||||||
Stop the Singbox service.
|
Stop the Singbox service.
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ router = APIRouter()
|
|||||||
|
|
||||||
|
|
||||||
@router.post('/start', response_model=DetailResponse, summary='Start Telegram Bot')
|
@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.
|
Starts the Telegram bot.
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ async def start(body: StartInputBody):
|
|||||||
|
|
||||||
|
|
||||||
@router.delete('/stop', response_model=DetailResponse, summary='Stop Telegram Bot')
|
@router.delete('/stop', response_model=DetailResponse, summary='Stop Telegram Bot')
|
||||||
async def stop():
|
async def telegram_stop_api():
|
||||||
"""
|
"""
|
||||||
Stops the Telegram bot.
|
Stops the Telegram bot.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user