stocks
This commit is contained in:
53
app/Console/Commands/StructureStocksCommand.php
Normal file
53
app/Console/Commands/StructureStocksCommand.php
Normal 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();
|
||||
}
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,13 +17,37 @@ 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 {
|
||||
public function GetStructures() {
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user