mirror of
https://github.com/ktds-dg0501/kt-event-marketing.git
synced 2025-12-06 18:46:23 +00:00
- event-추천결과조회.puml: Gateway 패턴 추가, 레이어 아키텍처 적용, 한글화 - event-추천안선택.puml: Gateway 패턴 추가, 5단계 구조화, 한글화 - event-콘텐츠선택.puml: ContentService로 변경, Gateway 패턴, 한글화 - event-최종승인및배포.puml: Gateway 패턴 추가, 7단계 구조화, 한글화 모든 파일 공통 변경사항: - Client actor 및 API Gateway 추가 - <<API Layer>>, <<Business Layer>>, <<Data Layer>> 레이어 구분 - 모든 요청/응답 한글 표시 - Repository CRUD 한글 설명 (SQL 제거) - Redis 캐시 키 패턴 표준화 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
117 lines
3.2 KiB
Plaintext
117 lines
3.2 KiB
Plaintext
@startuml event-추천안선택
|
|
!theme mono
|
|
|
|
title Event Service - 선택한 AI 추천안 저장 (UFR-EVENT-040)
|
|
|
|
actor Client
|
|
participant "API Gateway" as Gateway
|
|
participant "EventController" as Controller <<API Layer>>
|
|
participant "EventService" as Service <<Business Layer>>
|
|
participant "EventRepository" as Repo <<Data Layer>>
|
|
participant "Redis Cache" as Cache <<E>>
|
|
database "Event DB" as DB <<E>>
|
|
|
|
note over Controller, Cache
|
|
**UFR-EVENT-040: AI 추천안 선택 및 저장**
|
|
- 사용자가 3가지 추천안 중 하나를 선택
|
|
- 선택된 추천안을 이벤트 초안에 적용
|
|
- Redis 캐시에서 AI 추천 결과 삭제
|
|
end note
|
|
|
|
Client -> Gateway: PUT /api/events/drafts/{eventDraftId}/recommendation\n{"userId": 123,\n"selectedIndex": 1,\n"recommendation": {...}}
|
|
activate Gateway
|
|
|
|
Gateway -> Controller: PUT /api/events/drafts/{eventDraftId}/recommendation
|
|
activate Controller
|
|
|
|
Controller -> Controller: 요청 검증\n(필수 필드, 추천안 유효성)
|
|
|
|
Controller -> Service: updateEventRecommendation(eventDraftId, userId,\nselectedRecommendation)
|
|
activate Service
|
|
|
|
== 1단계: 이벤트 초안 조회 및 검증 ==
|
|
|
|
Service -> Repo: findById(eventDraftId)
|
|
activate Repo
|
|
Repo -> DB: 이벤트 초안 조회\n(초안ID로 조회)
|
|
activate DB
|
|
DB --> Repo: EventDraft 엔티티\n{목적, 매장정보, 상태}
|
|
deactivate DB
|
|
Repo --> Service: EventDraft entity
|
|
deactivate Repo
|
|
|
|
Service -> Service: validateOwnership(userId, eventDraft)
|
|
note right
|
|
소유권 검증:
|
|
- 사용자ID와 초안 소유자 일치 확인
|
|
- 권한 없으면 403 Forbidden
|
|
end note
|
|
|
|
Service -> Service: validateRecommendation(selectedRecommendation)
|
|
note right
|
|
추천안 유효성 검증:
|
|
- 필수 필드 존재 여부
|
|
- 비용/ROI 값 타당성
|
|
end note
|
|
|
|
== 2단계: 추천안 적용 ==
|
|
|
|
Service -> Service: applyRecommendation(eventDraft, selectedRecommendation)
|
|
note right
|
|
추천안 적용:
|
|
- 이벤트 제목
|
|
- 경품 정보
|
|
- 참여 방법
|
|
- 예상 비용
|
|
- 예상 ROI
|
|
- 홍보 문구
|
|
end note
|
|
|
|
== 3단계: DB 저장 ==
|
|
|
|
Service -> Repo: update(eventDraft)
|
|
activate Repo
|
|
Repo -> DB: 이벤트 초안 업데이트\n(선택된 추천안 정보 저장:\n제목, 경품, 참여방법,\n예상비용, 예상ROI,\n수정일시)
|
|
activate DB
|
|
DB --> Repo: 업데이트 완료
|
|
deactivate DB
|
|
Repo --> Service: EventDraft entity
|
|
deactivate Repo
|
|
|
|
== 4단계: 캐시 무효화 ==
|
|
|
|
Service -> Cache: 캐시 삭제\nKey: ai:recommendation:{eventDraftId}
|
|
activate Cache
|
|
note right
|
|
Redis 캐시 무효화:
|
|
- AI 추천 결과 삭제
|
|
- 선택 완료 후 불필요
|
|
end note
|
|
Cache --> Service: 삭제 완료
|
|
deactivate Cache
|
|
|
|
== 5단계: 응답 반환 ==
|
|
|
|
Service --> Controller: EventRecommendationResponse\n{eventDraftId, selectedRecommendation}
|
|
deactivate Service
|
|
|
|
Controller --> Gateway: 200 OK\n{"eventDraftId": 123,\n"status": "추천안 선택 완료",\n"selectedRecommendation": {...}}
|
|
deactivate Controller
|
|
|
|
Gateway --> Client: 200 OK\n추천안 선택 완료
|
|
deactivate Gateway
|
|
|
|
note over Client, Cache
|
|
**저장 내용**
|
|
- 최종 선택된 추천안만 Event DB에 저장
|
|
- Redis에 저장된 3가지 추천안은 선택 후 삭제
|
|
- 다음 단계: 콘텐츠 생성 (이미지 선택)
|
|
|
|
**성능 목표**
|
|
- 응답 시간: 0.5초 이내
|
|
- DB 업데이트: 0.1초
|
|
- 캐시 삭제: 0.01초
|
|
end note
|
|
|
|
@enduml
|