mirror of
https://github.com/ktds-dg0501/kt-event-marketing.git
synced 2025-12-06 08:46:23 +00:00
145 lines
5.6 KiB
Plaintext
145 lines
5.6 KiB
Plaintext
@startuml distribution-다중채널배포-sprint2
|
|
!theme mono
|
|
|
|
title Distribution Service - 다중 채널 배포 Sprint 2 (UFR-DIST-010)
|
|
|
|
participant "Event Service" as EventSvc
|
|
participant "Distribution\nREST API" as API
|
|
participant "Distribution\nController" as Controller
|
|
participant "Distribution\nService" as Service
|
|
database "Event DB" as DB
|
|
queue "Kafka" as Kafka
|
|
participant "Redis Cache" as Cache
|
|
|
|
== REST API 동기 호출 수신 ==
|
|
EventSvc -> API: POST /api/distribution/distribute\n{eventId, channels[], contentUrls}
|
|
activate API
|
|
|
|
API -> Controller: distributeToChannels(request)
|
|
activate Controller
|
|
|
|
Controller -> Service: executeDistribution(distributionRequest)
|
|
activate Service
|
|
|
|
Service -> DB: 배포 이력 초기화\nINSERT distribution_logs\n{eventId, status: PENDING}
|
|
DB --> Service: 배포 이력 ID
|
|
|
|
note over Service: 배포 시작 상태로 변경
|
|
Service -> DB: UPDATE distribution_logs\nSET status = 'IN_PROGRESS'
|
|
|
|
== 다중 채널 배포 로그 기록 (Sprint 2: Mock 처리) ==
|
|
|
|
note over Service: Sprint 2: 실제 외부 API 호출 없이\n배포 결과만 기록
|
|
|
|
par 우리동네TV 배포
|
|
alt 채널 선택됨
|
|
Service -> Service: 우리동네TV 배포 처리\n(Mock: 즉시 성공 반환)
|
|
activate Service
|
|
|
|
note over Service: 배포 요청 검증\n- eventId 유효성\n- contentUrls 존재 여부
|
|
|
|
Service -> DB: 배포 채널 로그 저장\nINSERT distribution_channel_logs\n{channel: WooridongneTV,\nstatus: SUCCESS,\ndistributionId: generated_uuid,\nestimatedViews: 1000}
|
|
|
|
note over Service: Mock 결과:\n성공 (distributionId 생성)
|
|
|
|
deactivate Service
|
|
end
|
|
|
|
alt 링고비즈 선택됨
|
|
Service -> Service: 링고비즈 배포 처리\n(Mock: 즉시 성공 반환)
|
|
activate Service
|
|
|
|
note over Service: 배포 요청 검증\n- phoneNumber 형식\n- audioUrl 존재 여부
|
|
|
|
Service -> DB: 배포 채널 로그 저장\nINSERT distribution_channel_logs\n{channel: RingoBiz,\nstatus: SUCCESS,\nupdateTimestamp: NOW()}
|
|
|
|
note over Service: Mock 결과:\n성공 (timestamp 기록)
|
|
|
|
deactivate Service
|
|
end
|
|
|
|
alt 지니TV 선택됨
|
|
Service -> Service: 지니TV 배포 처리\n(Mock: 즉시 성공 반환)
|
|
activate Service
|
|
|
|
note over Service: 배포 요청 검증\n- region 유효성\n- schedule 형식\n- budget 범위
|
|
|
|
Service -> DB: 배포 채널 로그 저장\nINSERT distribution_channel_logs\n{channel: GenieTV,\nstatus: SUCCESS,\nadId: generated_uuid,\nimpressionSchedule: calculated}
|
|
|
|
note over Service: Mock 결과:\n성공 (adId 생성)
|
|
|
|
deactivate Service
|
|
end
|
|
|
|
alt Instagram 선택됨
|
|
Service -> Service: Instagram 배포 처리\n(Mock: 즉시 성공 반환)
|
|
activate Service
|
|
|
|
note over Service: 배포 요청 검증\n- imageUrl 형식\n- caption 길이\n- hashtags 유효성
|
|
|
|
Service -> DB: 배포 채널 로그 저장\nINSERT distribution_channel_logs\n{channel: Instagram,\nstatus: SUCCESS,\npostUrl: generated_url,\npostId: generated_uuid}
|
|
|
|
note over Service: Mock 결과:\n성공 (postUrl, postId 생성)
|
|
|
|
deactivate Service
|
|
end
|
|
|
|
alt Naver Blog 선택됨
|
|
Service -> Service: Naver Blog 배포 처리\n(Mock: 즉시 성공 반환)
|
|
activate Service
|
|
|
|
note over Service: 배포 요청 검증\n- imageUrl 형식\n- content 길이
|
|
|
|
Service -> DB: 배포 채널 로그 저장\nINSERT distribution_channel_logs\n{channel: NaverBlog,\nstatus: SUCCESS,\npostUrl: generated_url}
|
|
|
|
note over Service: Mock 결과:\n성공 (postUrl 생성)
|
|
|
|
deactivate Service
|
|
end
|
|
|
|
alt Kakao Channel 선택됨
|
|
Service -> Service: Kakao Channel 배포 처리\n(Mock: 즉시 성공 반환)
|
|
activate Service
|
|
|
|
note over Service: 배포 요청 검증\n- imageUrl 형식\n- message 길이
|
|
|
|
Service -> DB: 배포 채널 로그 저장\nINSERT distribution_channel_logs\n{channel: KakaoChannel,\nstatus: SUCCESS,\nmessageId: generated_uuid}
|
|
|
|
note over Service: Mock 결과:\n성공 (messageId 생성)
|
|
|
|
deactivate Service
|
|
end
|
|
end
|
|
|
|
note over Service: 모든 채널 배포 완료\n(즉시 처리 - 외부 API 호출 없음)
|
|
|
|
== 배포 결과 집계 및 저장 ==
|
|
Service -> Service: 채널별 배포 결과 집계\n성공: [선택된 모든 채널]
|
|
|
|
note over Service: Sprint 2에서는\n모든 채널 배포가 성공으로 처리됨
|
|
|
|
Service -> DB: UPDATE distribution_logs\nSET status = 'COMPLETED',\ncompleted_at = NOW()
|
|
|
|
== Kafka 이벤트 발행 ==
|
|
Service -> Kafka: Publish to event-topic\nDistributionCompleted\n{eventId, channels[], results[], completedAt}
|
|
note over Kafka: Analytics Service 구독\n실시간 통계 업데이트
|
|
|
|
Service -> Cache: 배포 상태 캐싱\nkey: distribution:{eventId}\nvalue: {status: COMPLETED, results[]}\nTTL: 1시간
|
|
|
|
== REST API 동기 응답 ==
|
|
Service --> Controller: 배포 완료 응답\n{status: COMPLETED, successChannels: [all]}
|
|
deactivate Service
|
|
|
|
Controller --> API: DistributionResponse\n{eventId, status: COMPLETED, results: [all success]}
|
|
deactivate Controller
|
|
|
|
API --> EventSvc: 200 OK\n{distributionId, status: COMPLETED, results[]}
|
|
deactivate API
|
|
|
|
note over EventSvc: 배포 완료 응답 수신\n이벤트 상태 업데이트\nAPPROVED → ACTIVE
|
|
|
|
== Sprint 2 제약사항 ==
|
|
note over Service: **Sprint 2 구현 범위**\n- 외부 API 호출 없음 (Mock 처리)\n- 모든 배포 요청은 성공으로 처리\n- 배포 로그만 DB에 기록\n- Circuit Breaker, Retry 미구현\n- 실패 처리 시나리오 미구현\n\n**Sprint 3 이후 구현 예정**\n- 실제 외부 채널 API 연동\n- Circuit Breaker 패턴 적용\n- Retry 로직 구현\n- 실패 처리 및 알림
|
|
|
|
@enduml
|