Skip to content

Commit

Permalink
Merge pull request #115 from Na-o-man/feat/#112/photo-download-tag-api
Browse files Browse the repository at this point in the history
[FEAT] 사진 다운로드시 다운로드 이력 추가 기능 구현
  • Loading branch information
bflykky authored Aug 13, 2024
2 parents 6cb17da + 76026fb commit 78cbf35
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public SamplePhotoUploadInfo uploadSamplePhotoList(UploadSamplePhotoRequest requ
.toList();

List<String> samplePhotoNameList = samplePhotoList.stream()
.map(samplePhoto -> samplePhoto.getName())
.map(SamplePhoto::getName)
.toList();

// Elasticsearch에 sample_face_vector를 저장하기 위한 트리거 실행
Expand Down Expand Up @@ -205,6 +205,9 @@ public PhotoDownloadUrlListInfo getPhotoDownloadUrlList(List<Long> photoIdList,
.map(Photo::getUrl)
.collect(Collectors.toList());

// 사진 다운로드 이력 추가
photoEsClientRepository.addDownloadTag(photoUrlList, member.getId());

return photoConverter.toPhotoDownloadUrlListInfo(photoUrlList);
}

Expand All @@ -226,11 +229,14 @@ public PhotoDownloadUrlListInfo getPhotoDownloadUrlListByProfile(Long shareGroup
pageable = pageable.next();
}

List<String> photUrlList = photoEsList.stream()
List<String> photoUrlList = photoEsList.stream()
.map(PhotoEs::getUrl)
.collect(Collectors.toList());

return photoConverter.toPhotoDownloadUrlListInfo(photUrlList);
// 사진 다운로드 이력 추가
photoEsClientRepository.addDownloadTag(photoUrlList, member.getId());

return photoConverter.toPhotoDownloadUrlListInfo(photoUrlList);
}

@Override
Expand All @@ -250,11 +256,14 @@ public PhotoDownloadUrlListInfo getEtcPhotoDownloadUrlList(Long shareGroupId, Me
pageable = pageable.next();
}

List<String> photUrlList = photoEsList.stream()
List<String> photoUrlList = photoEsList.stream()
.map(PhotoEs::getUrl)
.collect(Collectors.toList());

return photoConverter.toPhotoDownloadUrlListInfo(photUrlList);
// 사진 다운로드 이력 추가
photoEsClientRepository.addDownloadTag(photoUrlList, member.getId());

return photoConverter.toPhotoDownloadUrlListInfo(photoUrlList);
}

@Override
Expand Down

0 comments on commit 78cbf35

Please sign in to comment.