This commit is contained in:
2025-11-02 01:04:31 +03:00
parent 64c984a704
commit 9c58c10152
70 changed files with 341 additions and 391 deletions
+9 -6
View File
@@ -2,16 +2,20 @@ from argenta import Command, Response, Router
router = Router(title="Data Example")
@router.command(Command("set", description="Set data"))
def set_handler(response: Response):
# Обновляем глобальное хранилище данных
response.update_data({
"user_name": "John",
"timestamp": "2024-01-01",
"settings": {"theme": "dark", "language": "ru"}
})
response.update_data(
{
"user_name": "John",
"timestamp": "2024-01-01",
"settings": {"theme": "dark", "language": "ru"},
}
)
print("Data updated successfully")
@router.command(Command("show", description="Show data"))
def show_handler(response: Response):
# Получаем данные из глобального хранилища
@@ -19,4 +23,3 @@ def show_handler(response: Response):
if "user_name" in data:
print(f"User: {data['user_name']}")
print(f"Settings: {data.get('settings', {})}")