* kanban service and stuff
This commit is contained in:
40
src/App/Handler/KanbanHandler.php
Normal file
40
src/App/Handler/KanbanHandler.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Handler;
|
||||
|
||||
use App\Entity\KanbanBoard;
|
||||
use App\Service\JiraCollectorService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Server\RequestHandlerInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class KanbanHandler implements RequestHandlerInterface
|
||||
{
|
||||
/** @var JiraCollectorService */
|
||||
private $dataCollector;
|
||||
|
||||
/**
|
||||
* KanbanAction constructor.
|
||||
* @param JiraCollectorService $dataCollectorService
|
||||
*/
|
||||
public function __construct(JiraCollectorService $dataCollectorService)
|
||||
{
|
||||
$this->dataCollector = $dataCollectorService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
* @todo filterId
|
||||
*/
|
||||
public function handle(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$filterId = $request->getAttribute('filterId');
|
||||
/** @var KanbanBoard $kanbanResult */
|
||||
$kanbanResult = $this->dataCollector->getKanbanBoard($filterId);
|
||||
return new JsonResponse($kanbanResult);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user