Skip to content
Merged
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
@@ -1,5 +1,7 @@
package com.haru.api.domain.meeting.service;

import com.haru.api.domain.lastOpened.entity.UserDocumentLastOpened;
import com.haru.api.domain.lastOpened.repository.UserDocumentLastOpenedRepository;
import com.haru.api.domain.lastOpened.service.UserDocumentLastOpenedService;
import com.haru.api.domain.meeting.converter.MeetingConverter;
import com.haru.api.domain.meeting.dto.MeetingRequestDTO;
Expand Down Expand Up @@ -42,6 +44,8 @@
import java.util.List;
import java.util.stream.Collectors;

import static com.haru.api.domain.lastOpened.entity.enums.DocumentType.AI_MEETING_MANAGER;

@Slf4j
@Service
@RequiredArgsConstructor
Expand All @@ -54,6 +58,7 @@ public class MeetingCommandServiceImpl implements MeetingCommandService {
private final KeywordRepository keywordRepository;
private final ChatGPTClient chatGPTClient;
private final UserDocumentLastOpenedService userDocumentLastOpenedService;
private final UserDocumentLastOpenedRepository userDocumentLastOpenedRepository;
private final WebSocketSessionRegistry webSocketSessionRegistry;
private final SpeechSegmentRepository speechSegmentRepository;
private final MarkdownFileUploader markdownFileUploader;
Expand Down Expand Up @@ -194,11 +199,12 @@ public void adjustProceeding(User user, Meeting meeting, MeetingRequestDTO.meeti
// ์ธ๋„ค์ผ ์ƒ์„ฑ ๋ฐ ์—…๋ฐ์ดํŠธ
String newThumbnailKey = markdownFileUploader.createOrUpdateThumbnail(pdfKey, "meeting" + meeting.getId(), meeting.getThumbnailKeyName());
log.info("ํšŒ์˜๋ก ์ธ๋„ค์ผ ์ƒ์„ฑ/์—…๋ฐ์ดํŠธ ์™„๋ฃŒ. Key: {}", newThumbnailKey);

// Meeting AI ํšŒ์˜๋ก ์ˆ˜์ • ์‹œ ์›Œํฌ์ŠคํŽ˜์ด์Šค์— ์†ํ•ด์žˆ๋Š” ๋ชจ๋“  ์œ ์ €์— ๋Œ€ํ•ด ์ธ๋„ค์ผ ์ด๋ฏธ์ง€ ํ‚ค ์ˆ˜์ •
foundMeeting.initProceedingPdfKeyName(newThumbnailKey);
List<User> usersInWorkspace = userWorkspaceRepository.findUsersByWorkspaceId(foundMeeting.getWorkspace().getId());
userDocumentLastOpenedService.updateRecordsThumbnailForWorkspaceUsers(usersInWorkspace, foundMeeting);
List<UserDocumentLastOpened> foundLastOpenedList = userDocumentLastOpenedRepository.findByDocumentIdAndDocumentType(foundMeeting.getId(), AI_MEETING_MANAGER);
foundLastOpenedList.forEach(userDocumentLastOpened -> {
userDocumentLastOpened.updateThumbnailKeyName(newThumbnailKey);
});

} catch (Exception e) {
log.error("meetingId: {}์˜ PDF ๋˜๋Š” ์ธ๋„ค์ผ ์ƒ์„ฑ/์—…๋กœ๋“œ ์ค‘ ์—๋Ÿฌ ๋ฐœ์ƒ", meeting.getId(), e);
throw new RuntimeException("ํŒŒ์ผ ๊ฐฑ์‹  ์ค‘ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.", e);
Expand Down Expand Up @@ -275,16 +281,23 @@ public void processAfterMeeting(AudioSessionBuffer sessionBuffer) {
currentMeeting.initThumbnailKeyName(newThumbnailKey); // Meeting ์—”ํ‹ฐํ‹ฐ์— ์ธ๋„ค์ผ ํ‚ค ์ €์žฅ
log.info("ํšŒ์˜๋ก ์ธ๋„ค์ผ ์ƒ์„ฑ/์—…๋ฐ์ดํŠธ ์™„๋ฃŒ. Key: {}", newThumbnailKey);


List<UserDocumentLastOpened> foundLastOpenedList = userDocumentLastOpenedRepository.findByDocumentIdAndDocumentType(currentMeeting.getId(), AI_MEETING_MANAGER);
foundLastOpenedList.forEach(userDocumentLastOpened -> {
userDocumentLastOpened.updateThumbnailKeyName(newThumbnailKey);
});



} catch (Exception e) {
log.error("meetingId: {}์˜ PDF ๋˜๋Š” ์ธ๋„ค์ผ ์ƒ์„ฑ/์—…๋กœ๋“œ ์ค‘ ์—๋Ÿฌ ๋ฐœ์ƒ", currentMeeting.getId(), e);
throw new MeetingHandler(ErrorStatus.MEETING_FILE_UPLOAD_FAIL);
}
log.info("meetingId: {}์˜ AI ํšŒ์˜๋ก ์ƒ์„ฑ ๋ฐ ์ €์žฅ ์™„๋ฃŒ.", currentMeeting.getId());
} else {
log.warn("meetingId: {}์˜ AI ๋ถ„์„ ๊ฒฐ๊ณผ๊ฐ€ ๋น„์–ด์žˆ์Šต๋‹ˆ๋‹ค.", currentMeeting.getId());
}



} else {
log.warn("meetingId: {}์— ์ฒ˜๋ฆฌํ•  ์˜ค๋””์˜ค ๋ฐ์ดํ„ฐ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.", currentMeeting.getId());
}
Expand Down