Skip to content
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
Expand Up @@ -230,16 +230,16 @@ public static DiaryResponseDTO.MapResultDTO toMapResultDTO(Diaries diary, String
.build();
}

public static DiaryResponseDTO.RemindDiaryDTO toRemindDiaryDTO(Diaries diary, String presignedUrl, boolean isSingle) {
public static DiaryResponseDTO.RemindDiaryDTO toRemindDiaryDTO(Diaries diary, String presignedUrl, boolean isSingle, DecryptedLocation location) {
return DiaryResponseDTO.RemindDiaryDTO.builder()
.diaryId(diary.getId())
.diaryCategoryId(diary.getDiaryCategories().getId())
.date(diary.getDate())
.content(diary.getContent())
.image(presignedUrl)
.color(diary.getDiaryCategories().getColor())
.latitude(diary.getLocation().getY())
.longitude(diary.getLocation().getX())
.latitude(location.lat())
.longitude(location.lng())
.isSingle(isSingle)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,19 @@ public DiaryResponseDTO.RemindDiaryDTO getRemindDiary(Long diaryId) {
presignedUrl = s3Manager.generatePresignedUrlForView(objectKey);
}

DecryptedLocation location = envelopeCryptoService.decryptLatLng(
diary.getLatCipher(),
diary.getIvLat(),
diary.getLngCipher(),
diary.getIvLng(),
diary.getDekWrapped(),
diary.getKmsKeyId(),
diary.getUsers().getId()
);

Long count = diaryRepository.countByUsersAndClusterId(user, diary.getClusterId());

return DiaryConverter.toRemindDiaryDTO(diary, presignedUrl, count > 1);
return DiaryConverter.toRemindDiaryDTO(diary, presignedUrl, count > 1, location);
}

@Override
Expand Down