fix: Lint fixes of api and repositories
All checks were successful
Backend CI / test (push) Successful in 3m58s
All checks were successful
Backend CI / test (push) Successful in 3m58s
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
"""Socket.IO API endpoints for WebSocket management."""
|
||||
|
||||
from typing import Annotated
|
||||
|
||||
from fastapi import APIRouter, Depends
|
||||
|
||||
from app.core.dependencies import get_current_user
|
||||
@@ -10,7 +12,9 @@ router = APIRouter(prefix="/socket", tags=["socket"])
|
||||
|
||||
|
||||
@router.get("/status")
|
||||
async def get_socket_status(current_user: User = Depends(get_current_user)):
|
||||
async def get_socket_status(
|
||||
current_user: Annotated[User, Depends(get_current_user)],
|
||||
) -> dict[str, int | bool]:
|
||||
"""Get current socket connection status."""
|
||||
connected_users = socket_manager.get_connected_users()
|
||||
|
||||
@@ -25,8 +29,8 @@ async def get_socket_status(current_user: User = Depends(get_current_user)):
|
||||
async def send_message_to_user(
|
||||
target_user_id: int,
|
||||
message: str,
|
||||
current_user: User = Depends(get_current_user),
|
||||
):
|
||||
current_user: Annotated[User, Depends(get_current_user)],
|
||||
) -> dict[str, int | bool | str]:
|
||||
"""Send a message to a specific user via WebSocket."""
|
||||
success = await socket_manager.send_to_user(
|
||||
str(target_user_id),
|
||||
@@ -48,8 +52,8 @@ async def send_message_to_user(
|
||||
@router.post("/broadcast")
|
||||
async def broadcast_message(
|
||||
message: str,
|
||||
current_user: User = Depends(get_current_user),
|
||||
):
|
||||
current_user: Annotated[User, Depends(get_current_user)],
|
||||
) -> dict[str, bool | str]:
|
||||
"""Broadcast a message to all connected users."""
|
||||
await socket_manager.broadcast_to_all(
|
||||
"broadcast_message",
|
||||
|
||||
Reference in New Issue
Block a user