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

Feat/#203 impl recommend #207

Merged
merged 2 commits into from
May 29, 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
4 changes: 2 additions & 2 deletions src/main/java/org/capstone/maru/dto/SimpleMemberCardDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ public record SimpleMemberCardDto(
) {

public static SimpleMemberCardDto from(MemberAccount memberAccount, FeatureCard featureCard,
ProfileImage profileImage, Integer score) {
String profileImageUrl, Integer score) {
return SimpleMemberCardDto.builder()
.memberId(memberAccount.getMemberId())
.nickname(memberAccount.getNickname())
.profileImageUrl(profileImage.getFileName())
.profileImageUrl(profileImageUrl)
.location(featureCard.getLocation())
.options(featureCard.getMemberFeatures())
.score(score)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,12 @@ public DormitoryRoomPostDetailDto getDormitoryRoomPostDetail(String memberId, Lo
.map(MemberAccount::getProfileImage)
.forEach(
profileImage -> profileImage.updateFileName(
s3FileService.getPreSignedUrlForLoad(profileImage.getFileName())
s3FileService.getMemberPreSignedUrlForLoad(
gender,
profileImage.getFileName())
)
);

resultEntity
.getRoomImages()
.forEach(
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/org/capstone/maru/service/ProfileService.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public MemberProfileDto getMemberProfile(String memberId, String gender) {
log.info("getMyCard - memberId: {}", memberId);

MemberAccount memberAccount = memberAccountService.searchMemberAccount(memberId);

List<SharedRoomPostResponse> memberPosts = sharedRoomPostService
.getMySharedRoomPosts(memberId)
.stream()
Expand Down Expand Up @@ -230,7 +230,12 @@ public List<SimpleMemberCardDto> getRecommendMember(String memberId, String gend
ProfileImage profileImage = memberAccount.getProfileImage();
FeatureCard featureCard = memberAccount.getMyCard();

return SimpleMemberCardDto.from(memberAccount, featureCard, profileImage,
String imgURL = s3FileService.getMemberPreSignedUrlForLoad(
memberAccount.getGender(),
profileImage.getFileName()
);

return SimpleMemberCardDto.from(memberAccount, featureCard, imgURL,
recommend.getScore());
}).toList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ public StudioRoomPostDetailDto getStudioRoomPostDetail(String memberId, Long pos
.map(MemberAccount::getProfileImage)
.forEach(
profileImage -> profileImage.updateFileName(
s3FileService.getPreSignedUrlForLoad(profileImage.getFileName())
s3FileService.getMemberPreSignedUrlForLoad(
gender,
profileImage.getFileName()
)
)
);
resultEntity
Expand Down