feat: Update endpoint whatsapp
This commit is contained in:
parent
71322ecf22
commit
88f8a72989
@ -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"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user