mirror of
https://github.com/hwanny1128/HGZero.git
synced 2026-01-21 10:16:24 +00:00
feat: AgendaSection todos JSON 파싱 로직 추가
- ObjectMapper를 사용하여 todos JSON 문자열을 파싱
- TodoJson DTO 클래스 추가
- parseTodosJson() 메서드 구현
- MeetingStatisticsResponse에서 실제 Todo 개수 계산
- 에러 처리 로직 추가 (파싱 실패 시 빈 리스트 반환)
JSON 구조: [{title, assignee, dueDate, description, priority}]
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
093b8751d5
commit
77ad99bdc7
@ -650,7 +650,7 @@ code + .copy-button {
|
||||
<script type="text/javascript">
|
||||
function configurationCacheProblems() { return (
|
||||
// begin-report-data
|
||||
{"diagnostics":[{"locations":[{"path":"/Users/jominseo/HGZero/common/src/main/java/com/unicorn/hgzero/common/security/JwtTokenProvider.java"},{"taskPath":":common:compileJava"}],"problem":[{"text":"/Users/jominseo/HGZero/common/src/main/java/com/unicorn/hgzero/common/security/JwtTokenProvider.java uses or overrides a deprecated API."}],"severity":"ADVICE","problemDetails":[{"text":"Note: /Users/jominseo/HGZero/common/src/main/java/com/unicorn/hgzero/common/security/JwtTokenProvider.java uses or overrides a deprecated API."}],"contextualLabel":"/Users/jominseo/HGZero/common/src/main/java/com/unicorn/hgzero/common/security/JwtTokenProvider.java uses or overrides a deprecated API.","problemId":[{"name":"java","displayName":"Java compilation"},{"name":"compilation","displayName":"Compilation"},{"name":"compiler.note.deprecated.filename","displayName":"/Users/jominseo/HGZero/common/src/main/java/com/unicorn/hgzero/common/security/JwtTokenProvider.java uses or overrides a deprecated API."}]},{"locations":[{"path":"/Users/jominseo/HGZero/common/src/main/java/com/unicorn/hgzero/common/security/JwtTokenProvider.java"},{"taskPath":":common:compileJava"}],"problem":[{"text":"Recompile with -Xlint:deprecation for details."}],"severity":"ADVICE","problemDetails":[{"text":"Note: Recompile with -Xlint:deprecation for details."}],"contextualLabel":"Recompile with -Xlint:deprecation for details.","problemId":[{"name":"java","displayName":"Java compilation"},{"name":"compilation","displayName":"Compilation"},{"name":"compiler.note.deprecated.recompile","displayName":"Recompile with -Xlint:deprecation for details."}]},{"locations":[{"path":"/Users/jominseo/HGZero/meeting/src/main/java/com/unicorn/hgzero/meeting/infra/dto/request/InviteParticipantRequest.java"},{"taskPath":":meeting:compileJava"}],"problem":[{"text":"Some input files use or override a deprecated API."}],"severity":"ADVICE","problemDetails":[{"text":"Note: Some input files use or override a deprecated API."}],"contextualLabel":"Some input files use or override a deprecated API.","problemId":[{"name":"java","displayName":"Java compilation"},{"name":"compilation","displayName":"Compilation"},{"name":"compiler.note.deprecated.plural","displayName":"Some input files use or override a deprecated API."}]},{"locations":[{"path":"/Users/jominseo/HGZero/meeting/src/main/java/com/unicorn/hgzero/meeting/infra/dto/request/InviteParticipantRequest.java"},{"taskPath":":meeting:compileJava"}],"problem":[{"text":"Recompile with -Xlint:deprecation for details."}],"severity":"ADVICE","problemDetails":[{"text":"Note: Recompile with -Xlint:deprecation for details."}],"contextualLabel":"Recompile with -Xlint:deprecation for details.","problemId":[{"name":"java","displayName":"Java compilation"},{"name":"compilation","displayName":"Compilation"},{"name":"compiler.note.deprecated.recompile","displayName":"Recompile with -Xlint:deprecation for details."}]},{"locations":[{"taskPath":":meeting:test"}],"problem":[{"text":"The automatic loading of test framework implementation dependencies has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This is scheduled to be removed in Gradle 9.0."}],"contextualLabel":"The automatic loading of test framework implementation dependencies has been deprecated.","documentationLink":"https://docs.gradle.org/8.14/userguide/upgrading_version_8.html#test_framework_implementation_dependencies","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"the-automatic-loading-of-test-framework-implementation-dependencies","displayName":"The automatic loading of test framework implementation dependencies has been deprecated."}],"solutions":[[{"text":"Declare the desired test framework directly on the test suite or explicitly declare the test framework implementation dependencies on the test's runtime classpath."}]]},{"locations":[{},{"taskPath":":meeting:test"}],"problem":[{"text":"No test executed. This behavior has been deprecated."}],"severity":"WARNING","problemDetails":[{"text":"This will fail with an error in Gradle 9.0."}],"contextualLabel":"No test executed. This behavior has been deprecated.","documentationLink":"https://docs.gradle.org/8.14/userguide/upgrading_version_8.html#test_task_fail_on_no_test_executed","problemId":[{"name":"deprecation","displayName":"Deprecation"},{"name":"no-test-executed-this-behavior-has-been-deprecated","displayName":"No test executed. This behavior has been deprecated."}],"solutions":[[{"text":"There are test sources present but no test was executed. Please check your test configuration."}]]}],"problemsReport":{"totalProblemCount":6,"buildName":"hgzero","requestedTasks":"build","documentationLink":"https://docs.gradle.org/8.14/userguide/reporting_problems.html","documentationLinkCaption":"Problem report","summaries":[]}}
|
||||
{"diagnostics":[{"locations":[{"path":"/Users/jominseo/HGZero/common/src/main/java/com/unicorn/hgzero/common/security/JwtTokenProvider.java"},{"taskPath":":common:compileJava"}],"problem":[{"text":"/Users/jominseo/HGZero/common/src/main/java/com/unicorn/hgzero/common/security/JwtTokenProvider.java uses or overrides a deprecated API."}],"severity":"ADVICE","problemDetails":[{"text":"Note: /Users/jominseo/HGZero/common/src/main/java/com/unicorn/hgzero/common/security/JwtTokenProvider.java uses or overrides a deprecated API."}],"contextualLabel":"/Users/jominseo/HGZero/common/src/main/java/com/unicorn/hgzero/common/security/JwtTokenProvider.java uses or overrides a deprecated API.","problemId":[{"name":"java","displayName":"Java compilation"},{"name":"compilation","displayName":"Compilation"},{"name":"compiler.note.deprecated.filename","displayName":"/Users/jominseo/HGZero/common/src/main/java/com/unicorn/hgzero/common/security/JwtTokenProvider.java uses or overrides a deprecated API."}]},{"locations":[{"path":"/Users/jominseo/HGZero/common/src/main/java/com/unicorn/hgzero/common/security/JwtTokenProvider.java"},{"taskPath":":common:compileJava"}],"problem":[{"text":"Recompile with -Xlint:deprecation for details."}],"severity":"ADVICE","problemDetails":[{"text":"Note: Recompile with -Xlint:deprecation for details."}],"contextualLabel":"Recompile with -Xlint:deprecation for details.","problemId":[{"name":"java","displayName":"Java compilation"},{"name":"compilation","displayName":"Compilation"},{"name":"compiler.note.deprecated.recompile","displayName":"Recompile with -Xlint:deprecation for details."}]},{"locations":[{"path":"/Users/jominseo/HGZero/meeting/src/main/java/com/unicorn/hgzero/meeting/infra/dto/request/InviteParticipantRequest.java"},{"taskPath":":meeting:compileJava"}],"problem":[{"text":"Some input files use or override a deprecated API."}],"severity":"ADVICE","problemDetails":[{"text":"Note: Some input files use or override a deprecated API."}],"contextualLabel":"Some input files use or override a deprecated API.","problemId":[{"name":"java","displayName":"Java compilation"},{"name":"compilation","displayName":"Compilation"},{"name":"compiler.note.deprecated.plural","displayName":"Some input files use or override a deprecated API."}]},{"locations":[{"path":"/Users/jominseo/HGZero/meeting/src/main/java/com/unicorn/hgzero/meeting/infra/dto/request/InviteParticipantRequest.java"},{"taskPath":":meeting:compileJava"}],"problem":[{"text":"Recompile with -Xlint:deprecation for details."}],"severity":"ADVICE","problemDetails":[{"text":"Note: Recompile with -Xlint:deprecation for details."}],"contextualLabel":"Recompile with -Xlint:deprecation for details.","problemId":[{"name":"java","displayName":"Java compilation"},{"name":"compilation","displayName":"Compilation"},{"name":"compiler.note.deprecated.recompile","displayName":"Recompile with -Xlint:deprecation for details."}]}],"problemsReport":{"totalProblemCount":4,"buildName":"hgzero","requestedTasks":":meeting:compileJava","documentationLink":"https://docs.gradle.org/8.14/userguide/reporting_problems.html","documentationLinkCaption":"Problem report","summaries":[]}}
|
||||
// end-report-data
|
||||
);}
|
||||
</script>
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.unicorn.hgzero.meeting.infra.controller;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.unicorn.hgzero.common.dto.ApiResponse;
|
||||
import com.unicorn.hgzero.meeting.biz.domain.AgendaSection;
|
||||
import com.unicorn.hgzero.meeting.biz.domain.Meeting;
|
||||
@ -19,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -36,6 +39,7 @@ public class MeetingAiController {
|
||||
private final MinutesService minutesService;
|
||||
private final AgendaSectionService agendaSectionService;
|
||||
private final MeetingService meetingService;
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
@GetMapping("/{meetingId}/ai/participant-minutes")
|
||||
@Operation(
|
||||
@ -162,8 +166,10 @@ public class MeetingAiController {
|
||||
}
|
||||
|
||||
private AgendaSectionResponse.AgendaSectionItem convertToAgendaSectionItem(AgendaSection section) {
|
||||
// todos와 pendingItems는 JSON 문자열이므로 파싱 필요 (현재는 null로 처리)
|
||||
List<AgendaSectionResponse.AgendaSectionItem.TodoItem> todos = null;
|
||||
// todos JSON 파싱
|
||||
List<AgendaSectionResponse.AgendaSectionItem.TodoItem> todos = parseTodosJson(section.getTodos());
|
||||
|
||||
// pendingItems는 사용하지 않으므로 null 처리
|
||||
List<String> pendingItems = null;
|
||||
|
||||
return AgendaSectionResponse.AgendaSectionItem.builder()
|
||||
@ -180,12 +186,57 @@ public class MeetingAiController {
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* todos JSON 문자열을 파싱하여 TodoItem 리스트로 변환
|
||||
* JSON 구조: [{"title": "...", "assignee": "...", "dueDate": "...", "description": "...", "priority": "..."}]
|
||||
*/
|
||||
private List<AgendaSectionResponse.AgendaSectionItem.TodoItem> parseTodosJson(String todosJson) {
|
||||
if (todosJson == null || todosJson.trim().isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
try {
|
||||
List<TodoJson> todoJsonList = objectMapper.readValue(
|
||||
todosJson,
|
||||
new TypeReference<List<TodoJson>>() {}
|
||||
);
|
||||
|
||||
return todoJsonList.stream()
|
||||
.map(json -> AgendaSectionResponse.AgendaSectionItem.TodoItem.builder()
|
||||
.title(json.getTitle())
|
||||
.assignee(json.getAssignee())
|
||||
.dueDate(json.getDueDate())
|
||||
.description(json.getDescription())
|
||||
.priority(json.getPriority())
|
||||
.build())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to parse todos JSON: {}", todosJson, e);
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* JSON 파싱을 위한 임시 DTO
|
||||
*/
|
||||
@lombok.Data
|
||||
private static class TodoJson {
|
||||
private String title;
|
||||
private String assignee;
|
||||
private String dueDate;
|
||||
private String description;
|
||||
private String priority;
|
||||
}
|
||||
|
||||
private MeetingStatisticsResponse buildMeetingStatistics(String meetingId) {
|
||||
Meeting meeting = meetingService.getMeeting(meetingId);
|
||||
List<AgendaSection> sections = agendaSectionService.getAgendaSectionsByMeetingId(meetingId);
|
||||
|
||||
// AI가 추출한 Todo 수 계산 (todos는 JSON 문자열이므로 현재는 0으로 처리)
|
||||
int todoCount = 0;
|
||||
// AI가 추출한 Todo 수 계산
|
||||
int todoCount = sections.stream()
|
||||
.mapToInt(s -> parseTodosJson(s.getTodos()).size())
|
||||
.sum();
|
||||
|
||||
// 회의 시간 계산
|
||||
Integer durationMinutes = null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user