* tsp-info parts added
This commit is contained in:
@@ -11,9 +11,15 @@ use App\Service\VacationInfoCollectorService;
|
||||
use Interop\Http\ServerMiddleware\DelegateInterface;
|
||||
use Interop\Http\ServerMiddleware\MiddlewareInterface as ServerMiddlewareInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Config\Config;
|
||||
|
||||
class TspInfoAction implements ServerMiddlewareInterface
|
||||
{
|
||||
/**
|
||||
* @var Config
|
||||
*/
|
||||
private $config;
|
||||
|
||||
/**
|
||||
* @var VacationInfoCollectorService
|
||||
*/
|
||||
@@ -39,12 +45,14 @@ class TspInfoAction implements ServerMiddlewareInterface
|
||||
*/
|
||||
private $jiraCollectorService;
|
||||
|
||||
public function __construct(VacationInfoCollectorService $vacationInfoCollectorService,
|
||||
public function __construct(Config $config,
|
||||
VacationInfoCollectorService $vacationInfoCollectorService,
|
||||
TrInfoCollectorService $trInfoCollectorService,
|
||||
JcatInfoCollectorService $jcatInfoCollectorService,
|
||||
LabInfoCollectorService $labInfoCollectorService,
|
||||
JiraCollectorService $jiraCollectorService)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->vacationInfoCollectorService = $vacationInfoCollectorService;
|
||||
$this->trInfoCollectorService = $trInfoCollectorService;
|
||||
$this->jcatInfoCollectorService = $jcatInfoCollectorService;
|
||||
@@ -56,17 +64,17 @@ class TspInfoAction implements ServerMiddlewareInterface
|
||||
* @param ServerRequestInterface $request
|
||||
* @param DelegateInterface $delegate
|
||||
* @return JsonCorsResponse
|
||||
* @todo lab temperature data
|
||||
*/
|
||||
public function process(ServerRequestInterface $request, DelegateInterface $delegate)
|
||||
{
|
||||
return new JsonCorsResponse([
|
||||
'cameraUrls' => $this->config->get('url.eurestCameras')->toArray(),
|
||||
'animGifs' => [],
|
||||
'praGoals' => $this->trInfoCollectorService->getPraGoals(),
|
||||
'trProgress' => $this->trInfoCollectorService->getProgressInfo(),
|
||||
'trFlow' => $this->jcatInfoCollectorService->getTrFlow(),
|
||||
'trProgressInfo' => $this->trInfoCollectorService->getProgressInfo(),
|
||||
'trFlowErrors' => $this->jcatInfoCollectorService->getTrFlowErrors(),
|
||||
'expedites' => $this->jiraCollectorService->getExpedites(),
|
||||
'vacationInfo' => $this->vacationInfoCollectorService->isVacationSoon(),
|
||||
'isVacationSoon' => $this->vacationInfoCollectorService->isVacationSoon(),
|
||||
'labTemperature' => $this->labInfoCollectorService->getLabTemperatureData(),
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user