15 lines
492 B
Python
15 lines
492 B
Python
|
|
from fastapi import APIRouter, Depends
|
||
|
|
|
||
|
|
from app.core.response import success_response
|
||
|
|
from app.core.security import verify_api_token
|
||
|
|
from app.schemas.platform import SwitchControlIn
|
||
|
|
from app.services.platform_service import platform_service
|
||
|
|
|
||
|
|
|
||
|
|
router = APIRouter(prefix="/control", tags=["control"])
|
||
|
|
|
||
|
|
|
||
|
|
@router.post("/switch", dependencies=[Depends(verify_api_token)])
|
||
|
|
def switch_control(payload: SwitchControlIn) -> dict:
|
||
|
|
return success_response(platform_service.switch_control(payload))
|