Update: 2026-05-08 04:58:23
This commit is contained in:
@@ -82,6 +82,39 @@ $routes = [
|
||||
'v1/voice/transcribe' => ['POST', 'voice/transcribe.php'],
|
||||
'v1/voice/parse-intent' => ['POST', 'voice/parse_intent.php'],
|
||||
'v1/voice/parse-intent-grok' => ['POST', 'voice/grok_intent.php'],
|
||||
|
||||
// Referral System
|
||||
'v1/referral/apply' => ['POST', 'referral/apply.php'],
|
||||
|
||||
// AI Reports
|
||||
'v1/reports/company-health' => ['GET', 'reports/company_health.php'],
|
||||
|
||||
// Payment Upload
|
||||
'v1/payments/upload-receipt' => ['POST', 'payments/upload_receipt.php'],
|
||||
|
||||
// WhatsApp Bot
|
||||
'v1/whatsapp/webhook' => ['POST', 'whatsapp/webhook.php'],
|
||||
'v1/whatsapp/link-code' => ['GET', 'whatsapp/link_code.php'],
|
||||
|
||||
// Gamification
|
||||
'v1/gamification/profile' => ['GET', 'gamification/profile.php'],
|
||||
|
||||
// AI Chatbot
|
||||
'v1/chatbot/ask' => ['POST', 'chatbot/ask.php'],
|
||||
'v1/chatbot/history' => ['GET', 'chatbot/history.php'],
|
||||
|
||||
// Academy
|
||||
'v1/academy/articles' => ['GET', 'academy/articles.php'],
|
||||
|
||||
// Excel Import (was missing!)
|
||||
'v1/excel/import' => ['POST', 'excel/import.php'],
|
||||
|
||||
// SMS Bank Integration
|
||||
'v1/sms/receive' => ['POST', 'sms/receive.php'],
|
||||
|
||||
// Marketplace
|
||||
'v1/marketplace/listings' => ['GET', 'marketplace/listings.php'],
|
||||
'v1/marketplace/my-listing' => ['POST', 'marketplace/my_listing.php'],
|
||||
];
|
||||
|
||||
if (isset($routes[$route])) {
|
||||
@@ -97,11 +130,12 @@ if (isset($routes[$route])) {
|
||||
if (file_exists($file)) {
|
||||
require_once $file;
|
||||
} else {
|
||||
json_error("Endpoint file missing: {$route}", 500);
|
||||
error_log("Router: Missing module file for route '{$route}': {$moduleFile}");
|
||||
json_error('خدمة غير متوفرة حالياً', 500);
|
||||
}
|
||||
} else {
|
||||
if (str_starts_with($route, 'v1/')) {
|
||||
json_error("Not Found: {$route}", 404);
|
||||
json_error('المسار المطلوب غير موجود', 404);
|
||||
} else {
|
||||
include __DIR__ . '/shell.php';
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user