-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
public class IntroduceService { | ||
|
||
private final IntroduceRepository introduceRepository; | ||
private final RecruitJpaRepository recruitJpaRepository; |
There was a problem hiding this comment.
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(), "해당 공고를 찾을 수 없습니다")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어떤 리소스가 존재하지 않을때 BaseException으로 처리를 하신것 같습니다.
이를 Common 패키지에 이미 정의해둔 ResourceNotFoundException으로 대체하셔도 될것 같습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기 추가했다가 다시 지우신 import문은 모두 지워주세요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아직 개발 초기단계라 엔티티 변경사항이 많아 ddl-auto는 create로 해도 될것같습니다.
No description provided.