From f95ecc369203f436d03f533c466e2966b024f18a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8E=E1=85=AC=E1=84=8C=E1=85=AE=E1=86=AB=E1=84=92?= =?UTF-8?q?=E1=85=A9?= Date: Wed, 26 Jun 2024 21:49:00 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20ADMIN=20=EA=B6=8C=ED=95=9C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../koin/global/domain/upload/controller/UploadApi.java | 7 ++++--- .../global/domain/upload/controller/UploadController.java | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/in/koreatech/koin/global/domain/upload/controller/UploadApi.java b/src/main/java/in/koreatech/koin/global/domain/upload/controller/UploadApi.java index 050d73a4c..6d45a6724 100644 --- a/src/main/java/in/koreatech/koin/global/domain/upload/controller/UploadApi.java +++ b/src/main/java/in/koreatech/koin/global/domain/upload/controller/UploadApi.java @@ -1,5 +1,6 @@ package in.koreatech.koin.global.domain.upload.controller; +import static in.koreatech.koin.domain.user.model.UserType.ADMIN; import static in.koreatech.koin.domain.user.model.UserType.COOP; import static in.koreatech.koin.domain.user.model.UserType.OWNER; import static in.koreatech.koin.domain.user.model.UserType.STUDENT; @@ -58,7 +59,7 @@ public interface UploadApi { ResponseEntity getPresignedUrl( @PathVariable ImageUploadDomain domain, @RequestBody @Valid UploadUrlRequest request, - @Auth(permit = {OWNER, STUDENT, COOP}, anonymous = true) Integer memberId + @Auth(permit = {OWNER, STUDENT, COOP, ADMIN}, anonymous = true) Integer memberId ); @ApiResponses( @@ -89,7 +90,7 @@ ResponseEntity getPresignedUrl( ResponseEntity uploadFile( @Parameter(in = PATH) @PathVariable ImageUploadDomain domain, @RequestPart MultipartFile multipartFile, - @Auth(permit = {OWNER, STUDENT, COOP}, anonymous = true) Integer memberId + @Auth(permit = {OWNER, STUDENT, COOP, ADMIN}, anonymous = true) Integer memberId ); @ApiResponses( @@ -120,6 +121,6 @@ ResponseEntity uploadFile( ResponseEntity uploadFiles( @Parameter(in = PATH) @PathVariable ImageUploadDomain domain, @RequestPart List files, - @Auth(permit = {OWNER, STUDENT, COOP}, anonymous = true) Integer memberId + @Auth(permit = {OWNER, STUDENT, COOP, ADMIN}, anonymous = true) Integer memberId ); } diff --git a/src/main/java/in/koreatech/koin/global/domain/upload/controller/UploadController.java b/src/main/java/in/koreatech/koin/global/domain/upload/controller/UploadController.java index 09e6749c0..6ddfcf870 100644 --- a/src/main/java/in/koreatech/koin/global/domain/upload/controller/UploadController.java +++ b/src/main/java/in/koreatech/koin/global/domain/upload/controller/UploadController.java @@ -1,5 +1,6 @@ package in.koreatech.koin.global.domain.upload.controller; +import static in.koreatech.koin.domain.user.model.UserType.ADMIN; import static in.koreatech.koin.domain.user.model.UserType.COOP; import static in.koreatech.koin.domain.user.model.UserType.OWNER; import static in.koreatech.koin.domain.user.model.UserType.STUDENT; @@ -36,7 +37,7 @@ public class UploadController implements UploadApi { public ResponseEntity getPresignedUrl( @PathVariable ImageUploadDomain domain, @RequestBody @Valid UploadUrlRequest request, - @Auth(permit = {OWNER, STUDENT, COOP}, anonymous = true) Integer memberId + @Auth(permit = {OWNER, STUDENT, COOP, ADMIN}, anonymous = true) Integer memberId ) { var response = uploadService.getPresignedUrl(domain, request); return ResponseEntity.ok(response); @@ -50,7 +51,7 @@ public ResponseEntity getPresignedUrl( public ResponseEntity uploadFile( @PathVariable ImageUploadDomain domain, @RequestPart MultipartFile multipartFile, - @Auth(permit = {OWNER, STUDENT, COOP}, anonymous = true) Integer memberId + @Auth(permit = {OWNER, STUDENT, COOP, ADMIN}, anonymous = true) Integer memberId ) { var response = uploadService.uploadFile(domain, multipartFile); return new ResponseEntity<>(response, HttpStatus.CREATED); @@ -64,7 +65,7 @@ public ResponseEntity uploadFile( public ResponseEntity uploadFiles( @PathVariable ImageUploadDomain domain, @RequestPart List files, - @Auth(permit = {OWNER, STUDENT, COOP}, anonymous = true) Integer memberId + @Auth(permit = {OWNER, STUDENT, COOP, ADMIN}, anonymous = true) Integer memberId ) { var response = uploadService.uploadFiles(domain, files); return new ResponseEntity<>(response, HttpStatus.CREATED);