Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: ADMIN 권한 추가 #638

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading