mirror of
https://github.com/remnawave/python-sdk.git
synced 2026-08-27 03:42:04 +00:00
feat: обновить версию SDK до 2.1.7, добавить контроллер подписок и новые модели для работы с подписками
This commit is contained in:
parent
f9d9af7f27
commit
5f04c2eca9
8 changed files with 65 additions and 4 deletions
46
remnawave/controllers/subscriptions_controller.py
Normal file
46
remnawave/controllers/subscriptions_controller.py
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
from typing import Annotated
|
||||
|
||||
from rapid_api_client import Path, Query
|
||||
|
||||
from remnawave.enums import ClientType
|
||||
from remnawave.rapid import BaseController, get
|
||||
from remnawave.models import GetAllSubscriptionsResponseDto, GetSubscriptionByUsernameResponseDto, GetSubscriptionByShortUUIDResponseDto, GetSubscriptionByUUIDResponseDto
|
||||
|
||||
|
||||
class SubscriptionsController(BaseController):
|
||||
@get("/subscriptions", response_class=GetAllSubscriptionsResponseDto)
|
||||
async def get_all_subscriptions(
|
||||
self,
|
||||
start: Annotated[
|
||||
int, Query(default=0, ge=0, description="Index to start pagination from")
|
||||
],
|
||||
size: Annotated[
|
||||
int, Query(default=25, ge=1, description="Number of users per page")
|
||||
],
|
||||
) -> GetAllSubscriptionsResponseDto:
|
||||
"""None"""
|
||||
...
|
||||
|
||||
@get("/subscriptions/by-username/{username}", response_class=GetSubscriptionByUsernameResponseDto)
|
||||
async def get_subscription_by_username(
|
||||
self,
|
||||
username: Annotated[str, Path(description="Username of the user")],
|
||||
) -> GetSubscriptionByUsernameResponseDto:
|
||||
"""None"""
|
||||
...
|
||||
|
||||
@get("/subscriptions/by-short-uuid/{short_uuid}", response_class=GetSubscriptionByShortUUIDResponseDto)
|
||||
async def get_subscription_by_short_uuid(
|
||||
self,
|
||||
short_uuid: Annotated[str, Path(description="Short UUID of the subscription")],
|
||||
) -> GetSubscriptionByShortUUIDResponseDto:
|
||||
"""None"""
|
||||
...
|
||||
|
||||
@get("/subscriptions/by-uuid/{uuid}", response_class=GetSubscriptionByUUIDResponseDto)
|
||||
async def get_subscription_by_uuid(
|
||||
self,
|
||||
uuid: Annotated[str, Path(description="UUID of the user")],
|
||||
) -> GetSubscriptionByUUIDResponseDto:
|
||||
"""None"""
|
||||
...
|
||||
Loading…
Add table
Add a link
Reference in a new issue