Skip to content

Commit

Permalink
rename: 메서드명 컨벤션 준수
Browse files Browse the repository at this point in the history
  • Loading branch information
songsunkook committed Jan 6, 2024
1 parent 82928a9 commit fdac3f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ public class DeptController {

@GetMapping("/dept")
public ResponseEntity<DeptResponse> findDept(@RequestParam(value = "dept_num") Long deptNumber) {
DeptResponse foundDepartment = deptService.findById(deptNumber);
DeptResponse foundDepartment = deptService.getById(deptNumber);
return ResponseEntity.ok(foundDepartment);
}

@GetMapping("/depts")
public ResponseEntity<List<DeptListItemResponse>> findAllDept() {
List<DeptListItemResponse> response = deptService.findAll();
List<DeptListItemResponse> response = deptService.getAll();
return ResponseEntity.ok(response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
@Transactional(readOnly = true)
public class DeptService {

public DeptResponse findById(Long id) {
public DeptResponse getById(Long id) {
Dept dept = Dept.findByNumber(id)
.orElseThrow(() -> new IllegalArgumentException("존재하지 않는 학부 코드입니다."));

return DeptResponse.from(id, dept);
}

public List<DeptListItemResponse> findAll() {
public List<DeptListItemResponse> getAll() {
return Dept.findAll()
.stream()
.map(DeptListItemResponse::from)
Expand Down

0 comments on commit fdac3f4

Please sign in to comment.