* logger added

* calendar view in maintenance
* $year filter support in xlsx and maintenance
This commit is contained in:
Danyi Dávid
2018-11-19 16:48:12 +01:00
parent b906e360bf
commit 4d52d4b575
13 changed files with 392 additions and 131 deletions

View File

@@ -49,7 +49,8 @@ return [
'api.fault-comment.post',
'api.fault-reject.post',
'api.maintenance',
'api.maintenance.upcoming'
'api.maintenance.upcoming',
'api.maintenance.calendar',
],
'ufo' => [
'api.fault.put',
@@ -69,6 +70,7 @@ return [
'api.maintenance',
'api.maintenance.put',
'api.maintenance.upcoming',
'api.maintenance.calendar',
],
'karbantarto' => [
],

View File

@@ -0,0 +1,27 @@
<?php
use Zend\Stratigility\Middleware\ErrorHandler;
return [
'dependencies' => [
'factories' => [
LosMiddleware\LosLog\LosLog::class => LosMiddleware\LosLog\LosLogFactory::class,
LosMiddleware\LosLog\HttpLog::class => LosMiddleware\LosLog\HttpLogFactory::class,
Psr\Log\LoggerInterface::class => LosMiddleware\LosLog\LoggerFactory::class,
],
'delegators' => [
ErrorHandler::class => [
LosMiddleware\LosLog\ErrorHandlerListenerDelegatorFactory::class,
],
],
],
'loslog' => [
'log_dir' => 'data/log',
'error_logger_file' => 'error.log',
'exception_logger_file' => 'exception.log',
'static_logger_file' => 'static.log',
'http_logger_file' => 'http.log',
'log_request' => false,
'log_response' => false,
'full' => false,
],
];

View File

@@ -13,6 +13,7 @@ $cacheConfig = [
];
$aggregator = new ConfigAggregator([
\Zend\Log\ConfigProvider::class,
\Zend\Cache\ConfigProvider::class,
\Zend\Expressive\ConfigProvider::class,
\Zend\Expressive\Helper\ConfigProvider::class,

View File

@@ -40,33 +40,35 @@ return function (
$app->get('/', App\Handler\PingHandler::class, 'home');
$app->get('/api/ping', App\Handler\PingHandler::class, 'api.ping');
$app->get('/api/maintenance/upcoming', App\Handler\MaintenanceUpcomingHandler::class, 'api.maintenance.upcoming');
$app->route('/api/maintenance[/{id:\w+}]', App\Handler\MaintenanceHandler::class, ['GET', 'OPTIONS'], 'api.maintenance');
$app->route('/api/maintenance/{id:\w+}', App\Handler\MaintenanceHandler::class, ['PUT'], 'api.maintenance.put');
$app->get('/api/maintenance/calendar/{year:\d+}', App\Handler\MaintenanceCalendarHandler::class, 'api.maintenance.calendar');
$app->get('/api/maintenance/upcoming/{year:\d+}', App\Handler\MaintenanceUpcomingHandler::class, 'api.maintenance.upcoming');
$app->get('/api/maintenance/{year:\d+}', App\Handler\MaintenanceHandler::class, 'api.maintenance.list');
$app->get('/api/maintenance/{year:\d+}/{id:w\+}', App\Handler\MaintenanceHandler::class, 'api.maintenance.get');
$app->put('/api/maintenance/{id:\w+}', App\Handler\MaintenanceHandler::class, 'api.maintenance.put');
// authentication and user management
$app->route('/api/auth/login', App\Handler\Auth\AuthHandler::class, ['POST', 'OPTIONS'], 'api.auth.login');
$app->route('/api/auth/renew', App\Handler\Auth\AuthHandler::class, ['GET', 'OPTIONS'], 'api.auth.renew');
$app->route('/api/user[/{id:\d+}]', App\Handler\User\UserHandler::class, ['GET', 'PUT', 'OPTIONS'], 'api.user.profile');
$app->route('/api/user/password', App\Handler\User\PasswordHandler::class, ['POST', 'OPTIONS'], 'api.user.password');
$app->post('/api/auth/login', App\Handler\Auth\AuthHandler::class, 'api.auth.login');
$app->get('/api/auth/renew', App\Handler\Auth\AuthHandler::class, 'api.auth.renew');
$app->route('/api/user[/{id:\d+}]', App\Handler\User\UserHandler::class, ['GET', 'PUT'], 'api.user.profile');
$app->post('/api/user/password', App\Handler\User\PasswordHandler::class, 'api.user.password');
// fault management
$app->route('/api/fault[/{id:\d+}]', App\Handler\Fault\FaultHandler::class, ['GET', 'OPTIONS'], 'api.fault.get'); // list/show
$app->get('/api/fault[/{id:\d+}]', App\Handler\Fault\FaultHandler::class, 'api.fault.get'); // list/show
$app->post('/api/fault', App\Handler\Fault\FaultHandler::class, 'api.fault.post'); // create
$app->put('/api/fault/{id:\d+}', App\Handler\Fault\FaultHandler::class, 'api.fault.put'); // update
$app->delete('/api/fault/{id:\d+}', App\Handler\Fault\FaultHandler::class, 'api.fault.delete');
$app->route('/api/fault-reject/{id:\d+}', App\Handler\Fault\FaultRejectHandler::class, ['POST', 'OPTIONS'], 'api.fault-reject.post');
$app->route('/api/fault-comment/{id:\d+}', App\Handler\Fault\FaultCommentHandler::class, ['POST', 'OPTIONS'], 'api.fault-comment.post');
$app->route('/api/fault-attachment/{id:\d+}/{type}', App\Handler\Fault\FaultAttachmentHandler::class, ['POST', 'OPTIONS'], 'api.fault-attachment.post');
$app->route('/show-attachment/{id:\d+}', App\Handler\Fault\FaultAttachmentHandler::class, ['GET', 'OPTIONS'], 'show-attachment');
$app->post('/api/fault-reject/{id:\d+}', App\Handler\Fault\FaultRejectHandler::class, 'api.fault-reject.post');
$app->post('/api/fault-comment/{id:\d+}', App\Handler\Fault\FaultCommentHandler::class, 'api.fault-comment.post');
$app->post('/api/fault-attachment/{id:\d+}/{type}', App\Handler\Fault\FaultAttachmentHandler::class, 'api.fault-attachment.post');
$app->get('/show-attachment/{id:\d+}', App\Handler\Fault\FaultAttachmentHandler::class, 'show-attachment');
$app->route('/hibajegy-pdf/{id:\d+}[/{filename}]', App\Handler\Pdf\GenerateWorksheetHandler::class, ['GET', 'OPTIONS'], 'hibajegy-pdf');
$app->route('/karbantartasjegy-pdf/{id:\w+}[/{filename}]', App\Handler\Pdf\GenerateMaintenanceSheetHandler::class, ['GET', 'OPTIONS'], 'karbantartasjegy-pdf');
$app->get('/hibajegy-pdf/{id:\d+}[/{filename}]', App\Handler\Pdf\GenerateWorksheetHandler::class, 'hibajegy-pdf');
$app->get('/karbantartasjegy-pdf/{id:\w+}[/{filename}]', App\Handler\Pdf\GenerateMaintenanceSheetHandler::class, 'karbantartasjegy-pdf');
// core data
$app->route('/api/error-category', App\Handler\ErrorCategoryHandler::class, ['GET', 'OPTIONS'], 'api.error-category.get'); // list/show
$app->route('/api/error-origin', App\Handler\ErrorOriginHandler::class, ['GET', 'OPTIONS'], 'api.error-origin.get'); // list/show
$app->route('/api/facility-location', App\Handler\FacilityLocationHandler::class, ['GET', 'OPTIONS'], 'api.facility-location.get'); // list/show
$app->route('/api/solution-time-interval', App\Handler\SolutionTimeIntervalHandler::class, ['GET', 'OPTIONS'], 'api.solution-time-interval.get'); // list/show
$app->get('/api/error-category', App\Handler\ErrorCategoryHandler::class, 'api.error-category.get'); // list/show
$app->get('/api/error-origin', App\Handler\ErrorOriginHandler::class, 'api.error-origin.get'); // list/show
$app->get('/api/facility-location', App\Handler\FacilityLocationHandler::class, 'api.facility-location.get'); // list/show
$app->get('/api/solution-time-interval', App\Handler\SolutionTimeIntervalHandler::class, 'api.solution-time-interval.get'); // list/show
};