Skip to content

Commit

Permalink
refactor: ADMIN 권한 추가 (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
Choi-JJunho authored Jun 26, 2024
1 parent 4a3e455 commit 20ddf2f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -58,7 +59,7 @@ public interface UploadApi {
ResponseEntity<UploadUrlResponse> 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(
Expand Down Expand Up @@ -89,7 +90,7 @@ ResponseEntity<UploadUrlResponse> getPresignedUrl(
ResponseEntity<UploadFileResponse> 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(
Expand Down Expand Up @@ -120,6 +121,6 @@ ResponseEntity<UploadFileResponse> uploadFile(
ResponseEntity<UploadFilesResponse> uploadFiles(
@Parameter(in = PATH) @PathVariable ImageUploadDomain domain,
@RequestPart List<MultipartFile> files,
@Auth(permit = {OWNER, STUDENT, COOP}, anonymous = true) Integer memberId
@Auth(permit = {OWNER, STUDENT, COOP, ADMIN}, anonymous = true) Integer memberId
);
}
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -36,7 +37,7 @@ public class UploadController implements UploadApi {
public ResponseEntity<UploadUrlResponse> 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);
Expand All @@ -50,7 +51,7 @@ public ResponseEntity<UploadUrlResponse> getPresignedUrl(
public ResponseEntity<UploadFileResponse> 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);
Expand All @@ -64,7 +65,7 @@ public ResponseEntity<UploadFileResponse> uploadFile(
public ResponseEntity<UploadFilesResponse> uploadFiles(
@PathVariable ImageUploadDomain domain,
@RequestPart List<MultipartFile> 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);
Expand Down

0 comments on commit 20ddf2f

Please sign in to comment.