mirror of
https://github.com/ktds-dg0501/kt-event-marketing-fe.git
synced 2026-06-13 16:59:10 +00:00
초기 프로젝트 설정 및 설계 문서 추가
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,141 @@
|
||||
@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 "Distribution DB" as DB
|
||||
queue "Kafka" as Kafka
|
||||
|
||||
== 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: 배포 이력 초기화\n(이벤트ID, 상태를 PENDING으로 저장)
|
||||
DB --> Service: 배포 이력 ID
|
||||
|
||||
note over Service: 배포 시작 상태로 변경
|
||||
Service -> DB: 배포 이력 상태 업데이트\n(상태를 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: 배포 채널 로그 저장\n(채널: 우리동네TV,\n상태: 성공, 배포ID,\n예상노출수 저장)
|
||||
|
||||
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: 배포 채널 로그 저장\n(채널: 링고비즈,\n상태: 성공,\n업데이트 시각 저장)
|
||||
|
||||
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: 배포 채널 로그 저장\n(채널: 지니TV,\n상태: 성공, 광고ID,\n노출 스케줄 저장)
|
||||
|
||||
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: 배포 채널 로그 저장\n(채널: Instagram,\n상태: 성공,\n포스트 URL/ID 저장)
|
||||
|
||||
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: 배포 채널 로그 저장\n(채널: NaverBlog,\n상태: 성공,\n포스트 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: 배포 채널 로그 저장\n(채널: KakaoChannel,\n상태: 성공,\n메시지 ID 저장)
|
||||
|
||||
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: 배포 이력 상태 업데이트\n(상태를 COMPLETED로,\n완료일시를 현재 시각으로 설정)
|
||||
|
||||
== Kafka 이벤트 발행 ==
|
||||
Service -> Kafka: Publish to event-topic\nDistributionCompleted\n{eventId, channels[], results[], completedAt}
|
||||
note over Kafka: Analytics Service 구독\n실시간 통계 업데이트
|
||||
|
||||
== 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
|
||||
Reference in New Issue
Block a user