Skip to content

Commit 3c4149b

Browse files
committed
#116 Feat: 강점 리포트 조회와 강점 리포트 히스토리 조회 응답을 분리한다
1 parent ddb1d19 commit 3c4149b

3 files changed

Lines changed: 20 additions & 6 deletions

File tree

src/main/java/next/career/domain/report/controller/ReportController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public ApiResponse<GetStrengthReportDto.Response> getStrengthReport(
6262
각 리포트에는 `strength`, `experience`, `appeal`, `keyword`, `job` 정보가 포함됩니다.
6363
"""
6464
)
65-
public ApiResponse<GetStrengthReportDto.Response> getStrengthReportHistory(
65+
public ApiResponse<GetStrengthReportDto.HistoryResponse> getStrengthReportHistory(
6666
@Parameter(hidden = true, description = "인증된 사용자 정보")
6767
@AuthenticationPrincipal AuthDetails authDetails
6868
) {

src/main/java/next/career/domain/report/controller/dto/GetStrengthReportDto.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,24 @@ public class GetStrengthReportDto {
1515
@Builder
1616
public static class Response{
1717
private List<Report> reportList;
18-
private String occupation;
1918

20-
public static Response of(List<Report> reportList, String occupation){
19+
public static Response of(List<Report> reportList){
2120
return Response.builder()
21+
.reportList(reportList)
22+
.build();
23+
}
24+
}
25+
26+
@Getter
27+
@NoArgsConstructor
28+
@AllArgsConstructor
29+
@Builder
30+
public static class HistoryResponse{
31+
private List<Report> reportList;
32+
private String occupation;
33+
34+
public static HistoryResponse of(List<Report> reportList, String occupation){
35+
return HistoryResponse.builder()
2236
.occupation(occupation)
2337
.reportList(reportList)
2438
.build();

src/main/java/next/career/domain/report/service/ReportService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ public GetStrengthReportDto.Response getStrengthReport(Member member) {
6666
.toList();
6767

6868

69-
return GetStrengthReportDto.Response.of(reportList, strengthReportList.getFirst().getOccupation());
69+
return GetStrengthReportDto.Response.of(reportList);
7070
}
7171

72-
public GetStrengthReportDto.Response getStrengthReportCurrentHistory(Member member) {
72+
public GetStrengthReportDto.HistoryResponse getStrengthReportCurrentHistory(Member member) {
7373

7474
List<StrengthReport> strengthReportList = strengthReportRepository.findAllByMember(member);
7575

@@ -94,7 +94,7 @@ public GetStrengthReportDto.Response getStrengthReportCurrentHistory(Member memb
9494
.toList();
9595

9696

97-
return GetStrengthReportDto.Response.of(reportList, latestReports.getFirst().getOccupation());
97+
return GetStrengthReportDto.HistoryResponse.of(reportList, latestReports.getFirst().getOccupation());
9898
}
9999

100100
@Transactional

0 commit comments

Comments
 (0)