diff --git a/zyrarbot/web/__init__.py b/zyrarbot/web/__init__.py new file mode 100644 index 0000000..9ae3d90 --- /dev/null +++ b/zyrarbot/web/__init__.py @@ -0,0 +1 @@ +"""Panel webowy: FastAPI, WebSocket i modele żądań.""" diff --git a/zyrarbot/web/schemas/__init__.py b/zyrarbot/web/schemas/__init__.py new file mode 100644 index 0000000..c591192 --- /dev/null +++ b/zyrarbot/web/schemas/__init__.py @@ -0,0 +1 @@ +"""Modele żądań przyjmowanych przez API - jeden model na plik.""" diff --git a/zyrarbot/web/schemas/connect_request.py b/zyrarbot/web/schemas/connect_request.py new file mode 100644 index 0000000..312722c --- /dev/null +++ b/zyrarbot/web/schemas/connect_request.py @@ -0,0 +1,7 @@ +from pydantic import BaseModel + + +class ConnectRequest(BaseModel): + """Podłączenie bota do kanału głosowego.""" + + channel_id: str diff --git a/zyrarbot/web/schemas/default_plays_request.py b/zyrarbot/web/schemas/default_plays_request.py new file mode 100644 index 0000000..b0c4f19 --- /dev/null +++ b/zyrarbot/web/schemas/default_plays_request.py @@ -0,0 +1,7 @@ +from pydantic import BaseModel + + +class DefaultPlaysRequest(BaseModel): + """Domyślna liczba odtworzeń przypisywana nowym utworom.""" + + default_plays: int diff --git a/zyrarbot/web/schemas/jump_request.py b/zyrarbot/web/schemas/jump_request.py new file mode 100644 index 0000000..d91a7a0 --- /dev/null +++ b/zyrarbot/web/schemas/jump_request.py @@ -0,0 +1,7 @@ +from pydantic import BaseModel + + +class JumpRequest(BaseModel): + """Przeskok do wskazanej pozycji w kolejce.""" + + index: int diff --git a/zyrarbot/web/schemas/loop_request.py b/zyrarbot/web/schemas/loop_request.py new file mode 100644 index 0000000..ec478b5 --- /dev/null +++ b/zyrarbot/web/schemas/loop_request.py @@ -0,0 +1,7 @@ +from pydantic import BaseModel + + +class LoopRequest(BaseModel): + """Włączenie lub wyłączenie zapętlania pojedynczego utworu.""" + + loop: bool diff --git a/zyrarbot/web/schemas/play_file_request.py b/zyrarbot/web/schemas/play_file_request.py new file mode 100644 index 0000000..c93cfeb --- /dev/null +++ b/zyrarbot/web/schemas/play_file_request.py @@ -0,0 +1,7 @@ +from pydantic import BaseModel + + +class PlayFileRequest(BaseModel): + """Dodanie do kolejki pliku z serwerowej bazy plików.""" + + filename: str diff --git a/zyrarbot/web/schemas/play_request.py b/zyrarbot/web/schemas/play_request.py new file mode 100644 index 0000000..dafe0f7 --- /dev/null +++ b/zyrarbot/web/schemas/play_request.py @@ -0,0 +1,7 @@ +from pydantic import BaseModel + + +class PlayRequest(BaseModel): + """Dodanie utworu do kolejki na podstawie linku lub frazy wyszukiwania.""" + + query: str diff --git a/zyrarbot/web/schemas/remove_request.py b/zyrarbot/web/schemas/remove_request.py new file mode 100644 index 0000000..90be73b --- /dev/null +++ b/zyrarbot/web/schemas/remove_request.py @@ -0,0 +1,7 @@ +from pydantic import BaseModel + + +class RemoveRequest(BaseModel): + """Usunięcie utworu z kolejki po jego identyfikatorze.""" + + id: str diff --git a/zyrarbot/web/schemas/reorder_request.py b/zyrarbot/web/schemas/reorder_request.py new file mode 100644 index 0000000..3e919ba --- /dev/null +++ b/zyrarbot/web/schemas/reorder_request.py @@ -0,0 +1,7 @@ +from pydantic import BaseModel + + +class ReorderRequest(BaseModel): + """Nowa kolejność utworów wyrażona listą identyfikatorów.""" + + queue_ids: list[str] diff --git a/zyrarbot/web/schemas/text_channel_request.py b/zyrarbot/web/schemas/text_channel_request.py new file mode 100644 index 0000000..9ee51db --- /dev/null +++ b/zyrarbot/web/schemas/text_channel_request.py @@ -0,0 +1,8 @@ +from pydantic import BaseModel + + +class TextChannelRequest(BaseModel): + """Ustawienie kanału powiadomień; puste ``channel_id`` czyści ustawienie.""" + + channel_id: str + guild_id: str | None = None diff --git a/zyrarbot/web/schemas/track_plays_request.py b/zyrarbot/web/schemas/track_plays_request.py new file mode 100644 index 0000000..f9c5c70 --- /dev/null +++ b/zyrarbot/web/schemas/track_plays_request.py @@ -0,0 +1,8 @@ +from pydantic import BaseModel + + +class TrackPlaysRequest(BaseModel): + """Zmiana pozostałej liczby odtworzeń konkretnego utworu w kolejce.""" + + id: str + plays: int diff --git a/zyrarbot/web/schemas/volume_request.py b/zyrarbot/web/schemas/volume_request.py new file mode 100644 index 0000000..1b840fc --- /dev/null +++ b/zyrarbot/web/schemas/volume_request.py @@ -0,0 +1,7 @@ +from pydantic import BaseModel + + +class VolumeRequest(BaseModel): + """Zmiana głośności odtwarzacza w skali 0-100.""" + + volume: int