@startuml meeting-대시보드조회 !theme mono title Meeting Service - 대시보드조회 내부 시퀀스 participant "DashboardController" as Controller participant "DashboardService" as Service participant "MeetingRepository" as MeetingRepo participant "TodoRepository" as TodoRepo participant "MinutesRepository" as MinutesRepo database "Redis Cache<>" as Cache database "Meeting DB<>" as DB [-> Controller: GET /dashboard activate Controller note over Controller 사용자 정보는 헤더에서 추출 (userId, userName, email) end note Controller -> Service: getDashboardData(userId) activate Service ' 캐시 조회 Service -> Cache: GET dashboard:{userId} activate Cache Cache --> Service: 캐시 조회 결과 deactivate Cache alt Cache Hit Service --> Service: 캐시 데이터 반환 else Cache Miss ' 예정된 회의 조회 Service -> MeetingRepo: findUpcomingMeetings(userId) activate MeetingRepo MeetingRepo -> DB: SELECT meetings\nWHERE userId = ? AND status = 'SCHEDULED'\nAND startTime > NOW()\nORDER BY startTime LIMIT 3 activate DB DB --> MeetingRepo: 예정된 회의 목록 deactivate DB MeetingRepo --> Service: List deactivate MeetingRepo ' 진행 중 Todo 조회 Service -> TodoRepo: findActiveTodos(userId) activate TodoRepo TodoRepo -> DB: SELECT todos\nWHERE assignee = ? AND status = 'IN_PROGRESS'\nORDER BY dueDate LIMIT 3 activate DB DB --> TodoRepo: 진행 중 Todo 목록 deactivate DB TodoRepo --> Service: List deactivate TodoRepo ' 최근 회의록 조회 Service -> MinutesRepo: findRecentMinutes(userId) activate MinutesRepo MinutesRepo -> DB: SELECT minutes\nWHERE creatorId = ?\nORDER BY createdAt DESC LIMIT 3 activate DB DB --> MinutesRepo: 최근 회의록 목록 deactivate DB MinutesRepo --> Service: List deactivate MinutesRepo ' 공유받은 회의록 조회 Service -> MinutesRepo: findSharedMinutes(userId) activate MinutesRepo MinutesRepo -> DB: SELECT minutes m JOIN shared_minutes sm\nON m.id = sm.minutesId\nWHERE sm.sharedWith = ?\nORDER BY sm.sharedAt DESC LIMIT 3 activate DB DB --> MinutesRepo: 공유받은 회의록 목록 deactivate DB MinutesRepo --> Service: List deactivate MinutesRepo ' 통계 정보 조회 Service -> MeetingRepo: countUpcomingMeetings(userId) activate MeetingRepo MeetingRepo -> DB: SELECT COUNT(*)\nFROM meetings\nWHERE userId = ? AND status = 'SCHEDULED' activate DB DB --> MeetingRepo: 예정된 회의 개수 deactivate DB MeetingRepo --> Service: int count deactivate MeetingRepo Service -> TodoRepo: countActiveTodos(userId) activate TodoRepo TodoRepo -> DB: SELECT COUNT(*)\nFROM todos\nWHERE assignee = ? AND status = 'IN_PROGRESS' activate DB DB --> TodoRepo: 진행 중 Todo 개수 deactivate DB TodoRepo --> Service: int count deactivate TodoRepo Service -> TodoRepo: calculateTodoCompletionRate(userId) activate TodoRepo TodoRepo -> DB: SELECT\n (COUNT(CASE WHEN status='COMPLETED' THEN 1 END) * 100.0 /\n COUNT(*)) as rate\nFROM todos WHERE assignee = ? activate DB DB --> TodoRepo: Todo 완료율 deactivate DB TodoRepo --> Service: double rate deactivate TodoRepo note over Service 비즈니스 로직: - 데이터 조합 및 정제 - DTO 변환 - 통계 계산 end note Service -> Service: 대시보드 데이터 조합 ' 캐시 저장 Service -> Cache: SET dashboard:{userId}\n(TTL: 5분) activate Cache Cache --> Service: 캐시 저장 완료 deactivate Cache end Service --> Controller: DashboardResponse deactivate Service note over Controller 응답 데이터 구조: { "upcomingMeetings": [...], "activeTodos": [...], "recentMinutes": [...], "sharedMinutes": [...], "statistics": { "upcomingMeetingsCount": n, "activeTodosCount": n, "todoCompletionRate": n } } end note return 200 OK\nDashboardResponse deactivate Controller @enduml