- 871 test.py: Switch auth from medevio_storage.json to token.txt, update MySQL port to 3306, add hyperlinks to Request_ID column, add better API error handling - sync_open_requests.py: New script to sync doneAt/removedAt/updatedAt from Medevio API to MySQL for requests incorrectly marked as open - check_request.py: Diagnostic script to inspect a single request via API - check_mysql.py: Diagnostic script to inspect a single request in MySQL Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
34 lines
837 B
Python
34 lines
837 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
"""Check one request in MySQL."""
|
|
|
|
import pymysql
|
|
import json
|
|
|
|
DB_CONFIG = {
|
|
"host": "192.168.1.76",
|
|
"port": 3306,
|
|
"user": "root",
|
|
"password": "Vlado9674+",
|
|
"database": "medevio",
|
|
"charset": "utf8mb4",
|
|
"cursorclass": pymysql.cursors.DictCursor,
|
|
}
|
|
|
|
REQUEST_ID = "6b46b5a8-b080-4821-86b0-39adabeec86b"
|
|
|
|
conn = pymysql.connect(**DB_CONFIG)
|
|
with conn.cursor() as cur:
|
|
cur.execute("SELECT * FROM pozadavky WHERE id = %s", (REQUEST_ID,))
|
|
row = cur.fetchone()
|
|
conn.close()
|
|
|
|
if row:
|
|
# Convert datetime objects to strings for JSON serialization
|
|
for k, v in row.items():
|
|
if hasattr(v, 'isoformat'):
|
|
row[k] = v.isoformat()
|
|
print(json.dumps(row, indent=2, ensure_ascii=False, default=str))
|
|
else:
|
|
print(f"Not found: {REQUEST_ID}")
|