-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #669 from Pixilib/GaelO2-dev
Gael o2 dev
- Loading branch information
Showing
13 changed files
with
644 additions
and
523 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ name: 'publish' | |
on: | ||
push: | ||
branches: | ||
- Gaelo2 | ||
- Gaelo2-dev | ||
- GaelO2 | ||
- GaelO2-dev | ||
tags: | ||
- '*' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace App\GaelO\UseCases\GetReadiness; | ||
|
||
use App\GaelO\Exceptions\AbstractGaelOException; | ||
use App\GaelO\Interfaces\Repositories\CountryRepositoryInterface; | ||
use App\GaelO\Services\OrthancService; | ||
use Exception; | ||
|
||
class GetReadiness | ||
{ | ||
|
||
private OrthancService $orthancService; | ||
private CountryRepositoryInterface $countryRepositoryInterface; | ||
|
||
public function __construct(OrthancService $orthancService, CountryRepositoryInterface $countryRepositoryInterface) | ||
{ | ||
$this->orthancService = $orthancService; | ||
$this->countryRepositoryInterface = $countryRepositoryInterface; | ||
} | ||
|
||
public function execute(GetReadinessRequest $getReadinessRequest, GetReadinessResponse $getReadinessResponse) | ||
{ | ||
try { | ||
|
||
$countries = $this->countryRepositoryInterface->getAllCountries(); | ||
|
||
if(sizeof($countries) === 0){ | ||
throw new Exception("Missing countries record"); | ||
} | ||
|
||
$this->orthancService->setOrthancServer(true); | ||
$this->orthancService->getSystem(); | ||
|
||
$this->orthancService->setOrthancServer(false); | ||
$this->orthancService->getSystem(); | ||
|
||
$getReadinessResponse->status = '200'; | ||
$getReadinessResponse->statusText = 'OK'; | ||
|
||
} catch (AbstractGaelOException $e) { | ||
$getReadinessResponse->body = $e->getErrorBody(); | ||
$getReadinessResponse->status = $e->statusCode; | ||
$getReadinessResponse->statusText = $e->statusText; | ||
} catch (Exception $e) { | ||
throw $e; | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
GaelO2/app/GaelO/UseCases/GetReadiness/GetReadinessRequest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace App\GaelO\UseCases\GetReadiness; | ||
|
||
class GetReadinessRequest | ||
{ | ||
} |
10 changes: 10 additions & 0 deletions
10
GaelO2/app/GaelO/UseCases/GetReadiness/GetReadinessResponse.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace App\GaelO\UseCases\GetReadiness; | ||
|
||
class GetReadinessResponse | ||
{ | ||
public $body = null; | ||
public int $status; | ||
public string $statusText; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.