feat: Update endpoint whatsapp

This commit is contained in:
Backend IM Bot 2025-03-25 13:43:29 +00:00
parent 71322ecf22
commit 88f8a72989

View File

@ -1,30 +1,24 @@
from fastapi import APIRouter from fastapi import APIRouter
import random
router = APIRouter() router = APIRouter()
migrations = [ messages = [
{ "Hey there! I am using WhatsApp",
"id": "001", "Available",
"name": "initial_schema", "In a meeting",
"status": "completed", "At work",
"timestamp": "2024-01-01T00:00:00Z" "Battery about to die",
}, "Can't talk WhatsApp only",
{ "Urgent calls only",
"id": "002", "Sleeping"
"name": "add_user_table",
"status": "completed",
"timestamp": "2024-01-02T00:00:00Z"
}
] ]
@router.get("/whatsapp") @router.get("/whatsapp")
async def get_migrations(): async def whatsapp_status():
"""Get database migration history""" """Get random WhatsApp status"""
return { return {
"message": "Migration history retrieved", "message": random.choice(messages),
"migrations": migrations, "method": "GET",
"status": { "_verb": "get"
"total": len(migrations),
"completed": len([m for m in migrations if m["status"] == "completed"])
}
} }