Skip to content

Commit

Permalink
Merge pull request #216 from capstone-maru/feat/#193-tokenImpl
Browse files Browse the repository at this point in the history
feat #193 - pre-signed 중복 이슈 해결
  • Loading branch information
leejh7 authored May 29, 2024
2 parents 4ac6625 + 5499460 commit 50ac562
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.capstone.maru.service;

import java.util.List;
import java.util.Objects;
import java.util.Optional;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -139,6 +140,18 @@ public DormitoryRoomPostDetailDto getDormitoryRoomPostDetail(String memberId, Lo

Long viewCount = viewCountService.increaseValue(SharedViewCountCacheKey.from(postId));

String publisherId = resultEntity.getPublisherAccount().getMemberId();

resultEntity
.getPublisherAccount()
.getProfileImage()
.updateFileName(
s3FileService.getMemberPreSignedUrlForLoad(
resultEntity.getPublisherGender(), resultEntity.getPublisherAccount()
.getProfileImage().getFileName()
)
);

resultEntity
.getPublisherAccount()
.getProfileImage()
Expand All @@ -153,6 +166,7 @@ public DormitoryRoomPostDetailDto getDormitoryRoomPostDetail(String memberId, Lo
.getSharedRoomPostRecruits()
.stream()
.map(Participation::getRecruitedMemberAccount)
.filter(memberAccount -> !Objects.equals(memberAccount.getMemberId(), publisherId))
.map(MemberAccount::getProfileImage)
.forEach(
profileImage -> profileImage.updateFileName(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.capstone.maru.service;

import java.util.List;
import java.util.Objects;
import java.util.Optional;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -196,20 +197,23 @@ public StudioRoomPostDetailDto getStudioRoomPostDetail(String memberId, Long pos

log.info(gender);

String publisherId = resultEntity.getPublisherAccount().getMemberId();

resultEntity
.getPublisherAccount()
.getProfileImage()
.updateFileName(
s3FileService.getMemberPreSignedUrlForLoad(
resultEntity.getPublisherGender(), resultEntity.getPublisherAccount()
.getProfileImage().getFileName()
.getProfileImage().getFileName()
)
);

resultEntity
.getSharedRoomPostRecruits()
.stream()
.map(Participation::getRecruitedMemberAccount)
.filter(memberAccount -> !Objects.equals(memberAccount.getMemberId(), publisherId))
.map(MemberAccount::getProfileImage)
.forEach(
profileImage ->
Expand Down

0 comments on commit 50ac562

Please sign in to comment.