@startuml event-이미지생성요청 !theme mono title Event Service - 이미지 생성 요청 (Kafka Job 발행) (UFR-CONT-010) participant "EventController" as Controller <> participant "EventService" as Service <> participant "JobService" as JobSvc <> participant "EventRepository" as Repo <> participant "Redis Cache" as Cache <> database "Event DB" as DB <> participant "Kafka Producer" as Kafka <> note over Controller: POST /api/events/{id}/content-generation Controller -> Service: requestImageGeneration(eventDraftId, userId) activate Service Service -> Repo: findById(eventDraftId) activate Repo Repo -> DB: SELECT * FROM event_drafts\nWHERE id = ? AND user_id = ? activate DB DB --> Repo: EventDraft deactivate DB Repo --> Service: EventDraft entity deactivate Repo Service -> Service: validateOwnership(userId, eventDraft) Service -> Service: validateRecommendationSelected() note right: AI 추천 선택 여부 확인 Service -> JobSvc: createImageJob(eventDraft) activate JobSvc JobSvc -> JobSvc: generateJobId() note right: UUID 생성 JobSvc -> Cache: set("job:" + jobId,\n{status: PENDING, createdAt}, TTL=1시간) activate Cache Cache --> JobSvc: OK deactivate Cache JobSvc -> Kafka: publish(image-job,\n{jobId, eventDraftId, title, prize,\nbrandColor, logoUrl, storeInfo}) activate Kafka note right: Kafka Job Topic:\nimage-job-topic Kafka --> JobSvc: ACK deactivate Kafka JobSvc --> Service: JobResponse\n{jobId, status: PENDING} deactivate JobSvc Service --> Controller: JobResponse\n{jobId, status: PENDING} deactivate Service Controller --> Client: 202 Accepted\n{jobId, status: PENDING} note over Controller, Kafka: Content Service는 백그라운드에서\nKafka image-job 토픽을 구독하여\n3가지 스타일 이미지 생성\n(심플, 화려한, 트렌디) @enduml