mirror of
https://github.com/remnawave/python-sdk.git
synced 2026-08-04 06:35:09 +00:00
- Implemented models for nodes usage history including NodeInfoDto, GetUserAccessibleNodesResponse, and usage statistics. - Created subscription-related models such as UserSubscription, SubscriptionInfoData, and various response DTOs for subscription information. - Developed models for subscription settings, templates, and system statistics, enhancing the API's capability to manage and retrieve subscription configurations. - Introduced user management models including CreateUserRequestDto, UpdateUserRequestDto, and various response DTOs for user actions. - Added bulk actions for user updates and statistics tracking, improving the efficiency of user management operations. - Established a base controller for handling API requests and responses, along with decorators for HTTP methods to streamline API interactions. - Included utility functions for serialization using orjson for better performance with Pydantic models.
23 lines
647 B
Python
23 lines
647 B
Python
from typing import Annotated
|
|
|
|
from rapid_api_client.annotations import JsonBody
|
|
|
|
from remnawave.models import GetConfigResponseDto, UpdateConfigResponseDto
|
|
from remnawave.rapid import BaseController, get, put
|
|
|
|
|
|
class XrayConfigController(BaseController):
|
|
@get("/xray", response_class=GetConfigResponseDto)
|
|
async def get_config(
|
|
self,
|
|
) -> GetConfigResponseDto:
|
|
"""Get Xray Config"""
|
|
...
|
|
|
|
@put("/xray", response_class=UpdateConfigResponseDto)
|
|
async def update_config(
|
|
self,
|
|
body: Annotated[dict, JsonBody()],
|
|
) -> UpdateConfigResponseDto:
|
|
"""Update Xray Config"""
|
|
...
|