11package com .back .domain .scenario .controller ;
22
3+ import com .back .domain .scenario .dto .*;
4+ import com .back .domain .scenario .entity .ScenarioStatus ;
35import com .back .domain .scenario .service .ScenarioService ;
6+ import com .back .global .common .ApiResponse ;
7+ import io .swagger .v3 .oas .annotations .Operation ;
8+ import io .swagger .v3 .oas .annotations .Parameter ;
9+ import io .swagger .v3 .oas .annotations .tags .Tag ;
10+ import jakarta .validation .Valid ;
411import lombok .RequiredArgsConstructor ;
5- import org .springframework .web .bind .annotation .RequestMapping ;
6- import org .springframework .web .bind .annotation .RestController ;
12+ import org .springframework .http .HttpStatus ;
13+ import org .springframework .web .bind .annotation .*;
14+ import java .security .Principal ;
15+ import java .time .LocalDateTime ;
16+ import java .util .List ;
717
818/**
919 * 시나리오 관련 API 요청을 처리하는 컨트롤러.
1020 * 시나리오 추출, 상세 조회, 비교 등의 기능을 제공합니다.
1121 */
22+ @ Tag (name = "Scenario" , description = "시나리오 관련 API" )
1223@ RestController
1324@ RequestMapping ("/api/v1/scenarios" )
1425@ RequiredArgsConstructor
1526public class ScenarioController {
1627
1728 private final ScenarioService scenarioService ;
1829
30+ @ PostMapping
31+ @ Operation (summary = "시나리오 생성" , description = "DecisionLine을 기반으로 AI 시나리오를 생성합니다." )
32+ public ApiResponse <Long > createScenario (
33+ @ Valid @ RequestBody ScenarioCreateRequest request ,
34+ Principal principal
35+ ) {
36+ // Mock: 실제로는 scenarioService.createScenario(request, principal) 호출
37+ return ApiResponse .success (1001L , "시나리오 생성 요청이 접수되었습니다." , HttpStatus .CREATED );
38+ }
39+
40+ @ GetMapping ("/{scenarioId}/status" )
41+ @ Operation (summary = "시나리오 상태 조회" , description = "시나리오 생성 진행 상태를 조회합니다." )
42+ public ApiResponse <ScenarioStatusResponse > getScenarioStatus (
43+ @ Parameter (description = "시나리오 ID" ) @ PathVariable Long scenarioId
44+ ) {
45+ // Mock
46+ ScenarioStatusResponse mockResponse = new ScenarioStatusResponse (
47+ scenarioId ,
48+ ScenarioStatus .PROCESSING ,
49+ "AI가 시나리오를 생성 중입니다..."
50+ );
51+ return ApiResponse .success (mockResponse , "상태를 성공적으로 조회했습니다." );
52+ }
53+
54+ @ GetMapping ("/info/{scenarioId}" )
55+ @ Operation (summary = "시나리오 상세 조회" , description = "완성된 시나리오의 상세 정보를 조회합니다." )
56+ public ApiResponse <ScenarioDetailResponse > getScenarioDetail (
57+ @ Parameter (description = "시나리오 ID" ) @ PathVariable Long scenarioId
58+ ) {
59+ // Mock: 실제로는 큰 DTO라서 null로 처리하거나 간단한 Mock 생성
60+ return ApiResponse .success (null , "시나리오 상세 정보를 성공적으로 조회했습니다." );
61+ }
62+
63+ @ GetMapping ("/{scenarioId}/timeline" )
64+ @ Operation (summary = "시나리오 타임라인 조회" , description = "시나리오의 선택 경로를 시간순으로 조회합니다." )
65+ public ApiResponse <TimelineResponse > getScenarioTimeline (
66+ @ Parameter (description = "시나리오 ID" ) @ PathVariable Long scenarioId
67+ ) {
68+ // Mock 타임라인 생성
69+ List <TimelineResponse .TimelineEvent > mockEvents = List .of (
70+ new TimelineResponse .TimelineEvent (2020 , "창업 도전" ),
71+ new TimelineResponse .TimelineEvent (2022 , "해외 진출" ),
72+ new TimelineResponse .TimelineEvent (2025 , "상장 성공" )
73+ );
74+ TimelineResponse mockResponse = new TimelineResponse (scenarioId , mockEvents );
75+ return ApiResponse .success (mockResponse , "타임라인을 성공적으로 조회했습니다." );
76+ }
77+
78+ @ GetMapping ("/baselines" )
79+ @ Operation (summary = "베이스라인 목록 조회" , description = "사용자의 베이스라인 목록을 조회합니다." )
80+ public ApiResponse <List <BaselineListResponse >> getBaselines (
81+ Principal principal
82+ ) {
83+ // Mock 베이스라인 목록
84+ List <BaselineListResponse > mockBaselines = List .of (
85+ new BaselineListResponse (1001L , "대학 졸업 이후" , List .of ("교육" , "진로" ), LocalDateTime .now ()),
86+ new BaselineListResponse (1002L , "미국 대학 이후" , List .of ("해외" , "교육" ), LocalDateTime .now ())
87+ );
88+ return ApiResponse .success (mockBaselines , "베이스라인 목록을 성공적으로 조회했습니다." );
89+ }
90+
91+ @ GetMapping ("/compare/{baseId}/{compareId}" )
92+ @ Operation (summary = "시나리오 비교 분석 결과 조회" , description = "두 시나리오를 비교 분석 결과를 조회합니다." )
93+ public ApiResponse <ScenarioCompareResponse > compareScenarios (
94+ @ Parameter (description = "기준 시나리오 ID" ) @ PathVariable Long baseId ,
95+ @ Parameter (description = "비교 시나리오 ID" ) @ PathVariable Long compareId
96+ ) {
97+ // Mock: 복잡한 DTO라서 null 처리
98+ return ApiResponse .success (null , "시나리오 비교를 성공적으로 조회했습니다." );
99+ }
19100}
0 commit comments