Merge pull request #36 from hwanny1128/feat/meeting

Chore: 회의록 수정 - AI 요약 정보 추가
This commit is contained in:
Cho Yoon Jin
2025-10-29 18:03:16 +09:00
committed by GitHub
4 changed files with 347 additions and 1 deletions
@@ -120,6 +120,35 @@ public class AgendaSectionService {
return updatedEntity.toDomain();
}
/**
* 안건 섹션 요약 및 AI 요약 수정
* @param agendaId 안건 ID
* @param summary 새로운 요약 내용
* @param aiSummary AI 요약
* @return 수정된 안건 섹션
*/
@Transactional
public AgendaSection updateAgendaSummaryWithAi(String agendaId, String summary, String aiSummary) {
log.info("안건 섹션 요약 및 AI 요약 수정 - agendaId: {}, summary length: {}, aiSummary length: {}",
agendaId, summary != null ? summary.length() : 0, aiSummary != null ? aiSummary.length() : 0);
// 먼저 존재 여부 확인
AgendaSectionEntity entity = agendaSectionRepository.findById(agendaId)
.orElseThrow(() -> new BusinessException(ErrorCode.AGENDA_SECTION_NOT_FOUND,
"안건 섹션을 찾을 수 없습니다: " + agendaId));
// Native Query로 summary와 ai_summary_short 업데이트
agendaSectionRepository.updateSummaryAndAiSummaryById(agendaId, summary, aiSummary);
// 업데이트된 엔티티 다시 조회
AgendaSectionEntity updatedEntity = agendaSectionRepository.findById(agendaId)
.orElseThrow(() -> new BusinessException(ErrorCode.AGENDA_SECTION_NOT_FOUND,
"업데이트된 안건 섹션을 찾을 수 없습니다: " + agendaId));
log.info("안건 섹션 요약 및 AI 요약 수정 완료 - agendaId: {}", agendaId);
return updatedEntity.toDomain();
}
/**
* 여러 안건 섹션의 요약을 한 번에 수정
* @param updateItems 안건 ID와 새로운 요약 내용의 목록
@@ -131,7 +160,15 @@ public class AgendaSectionService {
log.info("안건 섹션 일괄 수정 - 개수: {}", updateItems.size());
List<AgendaSection> updatedSections = updateItems.stream()
.map(item -> updateAgendaSummary(item.getAgendaId(), item.getContent()))
.map(item -> {
if (item.getAiSummary() != null) {
// AI 요약이 포함된 경우
return updateAgendaSummaryWithAi(item.getAgendaId(), item.getContent(), item.getAiSummary());
} else {
// AI 요약이 없는 경우 기존 메소드 사용
return updateAgendaSummary(item.getAgendaId(), item.getContent());
}
})
.collect(Collectors.toList());
log.info("안건 섹션 일괄 수정 완료 - 개수: {}", updatedSections.size());
@@ -40,5 +40,10 @@ public class UpdateAgendaSectionsRequest {
*/
@NotBlank(message = "안건 내용은 필수입니다")
private String content;
/**
* AI 요약 (agenda_sections.ai_summary_short)
*/
private String aiSummary;
}
}
@@ -38,4 +38,17 @@ public interface AgendaSectionRepository extends JpaRepository<AgendaSectionEnti
@Query(value = "UPDATE agenda_sections SET summary = :summary, updated_at = CURRENT_TIMESTAMP WHERE id = :agendaId",
nativeQuery = true)
void updateSummaryById(@Param("agendaId") String agendaId, @Param("summary") String summary);
/**
* 안건 섹션 요약 및 AI 요약 업데이트 (Native Query 사용)
* @param agendaId 안건 ID
* @param summary 요약 내용
* @param aiSummaryShort AI 요약
*/
@Modifying
@Query(value = "UPDATE agenda_sections SET summary = :summary, ai_summary_short = :aiSummaryShort, updated_at = CURRENT_TIMESTAMP WHERE id = :agendaId",
nativeQuery = true)
void updateSummaryAndAiSummaryById(@Param("agendaId") String agendaId,
@Param("summary") String summary,
@Param("aiSummaryShort") String aiSummaryShort);
}