kt-event-marketing/design/backend/sequence/inner/event-대시보드조회.puml
2025-10-22 14:13:57 +09:00

74 lines
2.8 KiB
Plaintext

@startuml event-대시보드조회
!theme mono
title Event Service - 대시보드 이벤트 목록 (UFR-EVENT-010)
actor Client
participant "EventController" as Controller <<C>>
participant "EventService" as Service <<S>>
participant "EventRepository" as Repo <<R>>
participant "Redis Cache" as Cache <<E>>
database "Event DB" as DB <<E>>
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: SELECT e.*, COUNT(p.id) as participant_count\nFROM events e\nLEFT JOIN participants p ON e.id = p.event_id\nWHERE e.user_id = ?\nAND e.status = 'ACTIVE'\nGROUP BY e.id\nORDER BY e.created_at DESC\nLIMIT 5
activate DB
DB --> Repo: Active events
deactivate DB
Repo --> Service: List<Event> (active)
deactivate Repo
Service -> Repo: findTopByStatusAndUserId(APPROVED, userId, limit=5)
activate Repo
Repo -> DB: SELECT e.*\nFROM events e\nWHERE e.user_id = ?\nAND e.status = 'APPROVED'\nORDER BY e.approved_at DESC\nLIMIT 5
activate DB
DB --> Repo: Approved events
deactivate DB
Repo --> Service: List<Event> (approved)
deactivate Repo
Service -> Repo: findTopByStatusAndUserId(COMPLETED, userId, limit=5)
activate Repo
Repo -> DB: SELECT e.*, COUNT(p.id) as participant_count\nFROM events e\nLEFT JOIN participants p ON e.id = p.event_id\nWHERE e.user_id = ?\nAND e.status = 'COMPLETED'\nGROUP BY e.id\nORDER BY e.completed_at DESC\nLIMIT 5
activate DB
DB --> Repo: Completed events
deactivate DB
Repo --> Service: List<Event> (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