kt-event-marketing/design/backend/sequence/inner/event-목록조회.puml
2025-10-22 20:13:56 +09:00

65 lines
2.6 KiB
Plaintext

@startuml event-목록조회
!theme mono
title Event Service - 이벤트 목록 조회 (필터/검색) (UFR-EVENT-070)
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?status={상태}&keyword={검색어}\n&page={페이지}&size={크기}
Controller -> Service: 이벤트 목록 조회(사용자ID, 필터, 페이징)
activate Service
Service -> Cache: 캐시 조회("events:" + 사용자ID + ":" + 필터 + ":" + 페이지)
activate Cache
alt 캐시 히트
Cache --> Service: 이벤트 목록 데이터
Service --> Controller: 이벤트 목록 응답
else 캐시 미스
Cache --> Service: null
deactivate Cache
Service -> Repo: 사용자별 필터링 이벤트 조회(사용자ID, 필터, 페이징)
activate Repo
alt 필터 있음 (상태별)
Repo -> DB: 사용자별 특정 상태 이벤트 조회\n(참여자 수 포함, 생성일 기준 내림차순,\n페이징 적용)
else 검색 있음 (키워드)
Repo -> DB: 사용자별 이벤트 키워드 검색\n(제목/설명에서 검색, 참여자 수 포함,\n생성일 기준 내림차순, 페이징 적용)
else 필터 없음 (전체)
Repo -> DB: 사용자별 전체 이벤트 목록 조회\n(참여자 수 포함, 생성일 기준 내림차순,\n페이징 적용)
end
activate DB
note right: 인덱스 활용:\n- 사용자ID\n- 상태\n- 생성일시
DB --> Repo: 이벤트 목록 및 참여자 수
deactivate DB
Repo -> DB: 전체 이벤트 개수 조회\n(필터 조건 포함, 페이징용)
activate DB
DB --> Repo: 전체 개수
deactivate DB
Repo --> Service: 페이징된 이벤트 결과
deactivate Repo
Service -> Cache: 캐시 저장("events:" + 사용자ID + ":" + 필터 + ":" + 페이지,\n페이징결과, TTL=1분)
activate Cache
Cache --> Service: OK
deactivate Cache
end
Service --> Controller: 이벤트 목록 응답\n{이벤트목록: [...], 전체개수,\n전체페이지수, 현재페이지}
deactivate Service
Controller --> Client: 200 OK\n{이벤트목록: [\n {이벤트ID, 제목, 기간, 상태,\n 참여자수, ROI, 생성일시},\n ...\n],\n전체개수, 전체페이지수, 현재페이지}
note over Controller, DB: 필터 옵션:\n- 상태: 임시저장, 진행중, 완료\n- 기간: 최근 1개월/3개월/6개월/1년\n- 정렬: 최신순, 참여자 많은 순,\n ROI 높은 순\n\n페이지네이션:\n- 기본 20개/페이지\n- 페이지 번호 기반
@enduml