Update: 2026-07-02 05:27:04
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* get_hotzones.php
|
||||
* ───────────────
|
||||
* واجهة فائقة السرعة (Ultra-Fast API) مخصصة لتطبيق السائق (Flutter).
|
||||
* تقرأ المناطق الساخنة (Hot Zones) التي حددها الذكاء الاصطناعي من الـ Redis مباشرة.
|
||||
* زمن الاستجابة: O(1).
|
||||
*/
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
require_once __DIR__ . '/../../connect.php';
|
||||
|
||||
$countryCode = strtoupper(filterRequest('country_code') ?? 'JO');
|
||||
|
||||
try {
|
||||
$redis = getRedisConnection();
|
||||
$hotZonesJson = $redis->get('siro:cache:ai:hotzones');
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(["status" => "error", "message" => "Redis connection failed"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$hotZonesJson) {
|
||||
echo json_encode(["status" => "success", "data" => [], "message" => "No hot zones available"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
// الـ JSON القادم من Redis تم تصميمه بالفعل بالشكل النهائي المطلوب للتطبيق
|
||||
echo $hotZonesJson;
|
||||
?>
|
||||
Reference in New Issue
Block a user