Skip to content

Commit 528ff83

Browse files
authored
Merge pull request #53 from parentsgowork/refactor/#52
[#52] Refactor: 구직 정보 조회 시 id 출력
2 parents 20f813c + 02920c2 commit 528ff83

File tree

6 files changed

+18
-7
lines changed

6 files changed

+18
-7
lines changed

src/main/java/com/parentsgowork/server/converter/JobInfoConverter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ public static JobInfoResponseDTO.AddJobResultDTO toAddJobResultDTO(JobInfo jobIn
1515
.build();
1616
}
1717

18-
public static List<JobInfoResponseDTO.JobInfoResultDTO> getJobInfoListDTO(List<JobInfo> jobInfos) {
18+
public static List<JobInfoResponseDTO.JobInfoListDTO> getJobInfoListDTO(List<JobInfo> jobInfos) {
1919
return jobInfos.stream()
20-
.map(job -> JobInfoResponseDTO.JobInfoResultDTO.builder()
20+
.map(job -> JobInfoResponseDTO.JobInfoListDTO.builder()
21+
.id(job.getId())
2122
.title(job.getTitle())
2223
.content(job.getContent())
2324
.build())

src/main/java/com/parentsgowork/server/service/jobInfoService/JobInfoQueryService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
public interface JobInfoQueryService {
88

9-
List<JobInfoResponseDTO.JobInfoResultDTO> getJobInfoList(Long userId);
9+
List<JobInfoResponseDTO.JobInfoListDTO> getJobInfoList(Long userId);
1010
JobInfoResponseDTO.JobInfoDetailDTO getJobInfoDetails(Long userId, Long jobInfoId);
1111
}

src/main/java/com/parentsgowork/server/service/jobInfoService/JobInfoQueryServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class JobInfoQueryServiceImpl implements JobInfoQueryService {
1818
private final JobInfoRepository jobInfoRepository;
1919

2020
@Override
21-
public List<JobInfoResponseDTO.JobInfoResultDTO> getJobInfoList(Long userId) {
21+
public List<JobInfoResponseDTO.JobInfoListDTO> getJobInfoList(Long userId) {
2222

2323
List<JobInfo> jobInfos = jobInfoRepository.findJobInfoList(userId);
2424

src/main/java/com/parentsgowork/server/web/controller/JobInfoController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ public ApiResponse<List<JobInfoResponseDTO.AddJobResultDTO>> addJobInfo(@Request
7575
}
7676

7777
@GetMapping("")
78-
public ApiResponse<List<JobInfoResponseDTO.JobInfoResultDTO>> getJobInfoList() {
78+
public ApiResponse<List<JobInfoResponseDTO.JobInfoListDTO>> getJobInfoList() {
7979
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
8080
Long userId = (Long) authentication.getPrincipal();
8181

82-
List<JobInfoResponseDTO.JobInfoResultDTO> response = jobInfoQueryService.getJobInfoList(userId);
82+
List<JobInfoResponseDTO.JobInfoListDTO> response = jobInfoQueryService.getJobInfoList(userId);
8383
return ApiResponse.onSuccess(response);
8484
}
8585

src/main/java/com/parentsgowork/server/web/controller/specification/JobInfoSpecification.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public interface JobInfoSpecification {
4040
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON200", description = "⭕ SUCCESS, 성공"),
4141
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "COMMON400", description = "❌ BAD, 잘못된 요청", content = @Content(schema = @Schema(implementation = ApiResponse.class)))
4242
})
43-
ApiResponse<List<JobInfoResponseDTO.JobInfoResultDTO>> getJobInfoList();
43+
ApiResponse<List<JobInfoResponseDTO.JobInfoListDTO>> getJobInfoList();
4444

4545
@GetMapping("/{jobInfoId}")
4646
@Operation(summary = "특정 구직정보 조회", description = "내가 저장한 특정 구직정보를 조회합니다. 구직정보 아이디 값을 보내주세요.")

src/main/java/com/parentsgowork/server/web/dto/JobInfoDTO/JobInfoResponseDTO.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ public static class AddJobResultDTO {
4747
private String content;
4848
}
4949

50+
@Getter
51+
@Builder
52+
@NoArgsConstructor
53+
@AllArgsConstructor
54+
public static class JobInfoListDTO {
55+
private Long id;
56+
private String title;
57+
private String content;
58+
}
59+
5060
// 저장한 구직정보 상세페이지 dto
5161
@Getter
5262
@Builder

0 commit comments

Comments
 (0)