Feat: 대시보드 조회 API 개발

This commit is contained in:
cyjadela
2025-10-27 11:29:56 +09:00
parent fca069cf9c
commit 0e899fe496
3 changed files with 972 additions and 10 deletions
@@ -1,8 +1,6 @@
package com.unicorn.hgzero.meeting.infra.controller;
import com.unicorn.hgzero.common.dto.ApiResponse;
import com.unicorn.hgzero.meeting.biz.dto.DashboardDTO;
import com.unicorn.hgzero.meeting.biz.usecase.in.dashboard.GetDashboardUseCase;
import com.unicorn.hgzero.meeting.infra.dto.response.DashboardResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -14,6 +12,11 @@ import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
* 대시보드 REST API Controller
* 사용자별 맞춤 대시보드 데이터 제공
@@ -25,17 +28,15 @@ import org.springframework.web.bind.annotation.*;
@Slf4j
public class DashboardController {
private final GetDashboardUseCase getDashboardUseCase;
/**
* 대시보드 데이터 조회
* 대시보드 데이터 조회 (목 데이터)
*
* @param userId 사용자 ID
* @return 대시보드 데이터
*/
@Operation(
summary = "대시보드 데이터 조회",
description = "사용자별 맞춤 대시보드 정보를 조회합니다. 예정된 회의 목록, 진행 중 Todo 목록, 최근 회의록 목록, 통계 정보를 포함합니다.",
description = "사용자별 맞춤 대시보드 정보를 조회합니다. 예정된 회의 목록, 최근 회의록 목록, 통계 정보를 포함합니다.",
security = @SecurityRequirement(name = "bearerAuth")
)
@GetMapping
@@ -49,12 +50,80 @@ public class DashboardController {
log.info("대시보드 데이터 조회 요청 - userId: {}", userId);
var dashboardData = getDashboardUseCase.getDashboard(userId);
var dashboardDTO = DashboardDTO.from(dashboardData);
var response = DashboardResponse.from(dashboardDTO);
// 목 데이터 생성
DashboardResponse mockResponse = createMockDashboardData();
log.info("대시보드 데이터 조회 완료 - userId: {}", userId);
return ResponseEntity.ok(ApiResponse.success(response));
return ResponseEntity.ok(ApiResponse.success(mockResponse));
}
/**
* 목 데이터 생성
*/
private DashboardResponse createMockDashboardData() {
// 예정된 회의 목 데이터
List<DashboardResponse.UpcomingMeetingResponse> upcomingMeetings = Arrays.asList(
DashboardResponse.UpcomingMeetingResponse.builder()
.meetingId("550e8400-e29b-41d4-a716-446655440001")
.title("Q1 전략 회의")
.startTime(LocalDateTime.now().plusDays(2).withHour(14).withMinute(0))
.endTime(LocalDateTime.now().plusDays(2).withHour(16).withMinute(0))
.location("회의실 A")
.participantCount(5)
.status("SCHEDULED")
.build(),
DashboardResponse.UpcomingMeetingResponse.builder()
.meetingId("550e8400-e29b-41d4-a716-446655440002")
.title("개발팀 스프린트 계획")
.startTime(LocalDateTime.now().plusDays(3).withHour(10).withMinute(0))
.endTime(LocalDateTime.now().plusDays(3).withHour(12).withMinute(0))
.location("회의실 B")
.participantCount(8)
.status("SCHEDULED")
.build()
);
// 최근 회의록 목 데이터
List<DashboardResponse.RecentMinutesResponse> recentMinutes = Arrays.asList(
DashboardResponse.RecentMinutesResponse.builder()
.minutesId("770e8400-e29b-41d4-a716-446655440001")
.title("아키텍처 설계 회의")
.meetingDate(LocalDateTime.now().minusDays(1).withHour(14).withMinute(0))
.status("FINALIZED")
.participantCount(6)
.lastModified(LocalDateTime.now().minusDays(1).withHour(16).withMinute(30))
.build(),
DashboardResponse.RecentMinutesResponse.builder()
.minutesId("770e8400-e29b-41d4-a716-446655440002")
.title("UI/UX 검토 회의")
.meetingDate(LocalDateTime.now().minusDays(3).withHour(11).withMinute(0))
.status("FINALIZED")
.participantCount(4)
.lastModified(LocalDateTime.now().minusDays(3).withHour(12).withMinute(45))
.build(),
DashboardResponse.RecentMinutesResponse.builder()
.minutesId("770e8400-e29b-41d4-a716-446655440003")
.title("API 설계 검토")
.meetingDate(LocalDateTime.now().minusDays(5).withHour(15).withMinute(0))
.status("DRAFT")
.participantCount(3)
.lastModified(LocalDateTime.now().minusDays(5).withHour(16).withMinute(15))
.build()
);
// 통계 정보 목 데이터
DashboardResponse.StatisticsResponse statistics = DashboardResponse.StatisticsResponse.builder()
.upcomingMeetingsCount(2)
.activeTodosCount(0) // activeTodos 제거로 0으로 설정
.todoCompletionRate(0.0) // activeTodos 제거로 0으로 설정
.build();
return DashboardResponse.builder()
.upcomingMeetings(upcomingMeetings)
.activeTodos(Collections.emptyList()) // activeTodos 빈 리스트로 설정
.myMinutes(recentMinutes)
.statistics(statistics)
.build();
}
}