feat(cronjob): implement CronJobProcessor and CronJobRepository for job scheduling and processing
- Added CronJobProcessor class to handle job creation and queue processing. - Implemented CronJobRepository for database interactions related to cron jobs. - Introduced CronJobType class to define job types, priorities, and statuses. - Created ApiloLogger for logging actions related to job processing. - Initialized apilo-sync-queue.json for job queue management.
This commit is contained in:
@@ -46,7 +46,7 @@ class ApiRouter
|
||||
}
|
||||
|
||||
$controller->$action();
|
||||
} catch (\Exception $e) {
|
||||
} catch (\Throwable $e) {
|
||||
self::sendError('INTERNAL_ERROR', 'Internal server error', 500);
|
||||
}
|
||||
}
|
||||
@@ -87,18 +87,22 @@ class ApiRouter
|
||||
$settingsRepo = new \Domain\Settings\SettingsRepository($db);
|
||||
$productRepo = new \Domain\Product\ProductRepository($db);
|
||||
$transportRepo = new \Domain\Transport\TransportRepository($db);
|
||||
$service = new \Domain\Order\OrderAdminService($orderRepo, $productRepo, $settingsRepo, $transportRepo);
|
||||
$cronJobRepo = new \Domain\CronJob\CronJobRepository($db);
|
||||
$service = new \Domain\Order\OrderAdminService($orderRepo, $productRepo, $settingsRepo, $transportRepo, $cronJobRepo);
|
||||
return new Controllers\OrdersApiController($service, $orderRepo);
|
||||
},
|
||||
'products' => function () use ($db) {
|
||||
$productRepo = new \Domain\Product\ProductRepository($db);
|
||||
return new Controllers\ProductsApiController($productRepo);
|
||||
$attrRepo = new \Domain\Attribute\AttributeRepository($db);
|
||||
return new Controllers\ProductsApiController($productRepo, $attrRepo);
|
||||
},
|
||||
'dictionaries' => function () use ($db) {
|
||||
$statusRepo = new \Domain\ShopStatus\ShopStatusRepository($db);
|
||||
$transportRepo = new \Domain\Transport\TransportRepository($db);
|
||||
$paymentRepo = new \Domain\PaymentMethod\PaymentMethodRepository($db);
|
||||
return new Controllers\DictionariesApiController($statusRepo, $transportRepo, $paymentRepo);
|
||||
$attrRepo = new \Domain\Attribute\AttributeRepository($db);
|
||||
$producerRepo = new \Domain\Producer\ProducerRepository($db);
|
||||
return new Controllers\DictionariesApiController($statusRepo, $transportRepo, $paymentRepo, $attrRepo, $producerRepo);
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user