* updated expressive version
This commit is contained in:
15
src/App/Handler/Auth/AuthFactory.php
Normal file
15
src/App/Handler/Auth/AuthFactory.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Auth;
|
||||
|
||||
use App\Service\AuthService;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class AuthFactory
|
||||
{
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
$faultManagerService = $container->get(AuthService::class);
|
||||
return new AuthHandler($faultManagerService);
|
||||
}
|
||||
}
|
||||
59
src/App/Handler/Auth/AuthHandler.php
Normal file
59
src/App/Handler/Auth/AuthHandler.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Auth;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\AuthService;
|
||||
use Doctrine\ORM\NoResultException;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class AuthHandler extends CrudHandler
|
||||
{
|
||||
/** @var AuthService */
|
||||
private $authService;
|
||||
|
||||
public function __construct(AuthService $authService)
|
||||
{
|
||||
$this->authService = $authService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create new auth token (login)
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function create(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$authData = $this->getRequestData($request);
|
||||
try {
|
||||
return new JsonResponse($this->authService->authenticate($authData['login'], $authData['password']));
|
||||
} catch (NoResultException $e) {
|
||||
return new JsonResponse([
|
||||
'message' => $e->getMessage()
|
||||
], 403);
|
||||
} catch (\Exception $e) {
|
||||
return new JsonResponse([
|
||||
'message' => $e->getMessage()
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Renew auth token
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function getList(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
try {
|
||||
$token = $request->getAttribute('token', false);
|
||||
return new JsonResponse($this->authService->renewToken($token));
|
||||
} catch (\Exception $e) {
|
||||
return new JsonResponse([
|
||||
'message' => $e->getMessage()
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
16
src/App/Handler/ErrorCategoryFactory.php
Normal file
16
src/App/Handler/ErrorCategoryFactory.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler;
|
||||
|
||||
use App\Service\ErrorCategoryService;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class ErrorCategoryFactory
|
||||
{
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
/** @var ErrorCategoryService $errorCategoryService */
|
||||
$errorCategoryService = $container->get(ErrorCategoryService::class);
|
||||
return new ErrorCategoryHandler($errorCategoryService);
|
||||
}
|
||||
}
|
||||
30
src/App/Handler/ErrorCategoryHandler.php
Normal file
30
src/App/Handler/ErrorCategoryHandler.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\ErrorCategoryService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class ErrorCategoryHandler extends CrudHandler
|
||||
{
|
||||
/** @var ErrorCategoryService */
|
||||
private $errorCategoryService;
|
||||
|
||||
public function __construct(ErrorCategoryService $errorCategoryService)
|
||||
{
|
||||
$this->errorCategoryService = $errorCategoryService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all faults accessible to the user
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function getList(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
return new JsonResponse($this->errorCategoryService->getList());
|
||||
}
|
||||
}
|
||||
16
src/App/Handler/ErrorOriginFactory.php
Normal file
16
src/App/Handler/ErrorOriginFactory.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler;
|
||||
|
||||
use App\Service\ErrorOriginService;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class ErrorOriginFactory
|
||||
{
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
/** @var ErrorOriginService $errorOriginService */
|
||||
$errorOriginService = $container->get(ErrorOriginService::class);
|
||||
return new ErrorOriginHandler($errorOriginService);
|
||||
}
|
||||
}
|
||||
31
src/App/Handler/ErrorOriginHandler.php
Normal file
31
src/App/Handler/ErrorOriginHandler.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\ErrorOriginService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class ErrorOriginHandler extends CrudHandler
|
||||
{
|
||||
/** @var ErrorOriginService */
|
||||
private $errorOriginService;
|
||||
|
||||
public function __construct(ErrorOriginService $errorOriginService)
|
||||
{
|
||||
$this->errorOriginService = $errorOriginService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all faults accessible to the user
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function getList(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
return new JsonResponse($this->errorOriginService->getList());
|
||||
}
|
||||
}
|
||||
16
src/App/Handler/FacilityLocationFactory.php
Normal file
16
src/App/Handler/FacilityLocationFactory.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler;
|
||||
|
||||
use App\Service\FacilityLocationService;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class FacilityLocationFactory
|
||||
{
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
/** @var FacilityLocationService $facilityLocationService */
|
||||
$facilityLocationService = $container->get(FacilityLocationService::class);
|
||||
return new FacilityLocationHandler($facilityLocationService);
|
||||
}
|
||||
}
|
||||
31
src/App/Handler/FacilityLocationHandler.php
Normal file
31
src/App/Handler/FacilityLocationHandler.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\FacilityLocationService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class FacilityLocationHandler extends CrudHandler
|
||||
{
|
||||
/** @var FacilityLocationService */
|
||||
private $facilityLocationService;
|
||||
|
||||
public function __construct(FacilityLocationService $facilityLocationService)
|
||||
{
|
||||
$this->facilityLocationService = $facilityLocationService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all faults accessible to the user
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function getList(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
return new JsonResponse($this->facilityLocationService->getFacilityLocationListFlat());
|
||||
}
|
||||
}
|
||||
17
src/App/Handler/Fault/FaultAttachmentFactory.php
Normal file
17
src/App/Handler/Fault/FaultAttachmentFactory.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Fault;
|
||||
|
||||
use App\Service\FaultAttachmentService;
|
||||
use App\Service\FaultManagerService;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class FaultAttachmentFactory
|
||||
{
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
$faultManagerService = $container->get(FaultManagerService::class);
|
||||
$attachmentService = $container->get(FaultAttachmentService::class);
|
||||
return new FaultAttachmentHandler($faultManagerService, $attachmentService);
|
||||
}
|
||||
}
|
||||
80
src/App/Handler/Fault/FaultAttachmentHandler.php
Normal file
80
src/App/Handler/Fault/FaultAttachmentHandler.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Fault;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\FaultAttachmentService;
|
||||
use App\Service\FaultManagerService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Message\UploadedFileInterface;
|
||||
use Zend\Diactoros\Response;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
use Zend\Diactoros\Stream;
|
||||
|
||||
class FaultAttachmentHandler extends CrudHandler
|
||||
{
|
||||
/** @var FaultManagerService */
|
||||
private $faultManagerService;
|
||||
|
||||
/** @var FaultAttachmentService */
|
||||
private $attachmentService;
|
||||
|
||||
public function __construct(
|
||||
FaultManagerService $faultManagerService,
|
||||
FaultAttachmentService $attachmentService
|
||||
) {
|
||||
$this->faultManagerService = $faultManagerService;
|
||||
$this->attachmentService = $attachmentService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Post a new fault report
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function create(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$faultId = $request->getAttribute('id');
|
||||
$type = $request->getAttribute('type', 'file');
|
||||
$token = $request->getAttribute('token');
|
||||
try {
|
||||
/** @var UploadedFileInterface[] $files */
|
||||
$files = $request->getUploadedFiles()['file'];
|
||||
return new JsonResponse(
|
||||
$this->attachmentService->createAttachments($faultId, $files, $token->uid, $type),
|
||||
201
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
return new JsonResponse($e->getMessage(), 500);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
* @throws \Doctrine\ORM\NoResultException
|
||||
* @throws \Doctrine\ORM\NonUniqueResultException
|
||||
*/
|
||||
public function get(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$id = $request->getAttribute('id');
|
||||
$attachment = $this->attachmentService->get($id);
|
||||
$stream = new Stream($attachment->getIoStream());
|
||||
switch ($attachment->getType()) {
|
||||
case 'image':
|
||||
$contentType = 'image/jpg';
|
||||
break;
|
||||
case 'expense':
|
||||
$contentType = 'application/pdf';
|
||||
break;
|
||||
default:
|
||||
$contentType = 'application/octet-stream';
|
||||
}
|
||||
$response = new Response($stream);
|
||||
return $response->withStatus(200)
|
||||
->withHeader('Content-type', $contentType)
|
||||
// ->withHeader('Content-disposition', 'attachment;filename='.$attachment->getFileName())
|
||||
;
|
||||
}
|
||||
}
|
||||
15
src/App/Handler/Fault/FaultCommentFactory.php
Normal file
15
src/App/Handler/Fault/FaultCommentFactory.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Fault;
|
||||
|
||||
use App\Service\FaultManagerService;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class FaultCommentFactory
|
||||
{
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
$faultManagerService = $container->get(FaultManagerService::class);
|
||||
return new FaultCommentHandler($faultManagerService);
|
||||
}
|
||||
}
|
||||
38
src/App/Handler/Fault/FaultCommentHandler.php
Normal file
38
src/App/Handler/Fault/FaultCommentHandler.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Fault;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\FaultManagerService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class FaultCommentHandler extends CrudHandler
|
||||
{
|
||||
/** @var FaultManagerService */
|
||||
private $faultManagerService;
|
||||
|
||||
public function __construct(FaultManagerService $faultManagerService)
|
||||
{
|
||||
$this->faultManagerService = $faultManagerService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Post a new fault report
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function create(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$faultId = $request->getAttribute('id');
|
||||
$jwt = $request->getAttribute('token');
|
||||
try {
|
||||
$data = $this->getRequestData($request);
|
||||
return new JsonResponse($this->faultManagerService->addFaultComment($faultId, $data, $jwt->uid), 201);
|
||||
} catch (\Exception $e) {
|
||||
return new JsonResponse($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
15
src/App/Handler/Fault/FaultFactory.php
Normal file
15
src/App/Handler/Fault/FaultFactory.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Fault;
|
||||
|
||||
use App\Service\FaultManagerService;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class FaultFactory
|
||||
{
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
$faultManagerService = $container->get(FaultManagerService::class);
|
||||
return new FaultHandler($faultManagerService);
|
||||
}
|
||||
}
|
||||
97
src/App/Handler/Fault/FaultHandler.php
Normal file
97
src/App/Handler/Fault/FaultHandler.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Fault;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\FaultManagerService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class FaultHandler extends CrudHandler
|
||||
{
|
||||
/** @var FaultManagerService */
|
||||
private $faultManagerService;
|
||||
|
||||
public function __construct(FaultManagerService $faultManagerService)
|
||||
{
|
||||
$this->faultManagerService = $faultManagerService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all faults accessible to the user
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function getList(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
return new JsonResponse($this->faultManagerService->getFaultList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a single fault
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
* @throws \Doctrine\ORM\ORMException
|
||||
* @throws \Doctrine\ORM\OptimisticLockException
|
||||
* @throws \Doctrine\ORM\TransactionRequiredException
|
||||
*/
|
||||
public function get(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$id = $request->getAttribute('id', false);
|
||||
return new JsonResponse($this->faultManagerService->getFault($id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Post a new fault report
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function create(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
try {
|
||||
$data = $this->getRequestData($request);
|
||||
$token = $request->getAttribute('token');
|
||||
return new JsonResponse($this->faultManagerService->createFault($data, $token->uid), 201);
|
||||
} catch (\Exception $e) {
|
||||
return new JsonResponse($e->getMessage(), 500);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a fault report
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function update(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
try {
|
||||
$id = $request->getAttribute('id');
|
||||
$token = $request->getAttribute('token');
|
||||
$data = $this->getRequestData($request);
|
||||
return new JsonResponse($this->faultManagerService->updateFault($id, $data, $token->uid));
|
||||
} catch (\Exception $e) {
|
||||
return new JsonResponse($e->getMessage(), 500);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a fault report (NYI)
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function delete(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
try {
|
||||
$id = $request->getAttribute('id');
|
||||
return new JsonResponse($this->faultManagerService->deleteFault($id));
|
||||
} catch (\Exception $e) {
|
||||
return new JsonResponse($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
15
src/App/Handler/Fault/FaultRejectFactory.php
Normal file
15
src/App/Handler/Fault/FaultRejectFactory.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Fault;
|
||||
|
||||
use App\Service\FaultManagerService;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class FaultRejectFactory
|
||||
{
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
$faultManagerService = $container->get(FaultManagerService::class);
|
||||
return new FaultRejectHandler($faultManagerService);
|
||||
}
|
||||
}
|
||||
38
src/App/Handler/Fault/FaultRejectHandler.php
Normal file
38
src/App/Handler/Fault/FaultRejectHandler.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Fault;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\FaultManagerService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class FaultRejectHandler extends CrudHandler
|
||||
{
|
||||
/** @var FaultManagerService */
|
||||
private $faultManagerService;
|
||||
|
||||
public function __construct(FaultManagerService $faultManagerService)
|
||||
{
|
||||
$this->faultManagerService = $faultManagerService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Post a new fault report
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function create(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$faultId = $request->getAttribute('id');
|
||||
$jwt = $request->getAttribute('token');
|
||||
try {
|
||||
$data = $this->getRequestData($request);
|
||||
return new JsonResponse($this->faultManagerService->rejectFault($faultId, $data, $jwt->uid), 201);
|
||||
} catch (\Exception $e) {
|
||||
return new JsonResponse($e->getMessage(), 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
37
src/App/Handler/Fault/X_FaultS2ConfirmAction.php
Normal file
37
src/App/Handler/Fault/X_FaultS2ConfirmAction.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Fault;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\FaultManagerService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class X_FaultS2ConfirmAction extends CrudHandler
|
||||
{
|
||||
/** @var FaultManagerService */
|
||||
private $faultManagerService;
|
||||
|
||||
public function __construct(FaultManagerService $faultManagerService)
|
||||
{
|
||||
$this->faultManagerService = $faultManagerService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a fault report
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function update(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
try {
|
||||
$id = $request->getAttribute('id');
|
||||
$data = $this->getRequestData($request);
|
||||
return new JsonResponse($this->faultManagerService->confirmFault($id, $data));
|
||||
} catch (\Exception $e) {
|
||||
return new JsonResponse($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
37
src/App/Handler/Fault/X_FaultS3AcknowledgeAction.php
Normal file
37
src/App/Handler/Fault/X_FaultS3AcknowledgeAction.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Fault;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\FaultManagerService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class X_FaultS3AcknowledgeAction extends CrudHandler
|
||||
{
|
||||
/** @var FaultManagerService */
|
||||
private $faultManagerService;
|
||||
|
||||
public function __construct(FaultManagerService $faultManagerService)
|
||||
{
|
||||
$this->faultManagerService = $faultManagerService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a fault report
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function update(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
try {
|
||||
$id = $request->getAttribute('id');
|
||||
$data = $this->getRequestData($request);
|
||||
return new JsonResponse($this->faultManagerService->ackFault($id, $data));
|
||||
} catch (\Exception $e) {
|
||||
return new JsonResponse($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
37
src/App/Handler/Fault/X_FaultS4RepairedAction.php
Normal file
37
src/App/Handler/Fault/X_FaultS4RepairedAction.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Fault;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\FaultManagerService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class X_FaultS4RepairedAction extends CrudHandler
|
||||
{
|
||||
/** @var FaultManagerService */
|
||||
private $faultManagerService;
|
||||
|
||||
public function __construct(FaultManagerService $faultManagerService)
|
||||
{
|
||||
$this->faultManagerService = $faultManagerService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a fault report
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function update(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
try {
|
||||
$id = $request->getAttribute('id');
|
||||
$data = $this->getRequestData($request);
|
||||
return new JsonResponse($this->faultManagerService->repairFault($id, $data));
|
||||
} catch (\Exception $e) {
|
||||
return new JsonResponse($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
36
src/App/Handler/Fault/X_FaultS5AcceptedAction.php
Normal file
36
src/App/Handler/Fault/X_FaultS5AcceptedAction.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Fault;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\FaultManagerService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class X_FaultS5AcceptedAction extends CrudHandler
|
||||
{
|
||||
/** @var FaultManagerService */
|
||||
private $faultManagerService;
|
||||
|
||||
public function __construct(FaultManagerService $faultManagerService)
|
||||
{
|
||||
$this->faultManagerService = $faultManagerService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a fault report
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function update(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
try {
|
||||
$id = $request->getAttribute('id');
|
||||
$data = $this->getRequestData($request);
|
||||
return new JsonResponse($this->faultManagerService->acceptFault($id, $data));
|
||||
} catch (\Exception $e) {
|
||||
return new JsonResponse($e->getMessage(), $e->getCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
21
src/App/Handler/MaintenanceFactory.php
Normal file
21
src/App/Handler/MaintenanceFactory.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler;
|
||||
|
||||
use App\Service\MaintenanceManagerService;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class MaintenanceFactory
|
||||
{
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
* @return MaintenanceHandler
|
||||
* @throws \Psr\Container\ContainerExceptionInterface
|
||||
* @throws \Psr\Container\NotFoundExceptionInterface
|
||||
*/
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
$maintenanceManagerService = $container->get(MaintenanceManagerService::class);
|
||||
return new MaintenanceHandler($maintenanceManagerService);
|
||||
}
|
||||
}
|
||||
59
src/App/Handler/MaintenanceHandler.php
Normal file
59
src/App/Handler/MaintenanceHandler.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?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 MaintenanceHandler extends CrudHandler
|
||||
{
|
||||
/** @var MaintenanceManagerService */
|
||||
private $maintenanceManagerService;
|
||||
|
||||
public function __construct(MaintenanceManagerService $maintenanceManagerService)
|
||||
{
|
||||
$this->maintenanceManagerService = $maintenanceManagerService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renew auth token
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function getList(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
return new JsonResponse($this->maintenanceManagerService->getMaintenanceList()->getValues());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
* @throws \Doctrine\ORM\ORMException
|
||||
* @throws \Doctrine\ORM\OptimisticLockException
|
||||
* @throws \Doctrine\ORM\TransactionRequiredException
|
||||
*/
|
||||
public function get(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$hash = $request->getAttribute(self::IDENTIFIER_NAME);
|
||||
return new JsonResponse($this->maintenanceManagerService->get($hash));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
* @throws \Doctrine\ORM\ORMException
|
||||
* @throws \Doctrine\ORM\OptimisticLockException
|
||||
* @throws \Doctrine\ORM\TransactionRequiredException
|
||||
*/
|
||||
public function update(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$hash = $request->getAttribute(self::IDENTIFIER_NAME);
|
||||
$data = $this->getRequestData($request);
|
||||
$jwt = $request->getAttribute('token');
|
||||
return new JsonResponse($this->maintenanceManagerService->update($hash, $data, $jwt->uid));
|
||||
}
|
||||
}
|
||||
21
src/App/Handler/MaintenanceUpcomingFactory.php
Normal file
21
src/App/Handler/MaintenanceUpcomingFactory.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler;
|
||||
|
||||
use App\Service\MaintenanceManagerService;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class MaintenanceUpcomingFactory
|
||||
{
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
* @return MaintenanceUpcomingHandler
|
||||
* @throws \Psr\Container\ContainerExceptionInterface
|
||||
* @throws \Psr\Container\NotFoundExceptionInterface
|
||||
*/
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
$maintenanceManagerService = $container->get(MaintenanceManagerService::class);
|
||||
return new MaintenanceUpcomingHandler($maintenanceManagerService);
|
||||
}
|
||||
}
|
||||
31
src/App/Handler/MaintenanceUpcomingHandler.php
Normal file
31
src/App/Handler/MaintenanceUpcomingHandler.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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 MaintenanceUpcomingHandler extends CrudHandler
|
||||
{
|
||||
/** @var MaintenanceManagerService */
|
||||
private $maintenanceManagerService;
|
||||
|
||||
public function __construct(MaintenanceManagerService $maintenanceManagerService)
|
||||
{
|
||||
$this->maintenanceManagerService = $maintenanceManagerService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renew auth token
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function getList(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
return new JsonResponse($this->maintenanceManagerService->getUpcomingMaintenanceList()->getValues());
|
||||
}
|
||||
}
|
||||
25
src/App/Handler/Pdf/GenerateMaintenanceSheetFactory.php
Normal file
25
src/App/Handler/Pdf/GenerateMaintenanceSheetFactory.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Pdf;
|
||||
|
||||
use App\Service\MaintenanceManagerService;
|
||||
use App\Service\PdfService;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class GenerateMaintenanceSheetFactory
|
||||
{
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
* @return GenerateMaintenanceSheetHandler
|
||||
* @throws \Psr\Container\ContainerExceptionInterface
|
||||
* @throws \Psr\Container\NotFoundExceptionInterface
|
||||
*/
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
/** @var PdfService $pdfService */
|
||||
$pdfService = $container->get(PdfService::class);
|
||||
/** @var MaintenanceManagerService $maintenanceManagerService */
|
||||
$maintenanceManagerService = $container->get(MaintenanceManagerService::class);
|
||||
return new GenerateMaintenanceSheetHandler($pdfService, $maintenanceManagerService);
|
||||
}
|
||||
}
|
||||
40
src/App/Handler/Pdf/GenerateMaintenanceSheetHandler.php
Normal file
40
src/App/Handler/Pdf/GenerateMaintenanceSheetHandler.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Pdf;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\MaintenanceManagerService;
|
||||
use App\Service\PdfService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\TextResponse;
|
||||
|
||||
class GenerateMaintenanceSheetHandler extends CrudHandler
|
||||
{
|
||||
/** @var PdfService */
|
||||
private $pdfService;
|
||||
|
||||
/** @var MaintenanceManagerService */
|
||||
private $maintenanceManager;
|
||||
|
||||
public function __construct(PdfService $pdfService, MaintenanceManagerService $maintenanceManagerService)
|
||||
{
|
||||
$this->pdfService = $pdfService;
|
||||
$this->maintenanceManager = $maintenanceManagerService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function get(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$id = $request->getAttribute('id', false);
|
||||
try {
|
||||
return (new TextResponse($this->pdfService->getMaintenanceSheet($id)))
|
||||
->withHeader('Content-type', 'application/pdf');
|
||||
} catch (\Exception $e) {
|
||||
return new TextResponse($e->getMessage(), 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
19
src/App/Handler/Pdf/GenerateWorksheetFactory.php
Normal file
19
src/App/Handler/Pdf/GenerateWorksheetFactory.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Pdf;
|
||||
|
||||
use App\Service\FaultManagerService;
|
||||
use App\Service\PdfService;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class GenerateWorksheetFactory
|
||||
{
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
/** @var PdfService $pdfService */
|
||||
$pdfService = $container->get(PdfService::class);
|
||||
/** @var FaultManagerService $faultManager */
|
||||
$faultManager = $container->get(FaultManagerService::class);
|
||||
return new GenerateWorksheetHandler($pdfService, $faultManager);
|
||||
}
|
||||
}
|
||||
44
src/App/Handler/Pdf/GenerateWorksheetHandler.php
Normal file
44
src/App/Handler/Pdf/GenerateWorksheetHandler.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\Pdf;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\FaultManagerService;
|
||||
use App\Service\PdfService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\TextResponse;
|
||||
|
||||
class GenerateWorksheetHandler extends CrudHandler
|
||||
{
|
||||
/** @var PdfService */
|
||||
private $pdfService;
|
||||
|
||||
/** @var FaultManagerService */
|
||||
private $faultManager;
|
||||
|
||||
public function __construct(PdfService $pdfService, FaultManagerService $faultManagerService)
|
||||
{
|
||||
$this->pdfService = $pdfService;
|
||||
$this->faultManager = $faultManagerService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renew auth token
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function get(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$id = $request->getAttribute('id', false);
|
||||
try {
|
||||
return (new TextResponse($this->pdfService->getWorksheet($id)))
|
||||
->withHeader('Content-type', 'application/pdf')
|
||||
// ->withHeader('Content-disposition', 'attachment; filename='
|
||||
// . $this->faultManager->getFault($id)->getWorksheetNumber() . '.pdf')
|
||||
;
|
||||
} catch (\Exception $e) {
|
||||
return new TextResponse($e->getMessage(), 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
18
src/App/Handler/PingHandler.php
Normal file
18
src/App/Handler/PingHandler.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Handler;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Server\RequestHandlerInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class PingHandler implements RequestHandlerInterface
|
||||
{
|
||||
public function handle(ServerRequestInterface $request) : ResponseInterface
|
||||
{
|
||||
return new JsonResponse(['ack' => time()]);
|
||||
}
|
||||
}
|
||||
16
src/App/Handler/SolutionTimeIntervalFactory.php
Normal file
16
src/App/Handler/SolutionTimeIntervalFactory.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler;
|
||||
|
||||
use App\Service\SolutionTimeIntervalService;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class SolutionTimeIntervalFactory
|
||||
{
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
/** @var SolutionTimeIntervalService $facilityLocationService */
|
||||
$facilityLocationService = $container->get(SolutionTimeIntervalService::class);
|
||||
return new SolutionTimeIntervalHandler($facilityLocationService);
|
||||
}
|
||||
}
|
||||
31
src/App/Handler/SolutionTimeIntervalHandler.php
Normal file
31
src/App/Handler/SolutionTimeIntervalHandler.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\SolutionTimeIntervalService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class SolutionTimeIntervalHandler extends CrudHandler
|
||||
{
|
||||
/** @var SolutionTimeIntervalService */
|
||||
private $solutionTimeIntervalService;
|
||||
|
||||
public function __construct(SolutionTimeIntervalService $facilityLocationService)
|
||||
{
|
||||
$this->solutionTimeIntervalService = $facilityLocationService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all faults accessible to the user
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function getList(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
return new JsonResponse($this->solutionTimeIntervalService->getList());
|
||||
}
|
||||
}
|
||||
16
src/App/Handler/User/PasswordFactory.php
Normal file
16
src/App/Handler/User/PasswordFactory.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\User;
|
||||
|
||||
use App\Service\UserService;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class PasswordFactory
|
||||
{
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
/** @var UserService $userService */
|
||||
$userService = $container->get(UserService::class);
|
||||
return new PasswordHandler($userService);
|
||||
}
|
||||
}
|
||||
37
src/App/Handler/User/PasswordHandler.php
Normal file
37
src/App/Handler/User/PasswordHandler.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\User;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\UserService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class PasswordHandler extends CrudHandler
|
||||
{
|
||||
/** @var UserService */
|
||||
private $userService;
|
||||
|
||||
public function __construct(UserService $userService)
|
||||
{
|
||||
$this->userService = $userService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function create(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$token = $request->getAttribute('token');
|
||||
try {
|
||||
$data = $this->getRequestData($request);
|
||||
return new JsonResponse($this->userService->changePassword($token->uid, $data['old'], $data['new']));
|
||||
} catch (\Exception $e) {
|
||||
return new JsonResponse([
|
||||
'message' => $e->getMessage()
|
||||
], $e->getCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
16
src/App/Handler/User/UserFactory.php
Normal file
16
src/App/Handler/User/UserFactory.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\User;
|
||||
|
||||
use App\Service\UserService;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class UserFactory
|
||||
{
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
/** @var UserService $userService */
|
||||
$userService = $container->get(UserService::class);
|
||||
return new UserHandler($userService);
|
||||
}
|
||||
}
|
||||
70
src/App/Handler/User/UserHandler.php
Normal file
70
src/App/Handler/User/UserHandler.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Handler\User;
|
||||
|
||||
use ApiLibs\AbstractHandler\CrudHandler;
|
||||
use App\Service\UserService;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Zend\Diactoros\Response\JsonResponse;
|
||||
|
||||
class UserHandler extends CrudHandler
|
||||
{
|
||||
/** @var UserService */
|
||||
private $userService;
|
||||
|
||||
public function __construct(UserService $userService)
|
||||
{
|
||||
$this->userService = $userService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renew auth token
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function getList(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
try {
|
||||
return new JsonResponse($this->userService->getList());
|
||||
} catch (\Exception $e) {
|
||||
return new JsonResponse([
|
||||
'message' => $e->getMessage()
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function get(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$id = $request->getAttribute('id');
|
||||
try {
|
||||
return new JsonResponse($this->userService->get($id));
|
||||
} catch (\Exception $e) {
|
||||
return new JsonResponse([
|
||||
'message' => $e->getMessage()
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ServerRequestInterface $request
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function update(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$id = $request->getAttribute('id');
|
||||
try {
|
||||
$data = $this->getRequestData($request);
|
||||
return new JsonResponse($this->userService->update($id, $data));
|
||||
} catch (\Exception $e) {
|
||||
return new JsonResponse([
|
||||
'message' => $e->getMessage()
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user