Skip to content

Commit

Permalink
chore: gitignore update
Browse files Browse the repository at this point in the history
  • Loading branch information
minjoon-98 committed Jul 22, 2024
1 parent 025b878 commit 063a2f6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@ out/
.env
src/main/resources/env.properties
/src/main/java/ongjong/namanmoo/config/PropertyConfig.java
/src/main/java/ongjong/namanmoo/config/ServiceProperties.java
/src/main/java/ongjong/namanmoo/config/ServiceProperties.java

/src/main/resources/mooluck-fcm-firebase-adminsdk.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public ApiResponse<Map<String, String>> mergeVoiceClips(@RequestParam("luckyId")
String outputFileName = "merged_output_" + luckyId + ".mp3";
String outputPath = tempDir.resolve(outputFileName).toString();

// 오디오 파일 병합(사이에 0.2초 침묵 삽입)
// 오디오 파일 병합(사이에 0.1초 침묵 삽입)
ffmpegService.mergeAudiosWithSilence(localFiles.stream().map(File::getPath).collect(Collectors.toList()), outputPath, 0.1);

// 병합된 파일 S3업로드
Expand Down
13 changes: 6 additions & 7 deletions src/main/java/ongjong/namanmoo/service/AnswerServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -347,16 +347,16 @@ public MemberPhotosAnswerDto getPhotos(Long luckyId) throws Exception {

// 시작 날짜와 종료 날짜 계산
String startDate = lucky.getChallengeStartDate();
String familyPortraitDate = DateUtil.getInstance().addDaysToStringDate(startDate, 21);
String familyPortraitDate = DateUtil.getInstance().addDaysToStringDate(startDate, 20);
String endDate = DateUtil.getInstance().addDaysToStringDate(startDate, lucky.getLifetime().getDays());

// Lucky 기간 동안의 모든 답변 가져오기
List<Answer> answersWithinDateRange = answerRepository.findByMemberFamilyAndCreateDateBetween(lucky.getFamily(), startDate, endDate);

// 가족 사진에 대한 답변 가져오기
List<Answer> challenge19Answers = answerRepository.findByCreateDateAndMemberFamily(familyPortraitDate, lucky.getFamily());
List<Answer> memberAnswerList = challenge19Answers.stream()
.filter(answer -> members.contains(answer.getMember()))
List<Answer> familyPortraitAnswers = answerRepository.findByCreateDateAndMemberFamily(familyPortraitDate, lucky.getFamily());
List<Answer> memberAnswerList = familyPortraitAnswers.stream()
.filter(answer -> members.contains(answer.getMember()) && Optional.ofNullable(answer.getAnswerContent()).isPresent())
.toList();

// 가족 사진을 위한 랜덤한 답변 선택
Expand All @@ -366,10 +366,9 @@ public MemberPhotosAnswerDto getPhotos(Long luckyId) throws Exception {

// 가족 사진에 대한 답변을 제외한 다른 사진 답변의 URL을 수집하고 null 값 제거
List<String> allOtherPhotos = answersWithinDateRange.stream()
.filter(answer -> !challenge19Answers.contains(answer))
.filter(answer -> answer != familyPhotoAnswer && answer.getAnswerType() == AnswerType.PHOTO)
.filter(answer -> !familyPortraitAnswers.contains(answer))
.filter(answer -> answer != familyPhotoAnswer && answer.getAnswerType() == AnswerType.PHOTO && Optional.ofNullable(answer.getAnswerContent()).isPresent())
.map(Answer::getAnswerContent)
.filter(Objects::nonNull)
.toList();

// 최대 9장의 다른 사진을 랜덤으로 선택
Expand Down

0 comments on commit 063a2f6

Please sign in to comment.