mirror of
https://github.com/ktds-dg0501/kt-event-marketing.git
synced 2025-12-06 16:06:24 +00:00
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
46 lines
1.7 KiB
Plaintext
46 lines
1.7 KiB
Plaintext
@startuml event-이미지결과조회
|
|
!theme mono
|
|
|
|
title Event Service - 이미지 생성 결과 폴링 조회
|
|
|
|
participant "EventController" as Controller <<C>>
|
|
participant "JobService" as JobSvc <<S>>
|
|
participant "Redis Cache" as Cache <<E>>
|
|
|
|
note over Controller: GET /api/jobs/{jobId}/images
|
|
Controller -> JobSvc: getImageJobStatus(jobId)
|
|
activate JobSvc
|
|
|
|
JobSvc -> Cache: get("job:" + jobId)
|
|
activate Cache
|
|
|
|
alt 캐시 히트
|
|
Cache --> JobSvc: Job data\n{status, imageUrls, createdAt}
|
|
|
|
alt Job 완료 (status: COMPLETED)
|
|
JobSvc --> Controller: JobStatusResponse\n{jobId, status: COMPLETED,\nimageUrls: {...}}
|
|
Controller --> Client: 200 OK\n{status: COMPLETED,\nimageUrls: {\n simple: "https://cdn.../simple.png",\n fancy: "https://cdn.../fancy.png",\n trendy: "https://cdn.../trendy.png"\n}}
|
|
|
|
else Job 진행중 (status: PROCESSING)
|
|
JobSvc --> Controller: JobStatusResponse\n{jobId, status: PROCESSING}
|
|
Controller --> Client: 200 OK\n{status: PROCESSING}
|
|
note right: 클라이언트는 3초 후\n재요청
|
|
|
|
else Job 실패 (status: FAILED)
|
|
JobSvc --> Controller: JobStatusResponse\n{jobId, status: FAILED, error}
|
|
Controller --> Client: 200 OK\n{status: FAILED, error}
|
|
end
|
|
|
|
else 캐시 미스
|
|
Cache --> JobSvc: null
|
|
JobSvc --> Controller: NotFoundError
|
|
Controller --> Client: 404 Not Found\n{error: "Job not found"}
|
|
end
|
|
|
|
deactivate Cache
|
|
deactivate JobSvc
|
|
|
|
note over Controller, Cache: 최대 30초 동안 폴링\n(3초 간격, 최대 10회)\n\n이미지 URL은 Redis에서 조회\n(TTL: 7일)\n\n타임아웃 시 클라이언트는\n에러 메시지 표시 및\n"다시 생성" 옵션 제공
|
|
|
|
@enduml
|