diff --git a/src/app/(main)/events/create/steps/RecommendationStep.tsx b/src/app/(main)/events/create/steps/RecommendationStep.tsx index d2c0477..3bf1a6d 100644 --- a/src/app/(main)/events/create/steps/RecommendationStep.tsx +++ b/src/app/(main)/events/create/steps/RecommendationStep.tsx @@ -19,7 +19,8 @@ import { Alert, } from '@mui/material'; import { ArrowBack, Edit, Insights } from '@mui/icons-material'; -import { aiApi, eventApi, AIRecommendationResult, EventRecommendation } from '@/shared/api'; +import { eventApi } from '@/shared/api'; +import type { AiRecommendationResult, EventRecommendation } from '@/shared/api/eventApi'; // 디자인 시스템 색상 const colors = { @@ -82,7 +83,7 @@ export default function RecommendationStep({ const [polling, setPolling] = useState(false); const [error, setError] = useState(null); - const [aiResult, setAiResult] = useState(null); + const [aiResult, setAiResult] = useState(null); const [selected, setSelected] = useState(null); const [editedData, setEditedData] = useState>({}); @@ -206,8 +207,8 @@ export default function RecommendationStep({ console.log('✅ Job 상태:', status); if (status.status === 'COMPLETED') { - // AI 추천 결과 조회 - const recommendations = await aiApi.getRecommendations(evtId); + // AI 추천 결과 조회 (Event Service API 사용) + const recommendations = await eventApi.getAiRecommendations(evtId); setAiResult(recommendations); setLoading(false); setPolling(false); diff --git a/src/shared/api/aiApi.ts b/src/shared/api/aiApi.ts index 024f5f3..6fbcea1 100644 --- a/src/shared/api/aiApi.ts +++ b/src/shared/api/aiApi.ts @@ -56,78 +56,7 @@ aiApiClient.interceptors.response.use( } ); -// Types -export interface TrendKeyword { - keyword: string; - relevance: number; - description: string; -} - -export interface TrendAnalysis { - industryTrends: TrendKeyword[]; - regionalTrends: TrendKeyword[]; - seasonalTrends: TrendKeyword[]; -} - -export interface ExpectedMetrics { - newCustomers: { - min: number; - max: number; - }; - repeatVisits?: { - min: number; - max: number; - }; - revenueIncrease: { - min: number; - max: number; - }; - roi: { - min: number; - max: number; - }; - socialEngagement?: { - estimatedPosts: number; - estimatedReach: number; - }; -} - -export interface EventRecommendation { - optionNumber: number; - concept: string; - title: string; - description: string; - targetAudience: string; - duration: { - recommendedDays: number; - recommendedPeriod?: string; - }; - mechanics: { - type: 'DISCOUNT' | 'GIFT' | 'STAMP' | 'EXPERIENCE' | 'LOTTERY' | 'COMBO'; - details: string; - }; - promotionChannels: string[]; - estimatedCost: { - min: number; - max: number; - breakdown?: { - material?: number; - promotion?: number; - discount?: number; - }; - }; - expectedMetrics: ExpectedMetrics; - differentiator: string; -} - -export interface AIRecommendationResult { - eventId: string; - trendAnalysis: TrendAnalysis; - recommendations: EventRecommendation[]; - generatedAt: string; - expiresAt: string; - aiProvider: 'CLAUDE' | 'GPT4'; -} +// Types (eventApi.ts로 이동됨 - import해서 사용) export interface JobStatusResponse { jobId: string; @@ -170,11 +99,11 @@ export const aiApi = { return response.data; }, - // AI 추천 결과 조회 (Internal API) - getRecommendations: async (eventId: string): Promise => { - const response = await aiApiClient.get(`/internal/recommendations/${eventId}`); - return response.data; - }, + // AI 추천 결과 조회 (Internal API) - Deprecated: eventApi.getAiRecommendations 사용 + // getRecommendations: async (eventId: string): Promise => { + // const response = await aiApiClient.get(`/internal/recommendations/${eventId}`); + // return response.data; + // }, }; export default aiApi; diff --git a/src/shared/api/eventApi.ts b/src/shared/api/eventApi.ts index 6171431..790e0d2 100644 --- a/src/shared/api/eventApi.ts +++ b/src/shared/api/eventApi.ts @@ -111,6 +111,78 @@ export interface EventJobStatusResponse { completedAt?: string; } +export interface TrendKeyword { + keyword: string; + relevance: number; + description: string; +} + +export interface TrendAnalysis { + industryTrends: TrendKeyword[]; + regionalTrends: TrendKeyword[]; + seasonalTrends: TrendKeyword[]; +} + +export interface ExpectedMetrics { + newCustomers: { + min: number; + max: number; + }; + repeatVisits?: { + min: number; + max: number; + }; + revenueIncrease: { + min: number; + max: number; + }; + roi: { + min: number; + max: number; + }; + socialEngagement?: { + estimatedPosts: number; + estimatedReach: number; + }; +} + +export interface EventRecommendation { + optionNumber: number; + concept: string; + title: string; + description: string; + targetAudience: string; + duration: { + recommendedDays: number; + recommendedPeriod?: string; + }; + mechanics: { + type: 'DISCOUNT' | 'GIFT' | 'STAMP' | 'EXPERIENCE' | 'LOTTERY' | 'COMBO'; + details: string; + }; + promotionChannels: string[]; + estimatedCost: { + min: number; + max: number; + breakdown?: { + material?: number; + promotion?: number; + discount?: number; + }; + }; + expectedMetrics: ExpectedMetrics; + differentiator: string; +} + +export interface AiRecommendationResult { + eventId: string; + trendAnalysis: TrendAnalysis; + recommendations: EventRecommendation[]; + generatedAt: string; + expiresAt?: string; + aiProvider: 'CLAUDE' | 'GPT4'; +} + export interface SelectRecommendationRequest { recommendationId: string; customizations?: { @@ -262,6 +334,15 @@ export const eventApi = { return response.data; }, + // AI 추천 결과 조회 (Job COMPLETED 후) + getAiRecommendations: async (eventId: string): Promise => { + const response = await eventApiClient.get( + `/events/${eventId}/ai-recommendations` + ); + console.log('✅ AI 추천 결과 조회:', response.data); + return response.data; + }, + // AI 추천 선택 selectRecommendation: async ( eventId: string,