feat: Refactor MainController and related tasks to follow Porto architecture

- Moved logic from MainController to dedicated action and task classes.
- Introduced GetMainPageDataAction, GetEducationsDataTask, GetRecentPostsTask, GetUpcomingEventsTask, and GetPageDataTask for better separation of concerns.
- Updated routes to use the new MainController from the Main container.
- Deprecated the old MainController with a clear message for future removal.
- Updated caching mechanisms to use the new task classes.
- Adjusted environment variable access to use config() instead of env() for better practice.
- Added new MainPageResource for structured data response.
- Updated .gitignore to exclude QWEN.md.
- Added Jenkins service to docker-compose for CI/CD integration.
This commit is contained in:
F4ilji
2025-12-16 12:20:01 +05:00
parent f631d12359
commit 2d101dcdda
25 changed files with 307 additions and 279 deletions
+2 -2
View File
@@ -41,7 +41,7 @@ class CreateVkPostJob implements ShouldQueue
$this->videos = $videos;
$this->documents = $documents;
$this->publish_date = $publish_date;
$this->public_id = env('PUBLIC_ID');
$this->public_id = config('services.vk.public_id');
}
public function handle()
@@ -382,7 +382,7 @@ class CreateVkPostJob implements ShouldQueue
// Добавим проверку
if(!isset($album['id'])) return [];
$uploadServer = (new VkAlbumService($vk))->getServerForUploadImages($album['id'], env('PUBLIC_ID'));
$uploadServer = (new VkAlbumService($vk))->getServerForUploadImages($album['id'], config('PUBLIC_ID'));
foreach (array_chunk($images, 4) as $images_slice) {
$images_data = (new VkAlbumService($vk))->uploadImagesToUploadServer($uploadServer['upload_url'], $images_slice);
(new VkAlbumService($vk))->saveImagesToUploadServer(
+2 -2
View File
@@ -32,13 +32,13 @@ class ImportApiDataPost implements ShouldQueue
{
try {
// Получаем первую страницу данных
$response = Http::get(env('TRANSFER_PROXY_URL') . '/api/posts')->object();
$response = Http::get(config('TRANSFER_PROXY_URL') . '/api/posts')->object();
$last_page = $response->last_page;
Log::info('Last page: ' . $last_page);
// Проходим по всем страницам
for ($page = 1; $page <= $last_page; $page++) {
$response = Http::get(env('TRANSFER_PROXY_URL') . "/api/posts?page=$page")->object();
$response = Http::get(config('TRANSFER_PROXY_URL') . "/api/posts?page=$page")->object();
$results = $response->data;
// Обрабатываем каждую запись
+2 -2
View File
@@ -41,7 +41,7 @@ class UpdateVkPostJob implements ShouldQueue
$this->videos = $videos;
$this->documents = $documents;
$this->publish_date = $publish_date;
$this->public_id = env('PUBLIC_ID');
$this->public_id = config('services.vk.public_id');
}
public function handle()
@@ -324,7 +324,7 @@ class UpdateVkPostJob implements ShouldQueue
$vk = new VKApiClient();
$album = (new VkAlbumService($vk))->createAlbum($title);
$uploadServer = (new VkAlbumService($vk))->getServerForUploadImages($album['id'], env('PUBLIC_ID'));
$uploadServer = (new VkAlbumService($vk))->getServerForUploadImages($album['id'], config('PUBLIC_ID'));
foreach (array_chunk($images, 4) as $images_slice) {
$images_data = (new VkAlbumService($vk))->uploadImagesToUploadServer($uploadServer['upload_url'], $images_slice);
(new VkAlbumService($vk))->saveImagesToUploadServer(