From 063a2f6c92d92cd581370ef81413a9fe33c946f9 Mon Sep 17 00:00:00 2001 From: minjoon-98 <4kmj54321@gmail.com> Date: Mon, 22 Jul 2024 22:16:59 +0900 Subject: [PATCH] chore: gitignore update --- .gitignore | 4 +++- .../namanmoo/controller/RecapController.java | 2 +- .../ongjong/namanmoo/service/AnswerServiceImpl.java | 13 ++++++------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 296265d..af46caf 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file +/src/main/java/ongjong/namanmoo/config/ServiceProperties.java + +/src/main/resources/mooluck-fcm-firebase-adminsdk.json \ No newline at end of file diff --git a/src/main/java/ongjong/namanmoo/controller/RecapController.java b/src/main/java/ongjong/namanmoo/controller/RecapController.java index bfc3589..0fe6e82 100644 --- a/src/main/java/ongjong/namanmoo/controller/RecapController.java +++ b/src/main/java/ongjong/namanmoo/controller/RecapController.java @@ -172,7 +172,7 @@ public ApiResponse> 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업로드 diff --git a/src/main/java/ongjong/namanmoo/service/AnswerServiceImpl.java b/src/main/java/ongjong/namanmoo/service/AnswerServiceImpl.java index d8bbe0e..2b380ed 100644 --- a/src/main/java/ongjong/namanmoo/service/AnswerServiceImpl.java +++ b/src/main/java/ongjong/namanmoo/service/AnswerServiceImpl.java @@ -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 answersWithinDateRange = answerRepository.findByMemberFamilyAndCreateDateBetween(lucky.getFamily(), startDate, endDate); // 가족 사진에 대한 답변 가져오기 - List challenge19Answers = answerRepository.findByCreateDateAndMemberFamily(familyPortraitDate, lucky.getFamily()); - List memberAnswerList = challenge19Answers.stream() - .filter(answer -> members.contains(answer.getMember())) + List familyPortraitAnswers = answerRepository.findByCreateDateAndMemberFamily(familyPortraitDate, lucky.getFamily()); + List memberAnswerList = familyPortraitAnswers.stream() + .filter(answer -> members.contains(answer.getMember()) && Optional.ofNullable(answer.getAnswerContent()).isPresent()) .toList(); // 가족 사진을 위한 랜덤한 답변 선택 @@ -366,10 +366,9 @@ public MemberPhotosAnswerDto getPhotos(Long luckyId) throws Exception { // 가족 사진에 대한 답변을 제외한 다른 사진 답변의 URL을 수집하고 null 값 제거 List 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장의 다른 사진을 랜덤으로 선택