testing
This commit is contained in:
@@ -69,5 +69,8 @@ class ProcessStructureJob implements ShouldQueue
|
|||||||
$sHelper = new StructureHelper($this->charId, $this->corpId);
|
$sHelper = new StructureHelper($this->charId, $this->corpId);
|
||||||
|
|
||||||
$sHelper->ProcessStructure($this->structure);
|
$sHelper->ProcessStructure($this->structure);
|
||||||
|
|
||||||
|
//After the job is completed, delete the job
|
||||||
|
$this->delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,28 @@ class StructureHelper {
|
|||||||
$this->corpId = $corp;
|
$this->corpId = $corp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function GetStructuresByPage($page) {
|
||||||
|
// Disable all caching by setting the NullCache as the
|
||||||
|
// preferred cache handler. By default, Eseye will use the
|
||||||
|
// FileCache.
|
||||||
|
$configuration = Configuration::getInstance();
|
||||||
|
$configuration->cache = NullCache::class;
|
||||||
|
|
||||||
|
//Setup the esi authentication container
|
||||||
|
$config = config('esi');
|
||||||
|
//Get the refresh token from the database
|
||||||
|
$token = EsiToken::where(['character_id' => $charId])->get(['refresh_token']);
|
||||||
|
$authentication = new EsiAuthentication([
|
||||||
|
'client_id' => $config['client_id'],
|
||||||
|
'secret' => $config['secret'],
|
||||||
|
'refresh_token' => $token[0]->refresh_token,
|
||||||
|
]);
|
||||||
|
//Setup the ESI variable
|
||||||
|
$esi = new Eseye($authentication);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function ProcessStructure($structure) {
|
public function ProcessStructure($structure) {
|
||||||
//Setup the esi authentication container
|
//Setup the esi authentication container
|
||||||
$config = config('esi');
|
$config = config('esi');
|
||||||
@@ -67,32 +89,6 @@ class StructureHelper {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetListOfStructures() {
|
|
||||||
//Setup the esi authentication container
|
|
||||||
$config = config('esi');
|
|
||||||
//Get the refresh token from the database
|
|
||||||
$token = EsiToken::where(['character_id' => $this->charId])->get(['refresh_token']);
|
|
||||||
$authentication = new EsiAuthentication([
|
|
||||||
'client_id' => $config['client_id'],
|
|
||||||
'secret' => $config['secret'],
|
|
||||||
'refresh_token' => $token[0]->refresh_token,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$esi = new Eseye($authentication);
|
|
||||||
|
|
||||||
try {
|
|
||||||
$structures = $esi->page($this->page)
|
|
||||||
->invoke('get', '/corporations/{corporation_id}/structures/', [
|
|
||||||
'corporation_id' => $this->corpId,
|
|
||||||
]);
|
|
||||||
} catch (RequestFailedException $e) {
|
|
||||||
Log::critical("Failed to get structure list.");
|
|
||||||
$structures = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $structures;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function GetSolarSystemName($systemId) {
|
private function GetSolarSystemName($systemId) {
|
||||||
//Setup the esi authentication container
|
//Setup the esi authentication container
|
||||||
$config = config('esi');
|
$config = config('esi');
|
||||||
|
|||||||
Reference in New Issue
Block a user