From 84cf995ceeef015929a129adac46c4f91e3a6b3b Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Tue, 24 Sep 2024 14:09:00 +0200 Subject: [PATCH] Move all blob related code into a blob subdir --- src/{Service => Blob}/BlobService.php | 3 ++- src/{Controller => Blob}/BlobSignatureController.php | 3 +-- src/Command/DebugCommand.php | 2 +- src/Command/DeleteAllFilesCommand.php | 2 +- src/Command/DeleteFileCommand.php | 2 +- src/Command/UploadFileCommand.php | 2 +- src/Resources/config/api_resources.yaml | 2 +- src/Resources/config/routes.yaml | 4 ++-- src/Resources/config/services.yaml | 6 ------ src/Service/CabinetService.php | 1 + src/Service/HealthCheck.php | 1 + src/TypesenseSync/TypesenseSync.php | 2 +- 12 files changed, 13 insertions(+), 17 deletions(-) rename src/{Service => Blob}/BlobService.php (99%) rename src/{Controller => Blob}/BlobSignatureController.php (95%) diff --git a/src/Service/BlobService.php b/src/Blob/BlobService.php similarity index 99% rename from src/Service/BlobService.php rename to src/Blob/BlobService.php index bf165e1..f3f0a43 100644 --- a/src/Service/BlobService.php +++ b/src/Blob/BlobService.php @@ -2,10 +2,11 @@ declare(strict_types=1); -namespace Dbp\Relay\CabinetBundle\Service; +namespace Dbp\Relay\CabinetBundle\Blob; use Dbp\Relay\BlobLibrary\Api\BlobApi; use Dbp\Relay\CabinetBundle\Authorization\AuthorizationService; +use Dbp\Relay\CabinetBundle\Service\ConfigurationService; use Dbp\Relay\CoreBundle\Exception\ApiError; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerAwareTrait; diff --git a/src/Controller/BlobSignatureController.php b/src/Blob/BlobSignatureController.php similarity index 95% rename from src/Controller/BlobSignatureController.php rename to src/Blob/BlobSignatureController.php index 734f729..2de09c0 100644 --- a/src/Controller/BlobSignatureController.php +++ b/src/Blob/BlobSignatureController.php @@ -2,10 +2,9 @@ declare(strict_types=1); -namespace Dbp\Relay\CabinetBundle\Controller; +namespace Dbp\Relay\CabinetBundle\Blob; use Dbp\Relay\CabinetBundle\Authorization\AuthorizationService; -use Dbp\Relay\CabinetBundle\Service\BlobService; use Dbp\Relay\CoreBundle\Exception\ApiError; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; diff --git a/src/Command/DebugCommand.php b/src/Command/DebugCommand.php index 28ec20b..ba296d4 100644 --- a/src/Command/DebugCommand.php +++ b/src/Command/DebugCommand.php @@ -4,7 +4,7 @@ namespace Dbp\Relay\CabinetBundle\Command; -use Dbp\Relay\CabinetBundle\Service\BlobService; +use Dbp\Relay\CabinetBundle\Blob\BlobService; use Dbp\Relay\CabinetBundle\Service\CabinetService; use Dbp\Relay\CabinetBundle\TypesenseSync\TypesenseClient; use Symfony\Component\Console\Command\Command; diff --git a/src/Command/DeleteAllFilesCommand.php b/src/Command/DeleteAllFilesCommand.php index d59d2e6..47f24d7 100644 --- a/src/Command/DeleteAllFilesCommand.php +++ b/src/Command/DeleteAllFilesCommand.php @@ -5,7 +5,7 @@ namespace Dbp\Relay\CabinetBundle\Command; use Dbp\Relay\BlobLibrary\Api\BlobApiError; -use Dbp\Relay\CabinetBundle\Service\BlobService; +use Dbp\Relay\CabinetBundle\Blob\BlobService; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputInterface; diff --git a/src/Command/DeleteFileCommand.php b/src/Command/DeleteFileCommand.php index 99d6581..8c670ad 100644 --- a/src/Command/DeleteFileCommand.php +++ b/src/Command/DeleteFileCommand.php @@ -5,7 +5,7 @@ namespace Dbp\Relay\CabinetBundle\Command; use Dbp\Relay\BlobLibrary\Api\BlobApiError; -use Dbp\Relay\CabinetBundle\Service\BlobService; +use Dbp\Relay\CabinetBundle\Blob\BlobService; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; diff --git a/src/Command/UploadFileCommand.php b/src/Command/UploadFileCommand.php index 4314478..54b9251 100644 --- a/src/Command/UploadFileCommand.php +++ b/src/Command/UploadFileCommand.php @@ -5,7 +5,7 @@ namespace Dbp\Relay\CabinetBundle\Command; use Dbp\Relay\BlobLibrary\Api\BlobApiError; -use Dbp\Relay\CabinetBundle\Service\BlobService; +use Dbp\Relay\CabinetBundle\Blob\BlobService; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; diff --git a/src/Resources/config/api_resources.yaml b/src/Resources/config/api_resources.yaml index c5186de..0a46ffd 100644 --- a/src/Resources/config/api_resources.yaml +++ b/src/Resources/config/api_resources.yaml @@ -11,7 +11,7 @@ resources: signature: class: ApiPlatform\Metadata\Get method: GET - controller: Dbp\Relay\CabinetBundle\Controller\BlobSignatureController + controller: Dbp\Relay\CabinetBundle\Blob\BlobSignatureController uriTemplate: "/signature" normalizationContext: groups: [ "Cabinet:output" ] diff --git a/src/Resources/config/routes.yaml b/src/Resources/config/routes.yaml index 5c9f215..de2e805 100644 --- a/src/Resources/config/routes.yaml +++ b/src/Resources/config/routes.yaml @@ -2,6 +2,6 @@ typesense_api: resource: ../../TypesenseApi/ type: annotation -controller_api: - resource: ../../Controller/ +blob_api: + resource: ../../Blob/ type: annotation \ No newline at end of file diff --git a/src/Resources/config/services.yaml b/src/Resources/config/services.yaml index ce69d8b..3080614 100644 --- a/src/Resources/config/services.yaml +++ b/src/Resources/config/services.yaml @@ -9,12 +9,6 @@ services: autowire: true autoconfigure: true - Dbp\Relay\CabinetBundle\Controller\: - tags: [ 'controller.service_arguments' ] - resource: '../../Controller' - autowire: true - autoconfigure: true - Dbp\Relay\CabinetBundle\Service\ConfigurationService: autowire: true autoconfigure: true diff --git a/src/Service/CabinetService.php b/src/Service/CabinetService.php index 56d9eb2..2500264 100644 --- a/src/Service/CabinetService.php +++ b/src/Service/CabinetService.php @@ -6,6 +6,7 @@ use Dbp\Relay\BasePersonBundle\API\PersonProviderInterface; use Dbp\Relay\BasePersonBundle\Entity\Person; +use Dbp\Relay\CabinetBundle\Blob\BlobService; use Dbp\Relay\CoreBundle\Exception\ApiError; use Doctrine\ORM\EntityManagerInterface; use Psr\Log\LoggerAwareInterface; diff --git a/src/Service/HealthCheck.php b/src/Service/HealthCheck.php index 0fed95d..74d576a 100644 --- a/src/Service/HealthCheck.php +++ b/src/Service/HealthCheck.php @@ -4,6 +4,7 @@ namespace Dbp\Relay\CabinetBundle\Service; +use Dbp\Relay\CabinetBundle\Blob\BlobService; use Dbp\Relay\CabinetBundle\TypesenseSync\TypesenseClient; use Dbp\Relay\CoreBundle\HealthCheck\CheckInterface; use Dbp\Relay\CoreBundle\HealthCheck\CheckOptions; diff --git a/src/TypesenseSync/TypesenseSync.php b/src/TypesenseSync/TypesenseSync.php index 7910be6..fb040ce 100644 --- a/src/TypesenseSync/TypesenseSync.php +++ b/src/TypesenseSync/TypesenseSync.php @@ -4,8 +4,8 @@ namespace Dbp\Relay\CabinetBundle\TypesenseSync; +use Dbp\Relay\CabinetBundle\Blob\BlobService; use Dbp\Relay\CabinetBundle\PersonSync\PersonSyncInterface; -use Dbp\Relay\CabinetBundle\Service\BlobService; use Psr\Cache\CacheItemPoolInterface; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerAwareTrait;