From d5df2ba55bf48aa11295005e69904f5c24b3741d Mon Sep 17 00:00:00 2001 From: JeonghoPark Date: Mon, 26 Jun 2023 20:12:02 +0900 Subject: [PATCH] =?UTF-8?q?[LAS-56]=20fix:=20=EB=AA=A8=EC=A7=91=EA=B8=80?= =?UTF-8?q?=20=EC=83=81=EC=84=B8=20=EC=A1=B0=ED=9A=8C=EC=8B=9C=20=EB=AA=A8?= =?UTF-8?q?=EC=A7=91=EA=B8=80=20=EC=97=86=EC=9D=84=20=EA=B2=BD=EC=9A=B0=20?= =?UTF-8?q?=EC=98=88=EC=99=B8=20=EC=B2=98=EB=A6=AC=20=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=EC=97=90=EB=9F=AC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apiserver/service/recruitment/RecruitmentServiceImpl.java | 3 ++- .../repository/recruitment/RecruitmentRepositoryCustom.java | 3 +-- .../repository/recruitment/RecruitmentRepositoryImpl.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api-server/src/main/java/com/lastone/apiserver/service/recruitment/RecruitmentServiceImpl.java b/api-server/src/main/java/com/lastone/apiserver/service/recruitment/RecruitmentServiceImpl.java index c8e6b0e0..2de9e531 100644 --- a/api-server/src/main/java/com/lastone/apiserver/service/recruitment/RecruitmentServiceImpl.java +++ b/api-server/src/main/java/com/lastone/apiserver/service/recruitment/RecruitmentServiceImpl.java @@ -65,7 +65,8 @@ public Slice getList(RecruitmentSearchCondition searchCondit @Override public RecruitmentDetailDto getDetail(Long recruitmentId) { - RecruitmentDetailDto recruitmentDetailDto = recruitmentRepository.getDetailDto(recruitmentId).orElseThrow(RecruitmentNotFoundException::new); + Recruitment recruitment = recruitmentRepository.getDetail(recruitmentId).orElseThrow(RecruitmentNotFoundException::new); + RecruitmentDetailDto recruitmentDetailDto = RecruitmentDetailDto.toDto(recruitment); recruitmentDetailDto.setSbdDto(sbdRepository.findLatestRecordByMemberId(recruitmentDetailDto.getMemberId())); return recruitmentDetailDto; } diff --git a/core/src/main/java/com/lastone/core/repository/recruitment/RecruitmentRepositoryCustom.java b/core/src/main/java/com/lastone/core/repository/recruitment/RecruitmentRepositoryCustom.java index 6c0b6650..5fcddc9c 100644 --- a/core/src/main/java/com/lastone/core/repository/recruitment/RecruitmentRepositoryCustom.java +++ b/core/src/main/java/com/lastone/core/repository/recruitment/RecruitmentRepositoryCustom.java @@ -1,7 +1,6 @@ package com.lastone.core.repository.recruitment; import com.lastone.core.domain.recruitment.Recruitment; -import com.lastone.core.dto.recruitment.RecruitmentDetailDto; import com.lastone.core.dto.recruitment.RecruitmentListDto; import com.lastone.core.dto.recruitment.RecruitmentSearchCondition; import org.springframework.data.domain.Slice; @@ -12,7 +11,7 @@ public interface RecruitmentRepositoryCustom { Slice getListDto(RecruitmentSearchCondition searchCondition); - Optional getDetailDto(Long recruitmentId); + Optional getDetail(Long recruitmentId); List getListDtoInMainPage(); diff --git a/core/src/main/java/com/lastone/core/repository/recruitment/RecruitmentRepositoryImpl.java b/core/src/main/java/com/lastone/core/repository/recruitment/RecruitmentRepositoryImpl.java index 0faefd61..e97f9506 100644 --- a/core/src/main/java/com/lastone/core/repository/recruitment/RecruitmentRepositoryImpl.java +++ b/core/src/main/java/com/lastone/core/repository/recruitment/RecruitmentRepositoryImpl.java @@ -35,7 +35,7 @@ public class RecruitmentRepositoryImpl implements RecruitmentRepositoryCustom{ private static final int DEFAULT_MAIN_PAGE_SIZE = 9; @Override - public Optional getDetailDto(Long recruitmentId) { + public Optional getDetail(Long recruitmentId) { Recruitment findRecruitment = queryFactory .selectFrom(recruitment) @@ -48,7 +48,7 @@ public Optional getDetailDto(Long recruitmentId) { ) .fetchOne(); - return Optional.of(RecruitmentDetailDto.toDto(findRecruitment)); + return Optional.ofNullable(findRecruitment); } @Override