|
5 | 5 | import lombok.RequiredArgsConstructor; |
6 | 6 | import org.springframework.data.domain.PageRequest; |
7 | 7 | import org.springframework.data.domain.Pageable; |
8 | | -import org.springframework.http.ResponseEntity; |
9 | 8 | import org.springframework.web.bind.annotation.*; |
10 | 9 | import reactor.core.publisher.Mono; |
11 | 10 | import sopt.comfit.company.dto.response.GetReportCompanyResponseDto; |
|
16 | 15 | import sopt.comfit.report.dto.request.MatchExperienceRequestDto; |
17 | 16 | import sopt.comfit.report.dto.response.AIReportResponseDto; |
18 | 17 | import sopt.comfit.report.dto.response.GetReportSummaryResponseDto; |
19 | | -import sopt.comfit.report.service.AIReportService; |
| 18 | +import sopt.comfit.report.service.AIReportFacade; |
20 | 19 |
|
21 | 20 | @RestController |
22 | 21 | @RequiredArgsConstructor |
23 | 22 | @RequestMapping("/api/v1/ai-reports") |
24 | 23 | public class AIReportController implements AIReportSwagger { |
25 | 24 |
|
26 | | - private final AIReportService aiReportService; |
27 | | - |
28 | | - @Override |
29 | | - public AIReportResponseDto matchExperience(@LoginUser Long userId, |
30 | | - @Valid @RequestBody MatchExperienceRequestDto requestDto){ |
31 | | - return aiReportService.matchExperience(MatchExperienceCommandDto.of(userId, requestDto)); |
32 | | - } |
| 25 | + private final AIReportFacade aiReportFacade; |
33 | 26 |
|
34 | 27 | @Override |
35 | 28 | public PageDto<GetReportSummaryResponseDto> getReportList(@LoginUser Long userId, |
36 | 29 | @RequestParam(defaultValue = "1") int page, |
37 | 30 | @RequestParam(required = false) String keyword){ |
38 | 31 | Pageable pageable = PageRequest.of(Math.max(page - 1, 0), 4); |
39 | | - return aiReportService.getReportList(userId, pageable, keyword); |
| 32 | + return aiReportFacade.getReportList(userId, pageable, keyword); |
40 | 33 | } |
41 | 34 |
|
42 | 35 | @Override |
43 | 36 | public AIReportResponseDto getReport(@LoginUser Long userId, |
44 | 37 | @PathVariable Long reportId){ |
45 | | - return aiReportService.getReport(userId, reportId); |
| 38 | + return aiReportFacade.getReport(userId, reportId); |
46 | 39 | } |
47 | 40 |
|
48 | 41 | @Override |
49 | 42 | public GetReportExperienceResponseDto getReportExperience(@LoginUser Long userId){ |
50 | 43 |
|
51 | | - return aiReportService.getReportExperience(userId); |
| 44 | + return aiReportFacade.getReportExperience(userId); |
52 | 45 | } |
53 | 46 |
|
54 | 47 | @Override |
55 | 48 | public GetReportCompanyResponseDto getReportCompany(@PathVariable Long companyId){ |
56 | | - return aiReportService.getReportCompany(companyId); |
| 49 | + return aiReportFacade.getReportCompany(companyId); |
| 50 | + } |
| 51 | + |
| 52 | + @Override |
| 53 | + public AIReportResponseDto matchExperience(@LoginUser Long userId, |
| 54 | + @Valid @RequestBody MatchExperienceRequestDto requestDto){ |
| 55 | + return aiReportFacade.matchExperience(MatchExperienceCommandDto.of(userId, requestDto)); |
57 | 56 | } |
58 | 57 |
|
59 | 58 | @PostMapping("/match/async") |
60 | 59 | @SecurityRequirement(name = "JWT") |
61 | 60 | public Mono<AIReportResponseDto> matchAsync(@LoginUser Long userid , |
62 | 61 | @RequestBody MatchExperienceRequestDto request) { |
63 | | - return aiReportService.matchExperienceAsync(MatchExperienceCommandDto.of(userid, request)); |
| 62 | + return aiReportFacade.matchExperienceAsync(MatchExperienceCommandDto.of(userid, request)); |
64 | 63 | } |
65 | 64 |
|
66 | 65 | @PostMapping("/match/async/webclient") |
67 | 66 | @SecurityRequirement(name = "JWT") |
68 | 67 | public AIReportResponseDto matchAsyncWebClient(@LoginUser Long userid , |
69 | 68 | @RequestBody MatchExperienceRequestDto request) { |
70 | | - return aiReportService.matchExperienceWebclient(MatchExperienceCommandDto.of(userid, request)); |
| 69 | + return aiReportFacade.matchExperienceWebclient(MatchExperienceCommandDto.of(userid, request)); |
| 70 | + } |
| 71 | + |
| 72 | + @PostMapping("/match/async/parallel") |
| 73 | + @SecurityRequirement(name = "JWT") |
| 74 | + public Mono<AIReportResponseDto> matchExperienceWebfluxParallel(@LoginUser Long userId, |
| 75 | + @RequestBody MatchExperienceRequestDto requestDto){ |
| 76 | + return aiReportFacade.matchExperienceParallel(MatchExperienceCommandDto.of(userId, requestDto)); |
71 | 77 | } |
72 | 78 | } |
0 commit comments