From 98b6f782f6810f05a97914782fb24e45d55972fa Mon Sep 17 00:00:00 2001 From: Gyoungmin Kim Date: Thu, 21 Nov 2024 21:55:40 +0900 Subject: [PATCH] feat: add permission checking logic for recap service --- .../main/java/kr/mafoo/photo/service/RecapService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/photo-service/src/main/java/kr/mafoo/photo/service/RecapService.java b/photo-service/src/main/java/kr/mafoo/photo/service/RecapService.java index 2ba5142..14818da 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/service/RecapService.java +++ b/photo-service/src/main/java/kr/mafoo/photo/service/RecapService.java @@ -29,7 +29,7 @@ public class RecapService { @Value("${recap.path.tmp}") private String tmpPath; - private final AlbumService albumService; + private final AlbumPermissionVerifier albumPermissionVerifier; private final PhotoService photoService; private final MemberService memberService; @@ -44,14 +44,14 @@ public Mono createRecap(String albumId, String requestMemberId, String s String recapId = IdGenerator.generate(); - return albumService.findByAlbumId(albumId, requestMemberId) + return albumPermissionVerifier.verifyOwnershipOrAccessPermission(albumId, requestMemberId, DOWNLOAD_ACCESS) .flatMap(albumEntity -> { String albumType = String.valueOf(albumEntity.getType()); return graphics2dService.generateAlbumChipForRecap(recapId, albumEntity.getName(), albumType) - .then(memberService.getMemberInfo(token)) + .then(memberService.getMemberInfoByToken(token)) .flatMap(memberInfo -> generateRecapFrame(recapId, memberInfo.name(), albumType)) - .then(photoService.findAllByAlbumId(albumId, requestMemberId, sort) + .then(photoService.findPhotoListByAlbumId(albumId, requestMemberId, sort) .collectList() .flatMap(photoEntities -> { List photoUrls = photoEntities.stream()