Skip to content

Commit

Permalink
Merge pull request #109 from Sinchone/develop
Browse files Browse the repository at this point in the history
v1.0.2
  • Loading branch information
Jeongho0805 authored Jun 26, 2023
2 parents eea7c38 + 7c88626 commit 4124773
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class MyPageController {
private final MyPageService myPageService;

@GetMapping("/nickname-check")
public ResponseEntity<Object> isDuplicatedNickname(String nickname) {
public ResponseEntity<Object> isDuplicatedNickname(@RequestParam String nickname) {
NicknameCheckDto result = myPageService.isDuplicatedNickname(nickname);
return ResponseEntity.ok().body(CommonResponse.success(result, SuccessCode.VALIDATE_NICKNAME.getMessage()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public Slice<RecruitmentListDto> 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;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.lastone.core.dto.recruitment;

import lombok.Getter;

@Getter
public class RecruitmentIdDto {

private final Long id;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -12,7 +11,7 @@ public interface RecruitmentRepositoryCustom {

Slice<RecruitmentListDto> getListDto(RecruitmentSearchCondition searchCondition);

Optional<RecruitmentDetailDto> getDetailDto(Long recruitmentId);
Optional<Recruitment> getDetail(Long recruitmentId);

List<RecruitmentListDto> getListDtoInMainPage();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class RecruitmentRepositoryImpl implements RecruitmentRepositoryCustom{
private static final int DEFAULT_MAIN_PAGE_SIZE = 9;

@Override
public Optional<RecruitmentDetailDto> getDetailDto(Long recruitmentId) {
public Optional<Recruitment> getDetail(Long recruitmentId) {

Recruitment findRecruitment = queryFactory
.selectFrom(recruitment)
Expand All @@ -48,7 +48,7 @@ public Optional<RecruitmentDetailDto> getDetailDto(Long recruitmentId) {
)
.fetchOne();

return Optional.of(RecruitmentDetailDto.toDto(findRecruitment));
return Optional.ofNullable(findRecruitment);
}

@Override
Expand Down

0 comments on commit 4124773

Please sign in to comment.