* logger added
* calendar view in maintenance * $year filter support in xlsx and maintenance
This commit is contained in:
34
src/App/Handler/MaintenanceCalendarHandler.php
Normal file
34
src/App/Handler/MaintenanceCalendarHandler.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\MaintenanceManagerService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class MaintenanceCalendarHandler extends CrudHandler
|
||||
{
|
||||
/** @var MaintenanceManagerService */
|
||||
private $maintenanceManagerService;
|
||||
|
||||
public function __construct(MaintenanceManagerService $maintenanceManagerService)
|
||||
{
|
||||
$this->maintenanceManagerService = $maintenanceManagerService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renew auth token
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
* @throws \PHPExcel_Exception
|
||||
* @throws \PHPExcel_Reader_Exception
|
||||
*/
|
||||
public function getList(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$year = (int)$request->getAttribute('year', date("Y"));
|
||||
return new JsonResponse($this->maintenanceManagerService->getCalendarMaintenanceList($year));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user