@startuml event-이미지결과조회 !theme mono title Event Service - 이미지 생성 결과 폴링 조회 participant "EventController" as Controller <> participant "EventService" as EventSvc <> participant "EventRepository" as EventRepo <> participant "Event DB" as EventDB <> note over Controller: GET /api/events/{eventId}/status Controller -> EventSvc: 이미지 생성 결과 조회 요청\n(이벤트ID) activate EventSvc EventSvc -> EventRepo: 이벤트 조회\n(이벤트ID) activate EventRepo EventRepo -> EventDB: 이벤트 정보 조회 activate EventDB alt 이벤트 존재 EventDB --> EventRepo: 이벤트 엔티티\n{이벤트ID, 상태, 이미지URL들,\n생성일시} deactivate EventDB EventRepo --> EventSvc: Event 엔티티 alt 이미지 생성 완료 (상태: COMPLETED) EventSvc --> Controller: 완료 응답\n{이벤트ID, 상태: 완료,\n이미지URL들} Controller --> Client: 200 OK\n{상태: 완료,\n이미지URL들: {\n 심플형: "https://cdn.../simple.png",\n 화려형: "https://cdn.../fancy.png",\n 트렌디형: "https://cdn.../trendy.png"\n}} else 이미지 생성중 (상태: PROCESSING) EventSvc --> Controller: 진행중 응답\n{이벤트ID, 상태: 처리중,\n진행률: 33%} Controller --> Client: 200 OK\n{상태: 처리중,\n진행률: 33%} note right: 클라이언트는 3초 후\n재요청 else 이미지 생성 실패 (상태: FAILED) EventSvc --> Controller: 실패 응답\n{이벤트ID, 상태: 실패,\n오류메시지} Controller --> Client: 200 OK\n{상태: 실패,\n오류메시지} end else 이벤트 미존재 EventDB --> EventRepo: null deactivate EventDB EventRepo --> EventSvc: null EventSvc --> Controller: 미발견 오류 Controller --> Client: 404 Not Found\n{오류: "이벤트를 찾을 수 없음"} end deactivate EventRepo deactivate EventSvc note over Controller, EventDB: 최대 30초 동안 폴링\n(3초 간격, 최대 10회)\n\n타임아웃 시 클라이언트는\n에러 메시지 표시 및\n"다시 생성" 옵션 제공 @enduml