Skip to content

Commit 4d45df6

Browse files
committed
헝가리안 표기법 제거(메서드, 변수)
1 parent 51a0a77 commit 4d45df6

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

src/main/java/com/study/bookcafe/controller/MemberController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public ResponseEntity<MemberDto> member(@PathVariable long id) {
3636
@PostMapping("/member/borrow")
3737
@ResponseBody
3838
public ResponseEntity<List<BorrowDto>> borrowBook(@RequestBody RequestBorrowDto requestBorrowDto) {
39-
List<Borrow> borrowList = memberService.borrowBook(requestBorrowDto.getMemberId(), requestBorrowDto.getBookdIdList());
40-
return ResponseEntity.ok(borrowMapper.toBorrowDtoList(borrowList));
39+
List<Borrow> borrows = memberService.borrowBook(requestBorrowDto.getMemberId(), requestBorrowDto.getBookdIdList());
40+
return ResponseEntity.ok(borrowMapper.toBorrowDtoList(borrows));
4141
}
4242

4343
}

src/main/java/com/study/bookcafe/domain/Member.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ public boolean canBorrow() {
2727
return this.getLevel().isBookBorrowCountLeft(getBorrowCount());
2828
}
2929

30-
public List<Borrow> borrowBook(List<Book> bookList) {
31-
List<Borrow> borrowList = new ArrayList<>();
30+
public List<Borrow> borrowBook(List<Book> books) {
31+
List<Borrow> borrows = new ArrayList<>();
3232

3333
// 회원이 대출 가능한 상태 확인
3434
if(!this.canBorrow()) {
35-
return borrowList;
35+
return borrows;
3636
}
3737

3838
// 대출 가능한 도서만 목록에 담기
39-
return bookList.stream()
39+
return books.stream()
4040
.filter(Book::canBorrow)
4141
.map(book -> new Borrow(this, book, LocalDateTime.now()))
4242
.toList();
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.study.bookcafe.dao;
1+
package com.study.bookcafe.repository;
22

33
import com.study.bookcafe.domain.Book;
44

@@ -7,5 +7,5 @@
77

88
public interface BookRepository {
99
Book findById(long bookId);
10-
List<Book> findByIdList(Collection<Long> bookIds);
10+
List<Book> findByIds(Collection<Long> bookIds);
1111
}

src/main/java/com/study/bookcafe/dao/TestBookRepository.java renamed to src/main/java/com/study/bookcafe/repository/TestBookRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.study.bookcafe.dao;
1+
package com.study.bookcafe.repository;
22

33
import com.study.bookcafe.domain.Book;
44
import com.study.bookcafe.domain.Inventory;
@@ -35,7 +35,7 @@ public Book findById(long bookId) {
3535
}
3636

3737
@Override
38-
public List<Book> findByIdList(Collection<Long> bookIds) {
38+
public List<Book> findByIds(Collection<Long> bookIds) {
3939
List<BookEntity> bookEntities = bookIds.stream()
4040
.filter(id -> books.containsKey(id))
4141
.map(id -> books.get(id)).toList();

src/main/java/com/study/bookcafe/service/BookService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ public interface BookService {
1010
Book findById(long bookId);
1111

1212
// 도서 목록 조회 (id list)
13-
List<Book> findByIdList(Collection<Long> bookIds);
13+
List<Book> findByIds(Collection<Long> bookIds);
1414
}

src/main/java/com/study/bookcafe/service/BookServiceImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.study.bookcafe.service;
22

3-
import com.study.bookcafe.dao.BookRepository;
3+
import com.study.bookcafe.repository.BookRepository;
44
import com.study.bookcafe.domain.Book;
55
import org.springframework.stereotype.Service;
66

@@ -34,7 +34,7 @@ public Book findById(long bookId) {
3434
* @return 도서 목록
3535
*/
3636
@Override
37-
public List<Book> findByIdList(Collection<Long> bookIds) {
38-
return bookRepository.findByIdList(bookIds);
37+
public List<Book> findByIds(Collection<Long> bookIds) {
38+
return bookRepository.findByIds(bookIds);
3939
}
4040
}

src/main/java/com/study/bookcafe/service/MemberServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.study.bookcafe.service;
22

3-
import com.study.bookcafe.dao.MemberRepository;
3+
import com.study.bookcafe.repository.MemberRepository;
44
import com.study.bookcafe.domain.Book;
55
import com.study.bookcafe.domain.Borrow;
66
import com.study.bookcafe.domain.Member;
@@ -43,7 +43,7 @@ public Member findById(long memberId) {
4343
@Override
4444
public List<Borrow> borrowBook(long memberId, Collection<Long> bookIds) {
4545
Member member = findById(memberId);
46-
List<Book> books = bookService.findByIdList(bookIds);
46+
List<Book> books = bookService.findByIds(bookIds);
4747
List<Borrow> borrows = member.borrowBook(books);
4848

4949
if(borrows.isEmpty()) return borrows;

0 commit comments

Comments
 (0)