Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[넬리] 자기소개서 CRUD 및 마스터 자기소개서 응답 수정 #15

Merged
merged 9 commits into from
Jul 28, 2024

Conversation

nanna29
Copy link
Contributor

@nanna29 nanna29 commented Jul 27, 2024

No description provided.

@nanna29 nanna29 added ✨ feature 기능 개발 ✅ test test 관련 labels Jul 27, 2024
@nanna29 nanna29 requested a review from tape4 July 27, 2024 21:10
public class IntroduceService {

private final IntroduceRepository introduceRepository;
private final RecruitJpaRepository recruitJpaRepository;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이부분 private final RecruitRepository recruitRepository; 로 바꾸셔도됩니다.

밑에 saveIntro 메서드 에서 recruitJpaRepository.findById() 호출하고 없으면 예외처리하는 부분이있는데, 이를 recruitRepository.getById()로 바꾸시면 해당 값이 없을때 ResourceNotFoundException이 동작하도록 예외처리를 이미 작성해두었기 때문에 여기서 따로 예외처리를 할 필요가 없어집니다.

@Transactional
public IntroduceResDto saveIntro(Long recruitId, IntroduceReqDto introduceReqDto){
RecruitEntity recruit=recruitJpaRepository.findById(recruitId)
.orElseThrow(()-> new BaseException(HttpStatus.NOT_FOUND.value(), "해당 공고를 찾을 수 없습니다"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

어떤 리소스가 존재하지 않을때 BaseException으로 처리를 하신것 같습니다.
이를 Common 패키지에 이미 정의해둔 ResourceNotFoundException으로 대체하셔도 될것 같습니다!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기 추가했다가 다시 지우신 import문은 모두 지워주세요

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아직 개발 초기단계라 엔티티 변경사항이 많아 ddl-auto는 create로 해도 될것같습니다.

@tape4 tape4 merged commit 2f596d4 into develop Jul 28, 2024
1 check passed
@tape4 tape4 deleted the mvp/portfolio branch July 28, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature 기능 개발 ✅ test test 관련
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants