11package dmu .dasom .api .domain .executive .service ;
22
3+ import dmu .dasom .api .domain .common .exception .CustomException ;
4+ import dmu .dasom .api .domain .common .exception .ErrorCode ;
35import dmu .dasom .api .domain .executive .dto .ExecutiveCreationResponseDto ;
46import dmu .dasom .api .domain .executive .dto .ExecutiveRequestDto ;
57import dmu .dasom .api .domain .executive .dto .ExecutiveResponseDto ;
@@ -21,7 +23,7 @@ public class ExecutiveService {
2123 // 이름, 직책, 깃허브 주소 검색
2224 public ExecutiveResponseDto getExecutiveById (Long id ) {
2325 ExecutiveEntity executive = executiveRepository .findById (id )
24- .orElseThrow (() -> new IllegalArgumentException ( "Executive not found" )); // 일단 에러 코드 출력 나중에 커스텀 에러코드로 수정
26+ .orElseThrow (() -> new CustomException ( ErrorCode . EXECUTIVE_NOT_FOUND ));
2527
2628 return executive .toResponseDto ();
2729 }
@@ -35,7 +37,7 @@ public ExecutiveCreationResponseDto createExecutive(ExecutiveRequestDto requestD
3537 @ Transactional
3638 public void deleteExective (Long id ) {
3739 ExecutiveEntity executive = executiveRepository .findById (id )
38- .orElseThrow (() -> new IllegalArgumentException ( "Executive not found" )); // 일단 에러 코드 출력 나중에 커스텀 에러코드 수정
40+ .orElseThrow (() -> new CustomException ( ErrorCode . EXECUTIVE_NOT_FOUND ));
3941
4042 executiveRepository .delete (executive );
4143 }
@@ -44,7 +46,7 @@ public void deleteExective(Long id) {
4446 @ Transactional
4547 public ExecutiveResponseDto updateExecutive (Long id , ExecutiveUpdateRequestDto requestDto ) {
4648 ExecutiveEntity executive = executiveRepository .findById (id )
47- .orElseThrow (() -> new IllegalArgumentException ( "Executive not found" )); // 임시 에러 코드 출력 나중에 커스텀 에러코드로 수정
49+ .orElseThrow (() -> new CustomException ( ErrorCode . EXECUTIVE_NOT_FOUND ));
4850
4951 executive .update (requestDto .getName (), requestDto .getPosition (), requestDto .getGithubUrl ());
5052
0 commit comments