* initial commit
This commit is contained in:
37
src/App/Action/MaintenanceUpcomingAction.php
Normal file
37
src/App/Action/MaintenanceUpcomingAction.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user