created get public contracts command

This commit is contained in:
2020-05-15 03:36:13 -05:00
parent 7abd2dece9
commit 77a6e6b688
3 changed files with 28 additions and 7 deletions

View File

@@ -11,14 +11,14 @@ class GetMarketDataCommand extends Command
*
* @var string
*/
protected $signature = 'command:name';
protected $signature = 'services:MarketData';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
protected $description = 'Get the market data for regions';
/**
* Create a new command instance.

View File

@@ -11,14 +11,14 @@ class PublicContractsCommand extends Command
*
* @var string
*/
protected $signature = 'command:name';
protected $signature = 'services:PublicContracts';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
protected $description = 'Get the public contracts in a region';
/**
* Create a new command instance.
@@ -37,6 +37,21 @@ class PublicContractsCommand extends Command
*/
public function handle()
{
//
$regions = [
'Immensea' => 10000025,
'Catch' => 10000014,
'Tenerifis' => 10000061,
'The Forge' => 10000002,
'Impass' => 10000031,
'Esoteria' => 10000039,
'Detorid' => 10000005,
'Omist' => 10000062,
'Feythabolis' => 10000056,
'Insmother' => 10000009,
];
foreach($regions as $key => $value) {
PublicContractsJob::dispatch($value);
}
}
}

View File

@@ -34,9 +34,15 @@ class GetPublicContractsJob implements ShouldQueue
*
* @return void
*/
public function __construct($esi, $regionId)
public function __construct($regionId, $esi = null)
{
//Setup the esi authentication container
if($esi == null) {
$this->esi = new Esi();
} else {
$this->esi = $esi;
}
//Set the region code
$this->region = $regionId;
}