first commit

This commit is contained in:
ExtraNetwork
2026-05-12 17:04:54 +03:00
commit e5c4b6aa13
1425 changed files with 284735 additions and 0 deletions

26
app/Jobs/ExampleJob.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
namespace App\Jobs;
class ExampleJob extends Job
{
/**
* Create a new job instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
//
}
}

24
app/Jobs/Job.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
abstract class Job implements ShouldQueue
{
/*
|--------------------------------------------------------------------------
| Queueable Jobs
|--------------------------------------------------------------------------
|
| This job base class provides a central location to place any logic that
| is shared across all of your jobs. The trait included with the class
| provides access to the "queueOn" and "delay" queue helper methods.
|
*/
use InteractsWithQueue, Queueable, SerializesModels;
}

View File

@@ -0,0 +1,37 @@
<?php
namespace App\Jobs;
use Illuminate\Support\Facades\Artisan;
class PropertyCatalogServiceJob extends Job
{
protected $propertyId;
protected $language;
protected $email;
/**
* Create a new job instance.
*/
public function __construct($propertyId, $language, $email = null)
{
$this->propertyId = $propertyId;
$this->language = $language;
$this->email = $email;
}
/**
* Execute the job.
*/
public function handle()
{
chdir(base_path());
Artisan::call('cron:property-catalog-service', [
'property_id' => $this->propertyId,
'language' => $this->language,
'--email' => $this->email,
]);
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Jobs;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Facades\Artisan;
class PropertyReviewAnalyzeServiceJob implements ShouldQueue
{
use InteractsWithQueue;
protected $reviewId;
/**
* Create a new job instance.
*/
public function __construct($reviewId)
{
$this->reviewId = $reviewId;
}
/**
* Execute the job.
*/
public function handle()
{
Artisan::call('cron:property-review-analyze-service', [
'review_id' => $this->reviewId,
]);
}
}

View File

@@ -0,0 +1,35 @@
<?php
namespace App\Jobs;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Facades\Artisan;
class PropertyReviewServiceJob implements ShouldQueue
{
use InteractsWithQueue;
protected $propertyId;
protected $channelId;
/**
* Create a new job instance.
*/
public function __construct($propertyId, $channelId)
{
$this->propertyId = $propertyId;
$this->channelId = $channelId;
}
/**
* Execute the job.
*/
public function handle()
{
Artisan::call('cron:property-review-service', [
'property_id' => $this->propertyId,
'channel_id' => $this->channelId
]);
}
}

52
app/Jobs/SlackLogJob.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
namespace App\Jobs;
use App\Exceptions\ApiErrorException;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
use Log;
use Exception;
class SlackLogJob extends Job
{
protected $slack;
public $tries = 1;
public $timeout = 60;
public function __construct($slack)
{
$this->slack = $slack;
}
public function handle()
{
try {
$client = new Client();
$client->request('POST', config('app.log_slack'),
[
'headers' => [
'Content-Type' => 'application/json'
],
'body' => json_encode($this->slack),
]);
} catch (Exception $e) {
$message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
Log::error('--SlackLogJob RequestException--');
Log::error($message);
} catch (RequestException $e) {
$message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
Log::error('--SlackLogJob RequestException--');
Log::error($message);
} catch (ApiErrorException $e) {
$message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
Log::error('--SlackLogJob ApiErrorException--');
Log::error($message);
}
}
}