@startuml event-대시보드조회 !theme mono title Event Service - 대시보드 이벤트 목록 (UFR-EVENT-010) actor Client participant "EventController" as Controller <> participant "EventService" as Service <> participant "EventRepository" as Repo <> participant "Redis Cache" as Cache <> database "Event DB" as DB <> note over Controller: GET /api/events/dashboard Controller -> Service: getDashboard(userId) activate Service Service -> Cache: get("dashboard:" + userId) activate Cache alt 캐시 히트 Cache --> Service: Dashboard data Service --> Controller: DashboardResponse else 캐시 미스 Cache --> Service: null deactivate Cache group parallel Service -> Repo: findTopByStatusAndUserId(ACTIVE, userId, limit=5) activate Repo Repo -> DB: 진행중 이벤트 목록 조회\n(사용자ID로 ACTIVE 상태 이벤트 조회,\n참여자 수 함께 조회,\n생성일 내림차순, 최대 5개) activate DB DB --> Repo: Active events deactivate DB Repo --> Service: List (active) deactivate Repo Service -> Repo: findTopByStatusAndUserId(APPROVED, userId, limit=5) activate Repo Repo -> DB: 예정 이벤트 목록 조회\n(사용자ID로 APPROVED 상태 이벤트 조회,\n승인일 내림차순, 최대 5개) activate DB DB --> Repo: Approved events deactivate DB Repo --> Service: List (approved) deactivate Repo Service -> Repo: findTopByStatusAndUserId(COMPLETED, userId, limit=5) activate Repo Repo -> DB: 종료 이벤트 목록 조회\n(사용자ID로 COMPLETED 상태 이벤트 조회,\n참여자 수 함께 조회,\n종료일 내림차순, 최대 5개) activate DB DB --> Repo: Completed events deactivate DB Repo --> Service: List (completed) deactivate Repo end Service -> Service: buildDashboardResponse(active, approved, completed) note right: 대시보드 데이터 구성:\n- 진행중: 5개\n- 예정: 5개\n- 종료: 5개\n각 카드에 기본 통계 포함 Service -> Cache: set("dashboard:" + userId,\ndashboard, TTL=1분) activate Cache Cache --> Service: OK deactivate Cache end Service --> Controller: DashboardResponse\n{active: [...], approved: [...],\ncompleted: [...]} deactivate Service Controller --> Client: 200 OK\n{active: [\n {eventId, title, period, status,\n participantCount, viewCount, ...}\n],\napproved: [...],\ncompleted: [...]} note over Controller, DB: 대시보드 카드 정보:\n- 이벤트명\n- 이벤트 기간\n- 진행 상태 뱃지\n- 간단한 통계\n (참여자 수, 조회수 등)\n\n섹션당 최대 5개 표시\n(최신 순) @enduml