mirror of
https://github.com/ktds-dg0501/kt-event-marketing.git
synced 2025-12-06 20:06:23 +00:00
## 주요 변경사항
### 1. Timeline 데이터 날짜 로직 수정
- **파일**: SampleDataLoader.java
- **변경**: 이벤트 ID에서 날짜를 파싱하여 실제 이벤트 시작일 기준으로 Timeline 생성
- 기존: 모든 이벤트가 2024-09-24부터 시작
- 수정: evt_2025012301 → 2025-01-23부터 30일치 생성
- **채널 분포**: 가중치 기반 랜덤 배정으로 변경
- SNS: 45% (최고 비율)
- 우리동네TV: 25%
- 지니TV: 20%
- 링고비즈: 10%
### 2. 이벤트별 API 상세 정보 추가
- **파일**: AnalyticsDashboardResponse.java
- **추가 필드**:
- investment: InvestmentDetails (투자 비용 상세)
- revenue: RevenueDetails (수익 상세)
- costEfficiency: CostEfficiency (비용 효율성)
### 3. 이벤트별 상세 계산 로직 구현
- **파일**: AnalyticsService.java
- **추가 메서드**:
- buildInvestmentDetails(): 투자 비용 상세 계산
- 경품비용 50%, 콘텐츠제작비 30%, 운영비 20%, 채널배포비용(실제)
- buildRevenueDetails(): 수익 상세 계산
- 직접매출 70%, 예상추가매출 30%, 신규고객 40%, 기존고객 60%
- buildCostEfficiency(): 비용 효율성 계산
- 참여자당 비용, 참여자당 수익
### 4. ROI 전용 API 필드 수정
- **파일**: ROICalculator.java
- **수정**: UserRoiAnalyticsService와 동일한 비율 적용
- investmentDetails에 prizeCost, channelCost 추가
- revenueDetails에 newCustomerRevenue, existingCustomerRevenue 추가
- **기존 문제**: null 값 반환
- **해결**: 통합분석과 동일한 계산 로직 적용
## API 응답 구조
### GET /api/v1/events/{eventId}/analytics
```json
{
"investment": {
"total": 5000000,
"prizeCost": 1250000,
"contentCreation": 750000,
"operation": 500000,
"distribution": 2500000,
"channelCost": 2500000
},
"revenue": {
"total": 15000000,
"directSales": 10500000,
"expectedSales": 4500000,
"newCustomerRevenue": 6000000,
"existingCustomerRevenue": 9000000
},
"costEfficiency": {
"costPerParticipant": 50000,
"revenuePerParticipant": 150000
}
}
```
## 테스트 결과
- ✅ Timeline 날짜가 이벤트별로 정확하게 생성됨
- ✅ 채널별 참여자 분포가 가중치대로 배정됨
- ✅ 이벤트별 API에서 상세 투자/수익 정보 제공
- ✅ ROI API에서 null 값 문제 해결
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>