This commit is contained in:
2019-05-27 00:11:36 -05:00
parent 852f6610f8
commit 29d5595ec8
4 changed files with 103 additions and 4 deletions

View File

@@ -0,0 +1,53 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use DB;
use Commands\Library\CommandHelper;
use App\Models\ScheduledTask\ScheduleJob;
class StructureStocksCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'services:StationStocks';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Get the alliance stocks which are for sale from esi.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//Create the command helper container
$task = new CommandHelper('StationStocks');
//Add the entry into the jobs table saying the job is starting
$task->SetStartStatus();
//Mark the job as finished
$task->SetStopStatus();
}
}

View File

@@ -6,5 +6,24 @@ use Illuminate\Http\Request;
class StockController extends Controller
{
//
public function __construct() {
$this->middleware('auth');
$this->middleware('role:User');
}
public function displayStock() {
}
public function displayStation($stationId) {
}
public function displayStockForm() {
}
public function processStockForm(Request $request) {
}
}

View File

@@ -19,7 +19,7 @@ class ProcessStocksJob implements ShouldQueue
*/
public function __construct()
{
//
$this->connection = 'redis';
}
/**
@@ -29,6 +29,9 @@ class ProcessStocksJob implements ShouldQueue
*/
public function handle()
{
//
//Delcare the class variable we need for processing
$stock = new StructureStockHelper;
}
}

View File

@@ -17,12 +17,36 @@ use App\Jobs\ProcessStocksJob;
//Library
use App\Library\Esi\Esi;
use Seat\Eseye\Cache\NullCache;
use Seat\Eseye\Configuration;
use Seat\Eseye\Containers\EsiAuthentication;
use Seat\Eseye\Eseye;
//Models
use App\Models\Stock\StructureStock;
class StructureStockHelper {
private $scopeCheck;
public function __construct() {
$esi = new Esi();
$assetScope = $esi->HaveEsiScope($charId, 'esi-assets.read_corporation_assets.v1');
$structureScope = $esi->HaveEsiScope($charId, 'esi-universe.read_structurs.v1');
if($assetScope == false || $structureScope == false) {
$scopeCheck = false;
} else {
$scopeCheck = true;
}
}
public function GetStructures() {
if($this->scopeCheck == false) {
return null;
}
}
}