* tspInfoService added
* caching is now enadbled on api endpoints * cli task created for cache renewal
This commit is contained in:
parent
d10ebb4931
commit
0b7f357c29
@ -5,11 +5,13 @@ return [
|
|||||||
'invokables' => [],
|
'invokables' => [],
|
||||||
'factories' => [
|
'factories' => [
|
||||||
App\Command\UpdateLabInfoCommand::class => App\Command\UpdateLabInfoFactory::class,
|
App\Command\UpdateLabInfoCommand::class => App\Command\UpdateLabInfoFactory::class,
|
||||||
|
App\Command\UpdatePageCachesCommand::class => App\Command\UpdatePageCachesFactory::class,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'console' => [
|
'console' => [
|
||||||
'commands' => [
|
'commands' => [
|
||||||
App\Command\UpdateLabInfoCommand::class,
|
App\Command\UpdateLabInfoCommand::class,
|
||||||
|
App\Command\UpdatePageCachesCommand::class,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -7,6 +7,7 @@ use App\Service\JcatInfoCollectorService;
|
|||||||
use App\Service\JiraCollectorService;
|
use App\Service\JiraCollectorService;
|
||||||
use App\Service\LabInfoCollectorService;
|
use App\Service\LabInfoCollectorService;
|
||||||
use App\Service\TrInfoCollectorService;
|
use App\Service\TrInfoCollectorService;
|
||||||
|
use App\Service\TspInfoService;
|
||||||
use App\Service\VacationInfoCollectorService;
|
use App\Service\VacationInfoCollectorService;
|
||||||
use Interop\Http\ServerMiddleware\DelegateInterface;
|
use Interop\Http\ServerMiddleware\DelegateInterface;
|
||||||
use Interop\Http\ServerMiddleware\MiddlewareInterface as ServerMiddlewareInterface;
|
use Interop\Http\ServerMiddleware\MiddlewareInterface as ServerMiddlewareInterface;
|
||||||
@ -16,48 +17,13 @@ use Zend\Config\Config;
|
|||||||
class TspInfoAction implements ServerMiddlewareInterface
|
class TspInfoAction implements ServerMiddlewareInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var Config
|
* @var TspInfoService
|
||||||
*/
|
*/
|
||||||
private $config;
|
private $tspInfoService;
|
||||||
|
|
||||||
/**
|
public function __construct(TspInfoService $tspInfoService)
|
||||||
* @var VacationInfoCollectorService
|
|
||||||
*/
|
|
||||||
private $vacationInfoCollectorService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var TrInfoCollectorService
|
|
||||||
*/
|
|
||||||
private $trInfoCollectorService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var JcatInfoCollectorService
|
|
||||||
*/
|
|
||||||
private $jcatInfoCollectorService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var LabInfoCollectorService
|
|
||||||
*/
|
|
||||||
private $labInfoCollectorService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var JiraCollectorService
|
|
||||||
*/
|
|
||||||
private $jiraCollectorService;
|
|
||||||
|
|
||||||
public function __construct(Config $config,
|
|
||||||
VacationInfoCollectorService $vacationInfoCollectorService,
|
|
||||||
TrInfoCollectorService $trInfoCollectorService,
|
|
||||||
JcatInfoCollectorService $jcatInfoCollectorService,
|
|
||||||
LabInfoCollectorService $labInfoCollectorService,
|
|
||||||
JiraCollectorService $jiraCollectorService)
|
|
||||||
{
|
{
|
||||||
$this->config = $config;
|
$this->tspInfoService = $tspInfoService;
|
||||||
$this->vacationInfoCollectorService = $vacationInfoCollectorService;
|
|
||||||
$this->trInfoCollectorService = $trInfoCollectorService;
|
|
||||||
$this->jcatInfoCollectorService = $jcatInfoCollectorService;
|
|
||||||
$this->labInfoCollectorService = $labInfoCollectorService;
|
|
||||||
$this->jiraCollectorService = $jiraCollectorService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -67,15 +33,6 @@ class TspInfoAction implements ServerMiddlewareInterface
|
|||||||
*/
|
*/
|
||||||
public function process(ServerRequestInterface $request, DelegateInterface $delegate)
|
public function process(ServerRequestInterface $request, DelegateInterface $delegate)
|
||||||
{
|
{
|
||||||
return new JsonCorsResponse([
|
return new JsonCorsResponse($this->tspInfoService->getTspInfo());
|
||||||
'cameraUrls' => $this->config->get('url.eurestCameras')->toArray(),
|
|
||||||
'animGifs' => [],
|
|
||||||
'praGoals' => $this->trInfoCollectorService->getPraGoals(),
|
|
||||||
'trProgressInfo' => $this->trInfoCollectorService->getProgressInfo(),
|
|
||||||
'trFlowErrors' => $this->jcatInfoCollectorService->getTrFlowErrors(),
|
|
||||||
'expedites' => $this->jiraCollectorService->getExpedites(),
|
|
||||||
'isVacationSoon' => $this->vacationInfoCollectorService->isVacationSoon(),
|
|
||||||
'labTemperature' => $this->labInfoCollectorService->getLabTemperatureData(),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ use App\Service\JcatInfoCollectorService;
|
|||||||
use App\Service\JiraCollectorService;
|
use App\Service\JiraCollectorService;
|
||||||
use App\Service\LabInfoCollectorService;
|
use App\Service\LabInfoCollectorService;
|
||||||
use App\Service\TrInfoCollectorService;
|
use App\Service\TrInfoCollectorService;
|
||||||
|
use App\Service\TspInfoService;
|
||||||
use App\Service\VacationInfoCollectorService;
|
use App\Service\VacationInfoCollectorService;
|
||||||
use Interop\Container\ContainerInterface;
|
use Interop\Container\ContainerInterface;
|
||||||
use Zend\Config\Config;
|
use Zend\Config\Config;
|
||||||
@ -14,20 +15,7 @@ class TspInfoFactory
|
|||||||
{
|
{
|
||||||
public function __invoke(ContainerInterface $container)
|
public function __invoke(ContainerInterface $container)
|
||||||
{
|
{
|
||||||
$appConfig = $container->get('config')['app.config'];
|
$tspInfoService = $container->get(TspInfoService::class);
|
||||||
$dataCollectorService = $container->get(VacationInfoCollectorService::class);
|
return new TspInfoAction($tspInfoService);
|
||||||
$trInfoCollectorService = $container->get(TrInfoCollectorService::class);
|
|
||||||
$jcatInfoCollectorService = $container->get(JcatInfoCollectorService::class);
|
|
||||||
$labInfoCollectorService = $container->get(LabInfoCollectorService::class);
|
|
||||||
$jiraInfoCollectorService = $container->get(JiraCollectorService::class);
|
|
||||||
|
|
||||||
return new TspInfoAction(
|
|
||||||
new Config($appConfig),
|
|
||||||
$dataCollectorService,
|
|
||||||
$trInfoCollectorService,
|
|
||||||
$jcatInfoCollectorService,
|
|
||||||
$labInfoCollectorService,
|
|
||||||
$jiraInfoCollectorService
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
42
src/App/Command/UpdatePageCachesCommand.php
Normal file
42
src/App/Command/UpdatePageCachesCommand.php
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Command;
|
||||||
|
|
||||||
|
use App\Service\JiraCollectorService;
|
||||||
|
use App\Service\TspInfoService;
|
||||||
|
use Symfony\Component\Console\Command\Command;
|
||||||
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
|
||||||
|
class UpdatePageCachesCommand extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var TspInfoService
|
||||||
|
*/
|
||||||
|
private $tspInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var JiraCollectorService
|
||||||
|
*/
|
||||||
|
private $jiraCollectorService;
|
||||||
|
|
||||||
|
public function __construct(TspInfoService $tspInfoService,
|
||||||
|
JiraCollectorService $jiraCollectorService)
|
||||||
|
{
|
||||||
|
$this->tspInfoService = $tspInfoService;
|
||||||
|
$this->jiraCollectorService = $jiraCollectorService;
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function configure()
|
||||||
|
{
|
||||||
|
$this->setName('cache:update')
|
||||||
|
->setDescription('Updates page-cache data for tspInfo and kanban pages');
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
|
{
|
||||||
|
$this->tspInfoService->getTspInfo(true);
|
||||||
|
$this->jiraCollectorService->getKanbanBoard(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
34
src/App/Command/UpdatePageCachesFactory.php
Normal file
34
src/App/Command/UpdatePageCachesFactory.php
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Command;
|
||||||
|
|
||||||
|
use App\Action\AvatarAction;
|
||||||
|
use App\Service\JiraCollectorService;
|
||||||
|
use App\Service\TspInfoService;
|
||||||
|
use Interop\Container\ContainerInterface;
|
||||||
|
use Zend\Expressive\Router\Route;
|
||||||
|
use Zend\Expressive\Router\RouterInterface;
|
||||||
|
|
||||||
|
class UpdatePageCachesFactory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param ContainerInterface $container
|
||||||
|
* @return UpdatePageCachesCommand
|
||||||
|
*/
|
||||||
|
public function __invoke(ContainerInterface $container)
|
||||||
|
{
|
||||||
|
$avatarRoute = new Route(
|
||||||
|
'/avatars/{signum}',
|
||||||
|
AvatarAction::class,
|
||||||
|
Route::HTTP_METHOD_ANY,
|
||||||
|
'user.avatar'
|
||||||
|
);
|
||||||
|
/** @var \Zend\Expressive\Router\FastRouteRouter $router */
|
||||||
|
$router = $container->get(RouterInterface::class);
|
||||||
|
$router->addRoute($avatarRoute);
|
||||||
|
|
||||||
|
$tspInfoService = $container->get(TspInfoService::class);
|
||||||
|
$jiraCollectorService = $container->get(JiraCollectorService::class);
|
||||||
|
return new UpdatePageCachesCommand($tspInfoService, $jiraCollectorService);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -54,8 +54,9 @@ class ConfigProvider
|
|||||||
Service\VacationInfoCollectorService::class => Service\VacationInfoCollectorServiceFactory::class,
|
Service\VacationInfoCollectorService::class => Service\VacationInfoCollectorServiceFactory::class,
|
||||||
Service\TrInfoCollectorService::class => Service\TrInfoCollectorServiceFactory::class,
|
Service\TrInfoCollectorService::class => Service\TrInfoCollectorServiceFactory::class,
|
||||||
Service\JcatInfoCollectorService::class => Service\JcatInfoCollectorServiceFactory::class,
|
Service\JcatInfoCollectorService::class => Service\JcatInfoCollectorServiceFactory::class,
|
||||||
|
Service\TspInfoService::class => Service\TspInfoServiceFactory::class,
|
||||||
|
|
||||||
'service.avatarCache' => function(ContainerInterface $container): StorageInterface {
|
'service.cache' => function(ContainerInterface $container): StorageInterface {
|
||||||
$cache = new FilesytemCache();
|
$cache = new FilesytemCache();
|
||||||
$cache->getOptions()
|
$cache->getOptions()
|
||||||
->setFromArray([
|
->setFromArray([
|
||||||
|
|||||||
@ -36,6 +36,7 @@ class AvatarService
|
|||||||
* @param Client $client
|
* @param Client $client
|
||||||
* @param Config $config
|
* @param Config $config
|
||||||
* @param RouterInterface $router
|
* @param RouterInterface $router
|
||||||
|
* @param StorageInterface $cache
|
||||||
*/
|
*/
|
||||||
public function __construct(Client $client, Config $config, RouterInterface $router, StorageInterface $cache)
|
public function __construct(Client $client, Config $config, RouterInterface $router, StorageInterface $cache)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class AvatarServiceFactory
|
|||||||
{
|
{
|
||||||
$router = $container->get(RouterInterface::class);
|
$router = $container->get(RouterInterface::class);
|
||||||
$httpClient = $container->get(Client::class);
|
$httpClient = $container->get(Client::class);
|
||||||
$cache = $container->get('service.avatarCache');
|
$cache = $container->get('service.cache');
|
||||||
$configArray = $container->get('config');
|
$configArray = $container->get('config');
|
||||||
$config = new Config($configArray['app.config']);
|
$config = new Config($configArray['app.config']);
|
||||||
return new AvatarService($httpClient, $config, $router, $cache);
|
return new AvatarService($httpClient, $config, $router, $cache);
|
||||||
|
|||||||
@ -7,6 +7,7 @@ use App\Entity\JiraIssueType;
|
|||||||
use App\Entity\JiraStatus;
|
use App\Entity\JiraStatus;
|
||||||
use App\Entity\KanbanBoard;
|
use App\Entity\KanbanBoard;
|
||||||
use App\Entity\KanbanEntry;
|
use App\Entity\KanbanEntry;
|
||||||
|
use Zend\Cache\Storage\StorageInterface;
|
||||||
use Zend\Config\Config;
|
use Zend\Config\Config;
|
||||||
use Zend\Http\Client;
|
use Zend\Http\Client;
|
||||||
use Zend\Json\Decoder;
|
use Zend\Json\Decoder;
|
||||||
@ -14,6 +15,13 @@ use Zend\Json\Json;
|
|||||||
|
|
||||||
class JiraCollectorService
|
class JiraCollectorService
|
||||||
{
|
{
|
||||||
|
|
||||||
|
const CACHE_KEY_KANBANBOARD = 'kanbanBoard';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var StorageInterface
|
||||||
|
*/
|
||||||
|
private $cache;
|
||||||
/**
|
/**
|
||||||
* @var Config
|
* @var Config
|
||||||
*/
|
*/
|
||||||
@ -31,11 +39,14 @@ class JiraCollectorService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* JiraClientService constructor.
|
* JiraClientService constructor.
|
||||||
|
* @param StorageInterface $cache
|
||||||
* @param Client $client
|
* @param Client $client
|
||||||
* @param Config $config
|
* @param Config $config
|
||||||
|
* @param AvatarService $avatarService
|
||||||
*/
|
*/
|
||||||
public function __construct(Client $client, Config $config, AvatarService $avatarService)
|
public function __construct(StorageInterface $cache, Client $client, Config $config, AvatarService $avatarService)
|
||||||
{
|
{
|
||||||
|
$this->cache = $cache;
|
||||||
$this->avatarService = $avatarService;
|
$this->avatarService = $avatarService;
|
||||||
$this->httpClient = $client;
|
$this->httpClient = $client;
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
@ -81,10 +92,13 @@ class JiraCollectorService
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param bool $forceReload
|
||||||
* @return KanbanBoard
|
* @return KanbanBoard
|
||||||
*/
|
*/
|
||||||
public function getKanbanBoard(): KanbanBoard
|
public function getKanbanBoard(bool $forceReload = false): KanbanBoard
|
||||||
{
|
{
|
||||||
|
$kanbanBoard = $this->cache->getItem('kanbanBoard');
|
||||||
|
if ($forceReload || null === $kanbanBoard) {
|
||||||
$user = $this->config->get('jira.user');
|
$user = $this->config->get('jira.user');
|
||||||
$password = $this->config->get('jira.password');
|
$password = $this->config->get('jira.password');
|
||||||
/** @var Config $kanbanBoardUriParams */
|
/** @var Config $kanbanBoardUriParams */
|
||||||
@ -106,7 +120,14 @@ class JiraCollectorService
|
|||||||
}
|
}
|
||||||
|
|
||||||
$parsedJsonData = Decoder::decode($response->getBody(), Json::TYPE_ARRAY);
|
$parsedJsonData = Decoder::decode($response->getBody(), Json::TYPE_ARRAY);
|
||||||
return $this->hydrateKanbanBoard($parsedJsonData);
|
|
||||||
|
$kanbanBoard = $this->hydrateKanbanBoard($parsedJsonData);
|
||||||
|
$this->cache->setItem(self::CACHE_KEY_KANBANBOARD, serialize($kanbanBoard));
|
||||||
|
} else {
|
||||||
|
$kanbanBoard = unserialize($kanbanBoard);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $kanbanBoard;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -128,8 +149,7 @@ class JiraCollectorService
|
|||||||
->setAnswerCode($jsonIssue['fields']['customfield_11692'])
|
->setAnswerCode($jsonIssue['fields']['customfield_11692'])
|
||||||
->setIssuePriority($jsonIssue['fields']['priority']['name'])
|
->setIssuePriority($jsonIssue['fields']['priority']['name'])
|
||||||
->setIssuePriorityIcon($jsonIssue['fields']['priority']['iconUrl'])
|
->setIssuePriorityIcon($jsonIssue['fields']['priority']['iconUrl'])
|
||||||
->setLabels($jsonIssue['fields']['labels'])
|
->setLabels($jsonIssue['fields']['labels']);
|
||||||
;
|
|
||||||
|
|
||||||
$spikeTimeSpent = 0;
|
$spikeTimeSpent = 0;
|
||||||
array_map(function ($worklog) use (&$spikeTimeSpent) {
|
array_map(function ($worklog) use (&$spikeTimeSpent) {
|
||||||
|
|||||||
@ -10,10 +10,11 @@ class JiraCollectorServiceFactory
|
|||||||
{
|
{
|
||||||
public function __invoke(ContainerInterface $container)
|
public function __invoke(ContainerInterface $container)
|
||||||
{
|
{
|
||||||
|
$cache = $container->get('service.cache');
|
||||||
$configArray = $container->get('config');
|
$configArray = $container->get('config');
|
||||||
$httpClient = $container->get(Client::class);
|
$httpClient = $container->get(Client::class);
|
||||||
$config = new Config($configArray['app.config']);
|
$config = new Config($configArray['app.config']);
|
||||||
$avatarService = $container->get(AvatarService::class);
|
$avatarService = $container->get(AvatarService::class);
|
||||||
return new JiraCollectorService($httpClient, $config, $avatarService);
|
return new JiraCollectorService($cache,$httpClient, $config, $avatarService);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
95
src/App/Service/TspInfoService.php
Normal file
95
src/App/Service/TspInfoService.php
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Service;
|
||||||
|
|
||||||
|
use League\Csv\Reader;
|
||||||
|
use League\Csv\Statement;
|
||||||
|
use Zend\Cache\Storage\StorageInterface;
|
||||||
|
use Zend\Config\Config;
|
||||||
|
use Zend\Http\Client;
|
||||||
|
use Zend\Json\Json;
|
||||||
|
|
||||||
|
class TspInfoService
|
||||||
|
{
|
||||||
|
|
||||||
|
const CACHE_KEY = 'tspInfo';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var StorageInterface
|
||||||
|
*/
|
||||||
|
private $cache;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Config
|
||||||
|
*/
|
||||||
|
private $config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var VacationInfoCollectorService
|
||||||
|
*/
|
||||||
|
private $vacationInfoCollectorService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var TrInfoCollectorService
|
||||||
|
*/
|
||||||
|
private $trInfoCollectorService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var JcatInfoCollectorService
|
||||||
|
*/
|
||||||
|
private $jcatInfoCollectorService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var LabInfoCollectorService
|
||||||
|
*/
|
||||||
|
private $labInfoCollectorService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var JiraCollectorService
|
||||||
|
*/
|
||||||
|
private $jiraCollectorService;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
StorageInterface $cache,
|
||||||
|
Config $config,
|
||||||
|
VacationInfoCollectorService $vacationInfoCollectorService,
|
||||||
|
TrInfoCollectorService $trInfoCollectorService,
|
||||||
|
JcatInfoCollectorService $jcatInfoCollectorService,
|
||||||
|
LabInfoCollectorService $labInfoCollectorService,
|
||||||
|
JiraCollectorService $jiraCollectorService
|
||||||
|
)
|
||||||
|
{
|
||||||
|
$this->cache = $cache;
|
||||||
|
$this->config = $config;
|
||||||
|
$this->vacationInfoCollectorService = $vacationInfoCollectorService;
|
||||||
|
$this->trInfoCollectorService = $trInfoCollectorService;
|
||||||
|
$this->jcatInfoCollectorService = $jcatInfoCollectorService;
|
||||||
|
$this->labInfoCollectorService = $labInfoCollectorService;
|
||||||
|
$this->jiraCollectorService = $jiraCollectorService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param bool $forceReload
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getTspInfo(bool $forceReload = false): array
|
||||||
|
{
|
||||||
|
$tspInfo = $this->cache->getItem(self::CACHE_KEY);
|
||||||
|
if($forceReload || null == $tspInfo) {
|
||||||
|
$tspInfo = [
|
||||||
|
'cameraUrls' => $this->config->get('url.eurestCameras')->toArray(),
|
||||||
|
'animGifs' => [],
|
||||||
|
'praGoals' => $this->trInfoCollectorService->getPraGoals(),
|
||||||
|
'trProgressInfo' => $this->trInfoCollectorService->getProgressInfo(),
|
||||||
|
'trFlowErrors' => $this->jcatInfoCollectorService->getTrFlowErrors(),
|
||||||
|
'expedites' => $this->jiraCollectorService->getExpedites(),
|
||||||
|
// 'isVacationSoon' => $this->vacationInfoCollectorService->isVacationSoon(),
|
||||||
|
// 'labTemperature' => $this->labInfoCollectorService->getLabTemperatureData(),
|
||||||
|
];
|
||||||
|
$this->cache->setItem(self::CACHE_KEY, serialize($tspInfo));
|
||||||
|
} else {
|
||||||
|
$tspInfo = unserialize($tspInfo);
|
||||||
|
}
|
||||||
|
return $tspInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
30
src/App/Service/TspInfoServiceFactory.php
Normal file
30
src/App/Service/TspInfoServiceFactory.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Service;
|
||||||
|
|
||||||
|
use Interop\Container\ContainerInterface;
|
||||||
|
use Zend\Config\Config;
|
||||||
|
use Zend\Http\Client;
|
||||||
|
|
||||||
|
class TspInfoServiceFactory
|
||||||
|
{
|
||||||
|
public function __invoke(ContainerInterface $container)
|
||||||
|
{
|
||||||
|
$appConfig = $container->get('config')['app.config'];
|
||||||
|
$cache = $container->get('service.cache');
|
||||||
|
$dataCollectorService = $container->get(VacationInfoCollectorService::class);
|
||||||
|
$trInfoCollectorService = $container->get(TrInfoCollectorService::class);
|
||||||
|
$jcatInfoCollectorService = $container->get(JcatInfoCollectorService::class);
|
||||||
|
$labInfoCollectorService = $container->get(LabInfoCollectorService::class);
|
||||||
|
$jiraInfoCollectorService = $container->get(JiraCollectorService::class);
|
||||||
|
return new TspInfoService(
|
||||||
|
$cache,
|
||||||
|
new Config($appConfig),
|
||||||
|
$dataCollectorService,
|
||||||
|
$trInfoCollectorService,
|
||||||
|
$jcatInfoCollectorService,
|
||||||
|
$labInfoCollectorService,
|
||||||
|
$jiraInfoCollectorService
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user