99
1010use Shopware \Core \Framework \Context ;
1111use Shopware \Core \Framework \Log \Package ;
12+ use Shopware \Core \Framework \Routing \ApiRouteScope ;
1213use Shopware \Core \Framework \Routing \RoutingException ;
14+ use Shopware \Core \PlatformRequest ;
1315use SwagMigrationAssistant \Exception \MigrationException ;
1416use SwagMigrationAssistant \Migration \History \HistoryServiceInterface ;
1517use SwagMigrationAssistant \Migration \History \LogGroupingService ;
2224use Symfony \Component \Routing \Attribute \Route ;
2325use Symfony \Component \Routing \Generator \UrlGeneratorInterface ;
2426
25- #[Route(defaults: [' _routeScope ' => [' api ' ]])]
27+ #[Route(defaults: [PlatformRequest:: ATTRIBUTE_ROUTE_SCOPE => [ApiRouteScope:: ID ]])]
2628#[Package('fundamentals@after-sales ' )]
2729class HistoryController extends AbstractController
2830{
@@ -35,7 +37,12 @@ public function __construct(
3537 ) {
3638 }
3739
38- #[Route(path: '/api/_action/migration/get-grouped-logs-of-run ' , name: 'api.admin.migration.get-grouped-logs-of-run ' , methods: ['GET ' ], defaults: ['_acl ' => ['swag_migration.viewer ' ]])]
40+ #[Route(
41+ path: '/api/_action/migration/get-grouped-logs-of-run ' ,
42+ name: 'api.admin.migration.get-grouped-logs-of-run ' ,
43+ defaults: [PlatformRequest::ATTRIBUTE_ACL => ['swag_migration.viewer ' ]],
44+ methods: [Request::METHOD_GET ],
45+ )]
3946 public function getGroupedLogsOfRun (Request $ request , Context $ context ): JsonResponse
4047 {
4148 $ runUuid = $ request ->query ->getAlnum ('runUuid ' );
@@ -60,7 +67,12 @@ public function getGroupedLogsOfRun(Request $request, Context $context): JsonRes
6067 ]);
6168 }
6269
63- #[Route(path: '/api/_action/migration/download-logs-of-run ' , name: 'api.admin.migration.download-logs-of-run ' , methods: ['POST ' ], defaults: ['auth_required ' => false , '_acl ' => ['swag_migration.viewer ' ]])]
70+ #[Route(
71+ path: '/api/_action/migration/download-logs-of-run ' ,
72+ name: 'api.admin.migration.download-logs-of-run ' ,
73+ defaults: ['auth_required ' => false , PlatformRequest::ATTRIBUTE_ACL => ['swag_migration.viewer ' ]],
74+ methods: [Request::METHOD_POST ],
75+ )]
6476 public function downloadLogsOfRun (Request $ request , Context $ context ): StreamedResponse
6577 {
6678 $ runUuid = $ request ->request ->getAlnum ('runUuid ' );
@@ -86,7 +98,12 @@ public function downloadLogsOfRun(Request $request, Context $context): StreamedR
8698 return $ response ;
8799 }
88100
89- #[Route(path: '/api/_action/migration/clear-data-of-run ' , name: 'api.admin.migration.clear-data-of-run ' , methods: ['POST ' ], defaults: ['_acl ' => ['swag_migration.deleter ' ]])]
101+ #[Route(
102+ path: '/api/_action/migration/clear-data-of-run ' ,
103+ name: 'api.admin.migration.clear-data-of-run ' ,
104+ defaults: [PlatformRequest::ATTRIBUTE_ACL => ['swag_migration.deleter ' ]],
105+ methods: [Request::METHOD_POST ],
106+ )]
90107 public function clearDataOfRun (Request $ request , Context $ context ): Response
91108 {
92109 $ runUuid = $ request ->request ->getAlnum ('runUuid ' );
@@ -104,7 +121,12 @@ public function clearDataOfRun(Request $request, Context $context): Response
104121 return new Response ();
105122 }
106123
107- #[Route(path: '/api/_action/migration/is-media-processing ' , name: 'api.admin.migration.is-media-processing ' , methods: ['GET ' ], defaults: ['_acl ' => ['swag_migration_history:read ' ]])]
124+ #[Route(
125+ path: '/api/_action/migration/is-media-processing ' ,
126+ name: 'api.admin.migration.is-media-processing ' ,
127+ defaults: [PlatformRequest::ATTRIBUTE_ACL => ['swag_migration_history:read ' ]],
128+ methods: [Request::METHOD_GET ],
129+ )]
108130 public function isMediaProcessing (): JsonResponse
109131 {
110132 $ result = $ this ->historyService ->isMediaProcessing ();
@@ -115,8 +137,8 @@ public function isMediaProcessing(): JsonResponse
115137 #[Route(
116138 path: '/api/_action/migration/get-log-groups ' ,
117139 name: 'api.admin.migration.get-log-groups ' ,
118- methods : [' GET ' ],
119- defaults : [' _acl ' => [ ' swag_migration.viewer ' ]]
140+ defaults : [PlatformRequest:: ATTRIBUTE_ACL => [ ' swag_migration.viewer ' ] ],
141+ methods : [Request:: METHOD_GET ],
120142 )]
121143 public function getLogGroups (Request $ request , Context $ context ): JsonResponse
122144 {
@@ -166,8 +188,8 @@ public function getLogGroups(Request $request, Context $context): JsonResponse
166188 #[Route(
167189 path: '/api/_action/migration/get-all-log-ids ' ,
168190 name: 'api.admin.migration.get-all-log-ids ' ,
169- methods : [' POST ' ],
170- defaults : [' _acl ' => [ ' swag_migration.viewer ' ]]
191+ defaults : [PlatformRequest:: ATTRIBUTE_ACL => [ ' swag_migration.viewer ' ] ],
192+ methods : [Request:: METHOD_POST ],
171193 )]
172194 public function getAllLogIds (Request $ request ): JsonResponse
173195 {
0 commit comments