@startuml event-콘텐츠선택 !theme mono title Event Service - 선택한 콘텐츠 저장 (UFR-CONT-020) participant "EventController" as Controller <> participant "EventService" as Service <> participant "EventRepository" as Repo <> participant "Redis Cache" as Cache <> database "Event DB" as DB <> note over Controller: PUT /api/events/drafts/{id}/content Controller -> Service: updateEventContent(eventDraftId, userId,\nselectedImageUrl, editedContent) 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: validateImageUrl(selectedImageUrl) note right: 선택한 이미지 URL\n유효성 검증 Service -> Service: applyContentEdits(eventDraft, editedContent) note right: 편집 내용 적용:\n- 텍스트 수정\n- 색상 변경 Service -> Repo: update(eventDraft) activate Repo Repo -> DB: UPDATE event_drafts SET\nselected_image_url = ?,\nedited_title = ?,\nedited_text = ?,\nbackground_color = ?,\ntext_color = ?,\nupdated_at = NOW()\nWHERE id = ? activate DB DB --> Repo: OK deactivate DB Repo --> Service: EventDraft entity deactivate Repo Service -> Cache: delete("purpose:" + userId) activate Cache note right: 캐시 무효화 Cache --> Service: OK deactivate Cache Service --> Controller: EventContentResponse\n{eventDraftId, selectedImageUrl,\neditedContent} deactivate Service Controller --> Client: 200 OK\n{eventDraftId} note over Controller, Cache: 콘텐츠 편집 내용:\n- 제목 텍스트\n- 경품 정보 텍스트\n- 참여 안내 텍스트\n- 배경색\n- 텍스트 색상\n- 강조 색상 @enduml