From 88f8a729893531a936c9b4ea2eedf6dd378ef786 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Tue, 25 Mar 2025 13:43:29 +0000 Subject: [PATCH] feat: Update endpoint whatsapp --- endpoints/whatsapp.get.py | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/endpoints/whatsapp.get.py b/endpoints/whatsapp.get.py index 80e3558..8250ae2 100644 --- a/endpoints/whatsapp.get.py +++ b/endpoints/whatsapp.get.py @@ -1,30 +1,24 @@ from fastapi import APIRouter +import random router = APIRouter() -migrations = [ - { - "id": "001", - "name": "initial_schema", - "status": "completed", - "timestamp": "2024-01-01T00:00:00Z" - }, - { - "id": "002", - "name": "add_user_table", - "status": "completed", - "timestamp": "2024-01-02T00:00:00Z" - } +messages = [ + "Hey there! I am using WhatsApp", + "Available", + "In a meeting", + "At work", + "Battery about to die", + "Can't talk WhatsApp only", + "Urgent calls only", + "Sleeping" ] @router.get("/whatsapp") -async def get_migrations(): - """Get database migration history""" +async def whatsapp_status(): + """Get random WhatsApp status""" return { - "message": "Migration history retrieved", - "migrations": migrations, - "status": { - "total": len(migrations), - "completed": len([m for m in migrations if m["status"] == "completed"]) - } + "message": random.choice(messages), + "method": "GET", + "_verb": "get" } \ No newline at end of file