Skip to content

Commit

Permalink
Service의 findById를 find로 Rename하기
Browse files Browse the repository at this point in the history
Related to: #37
  • Loading branch information
ahyoon99 committed Sep 3, 2024
1 parent 5935346 commit d2c589a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ApiController {

@GetMapping("/findById")
public WishListDto findById(@RequestParam int index){
return wishListService.findById(index);
return wishListService.find(index);
}

@GetMapping("/search")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void delete(int index) {
wishListRepository.deleteById(index);
}

public WishListDto findById(int index) {
public WishListDto find(int index) {
Optional<WishListEntity> wishListEntity = wishListRepository.findById(index);
if(!wishListEntity.isPresent()){ // wishListEntity에 값이 없으면 Exception 처리하기
throw new IllegalArgumentException();
Expand Down

0 comments on commit d2c589a

Please sign in to comment.