38 lines
995 B
PHP
38 lines
995 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Action;
|
||
|
|
|
||
|
|
use App\Response\JsonCorsResponse;
|
||
|
|
use App\Service\MaintenanceManagerService;
|
||
|
|
use Interop\Http\ServerMiddleware\DelegateInterface;
|
||
|
|
use Psr\Http\Message\ServerRequestInterface;
|
||
|
|
|
||
|
|
class MaintenanceUpcomingAction extends AbstractCrudAction
|
||
|
|
{
|
||
|
|
const CORS_ALLOW_METHODS = [
|
||
|
|
'GET',
|
||
|
|
];
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @var MaintenanceManagerService
|
||
|
|
*/
|
||
|
|
private $maintenanceManagerService;
|
||
|
|
|
||
|
|
public function __construct(MaintenanceManagerService $maintenanceManagerService)
|
||
|
|
{
|
||
|
|
$this->maintenanceManagerService = $maintenanceManagerService;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Renew auth token
|
||
|
|
*
|
||
|
|
* @param ServerRequestInterface $request
|
||
|
|
* @param DelegateInterface $delegate
|
||
|
|
* @return \Zend\Diactoros\Response\JsonResponse
|
||
|
|
*/
|
||
|
|
public function getList(ServerRequestInterface $request, DelegateInterface $delegate)
|
||
|
|
{
|
||
|
|
return new JsonCorsResponse($this->maintenanceManagerService->getUpcomingMaintenanceList()->getValues());
|
||
|
|
}
|
||
|
|
}
|