mirror of
https://github.com/ktds-dg0501/kt-event-marketing.git
synced 2025-12-06 08:46:23 +00:00
- API 엔드포인트 통일
- AI 추천: POST /api/events/{id}/ai-recommendations
- 이미지 생성: POST /api/events/{id}/content-generation
- 최종 승인: POST /api/events/{id}/publish
- Kafka 이벤트명 구분
- EventDraftCreated: 목적 선택 시 발행
- EventCreated: 최종 승인 시 발행
- 수정 파일
- design/backend/sequence/outer/이벤트생성플로우.puml
- design/backend/sequence/inner/event-목적선택.puml
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
52 lines
1.8 KiB
Plaintext
52 lines
1.8 KiB
Plaintext
@startuml event-목적선택
|
|
!theme mono
|
|
|
|
title Event Service - 이벤트 목적 선택 및 저장 (UFR-EVENT-020)
|
|
|
|
participant "EventController" as Controller <<C>>
|
|
participant "EventService" as Service <<S>>
|
|
participant "EventRepository" as Repo <<R>>
|
|
participant "Redis Cache" as Cache <<E>>
|
|
database "Event DB" as DB <<E>>
|
|
participant "Kafka Producer" as Kafka <<E>>
|
|
|
|
note over Controller: POST /api/events/purposes
|
|
Controller -> Service: createEventDraft(userId, objective, storeInfo)
|
|
activate Service
|
|
|
|
Service -> Cache: get("purpose:" + userId)
|
|
activate Cache
|
|
Cache --> Service: null (캐시 미스)
|
|
deactivate Cache
|
|
|
|
Service -> Service: validate(objective, storeInfo)
|
|
note right: 목적 유효성 검증\n- 신규 고객 유치\n- 재방문 유도\n- 매출 증대\n- 인지도 향상
|
|
|
|
Service -> Repo: save(eventDraft)
|
|
activate Repo
|
|
Repo -> DB: INSERT INTO event_drafts\n(user_id, objective, store_info, status)
|
|
activate DB
|
|
DB --> Repo: eventDraftId
|
|
deactivate DB
|
|
Repo --> Service: EventDraft entity
|
|
deactivate Repo
|
|
|
|
Service -> Cache: set("purpose:" + userId, eventDraft, TTL=30분)
|
|
activate Cache
|
|
Cache --> Service: OK
|
|
deactivate Cache
|
|
|
|
Service -> Kafka: publish(EventDraftCreated,\n{eventDraftId, userId, objective, createdAt})
|
|
activate Kafka
|
|
note right: Kafka Event Topic:\nevent-topic\n\nEvent: EventDraftCreated\n(목적 선택 시 발행)\n\n※ EventCreated는\n최종 승인 시 발행
|
|
Kafka --> Service: ACK
|
|
deactivate Kafka
|
|
|
|
Service --> Controller: EventDraftResponse\n{eventDraftId, objective, status}
|
|
deactivate Service
|
|
Controller --> Client: 200 OK\n{eventDraftId}
|
|
|
|
note over Controller, Kafka: 캐시 히트 시:\n1. Redis에서 조회 → 즉시 반환\n2. DB 조회 생략\n\n※ EventDraftCreated 이벤트는\nAnalytics Service가 선택적으로 구독\n(통계 초기화는 EventCreated 시)
|
|
|
|
@enduml
|