feat: new endpoints for users and updated models

This commit is contained in:
2025-07-18 02:58:22 +05:00
parent 733977f56e
commit 2e59d03784
10 changed files with 351 additions and 1 deletions

21
app/api/server.py Normal file
View File

@ -0,0 +1,21 @@
from fastapi import APIRouter
from app.services.server.command import CommandService
from app.services.server.event import EventService
from app.models.server.command import ServerCommand
router = APIRouter(
prefix="/api/server",
tags=["Server Management"]
)
@router.post("/events")
async def receive_server_event(event_data: dict):
return await EventService().process_event(event_data)
@router.post("/commands")
async def add_server_command(command_data: ServerCommand):
return await CommandService().add_command(command_data)
@router.get("/commands")
async def get_server_commands(server_ip: str):
return await CommandService().get_commands(server_ip)