-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from f-lab-edu/feature/1
회원의 대출 목록 조회 추가
- Loading branch information
Showing
61 changed files
with
628 additions
and
272 deletions.
There are no files selected for viewing
18 changes: 0 additions & 18 deletions
18
src/main/java/com/study/bookcafe/application/borrow/BorrowService.java
This file was deleted.
Oops, something went wrong.
7 changes: 4 additions & 3 deletions
7
...ookcafe/application/book/BookService.java → ...application/command/book/BookService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
package com.study.bookcafe.application.book; | ||
|
||
import com.study.bookcafe.domain.book.Book; | ||
package com.study.bookcafe.application.command.book; | ||
|
||
import com.study.bookcafe.domain.command.book.Book; | ||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
public interface BookService { | ||
|
||
// 도서 조회 (id) | ||
Book findById(long bookId); | ||
|
||
// 도서 목록 조회 (id list) | ||
List<Book> findByIds(Collection<Long> bookIds); | ||
|
||
} |
7 changes: 3 additions & 4 deletions
7
...afe/application/book/BookServiceImpl.java → ...ication/command/book/BookServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/java/com/study/bookcafe/application/command/borrow/BorrowService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.study.bookcafe.application.command.borrow; | ||
|
||
import com.study.bookcafe.domain.command.borrow.Borrow; | ||
import com.study.bookcafe.domain.command.borrow.Reservation; | ||
import java.util.Collection; | ||
|
||
public interface BorrowService { | ||
|
||
// 도서 대출 저장 | ||
void save(Borrow borrow); | ||
void save(Collection<Borrow> borrows); | ||
|
||
// 도서 예약 저장 | ||
void save(Reservation reservation); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/com/study/bookcafe/application/command/member/MemberService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.study.bookcafe.application.command.member; | ||
|
||
import com.study.bookcafe.domain.command.member.Member; | ||
import java.util.Collection; | ||
|
||
public interface MemberService { | ||
|
||
// 회원 조회 (id) | ||
Member findById(long memberId); | ||
|
||
// 도서 대출 | ||
void borrowBook(long memberId, Collection<Long> bookIds); | ||
|
||
// 도서 예약 | ||
void reserveBook(long memberId, long bookId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
src/main/java/com/study/bookcafe/application/member/MemberService.java
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
src/main/java/com/study/bookcafe/application/query/book/BookQueryService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.study.bookcafe.application.query.book; | ||
|
||
import com.study.bookcafe.domain.query.book.BookView; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
public interface BookQueryService { | ||
|
||
// 도서 조회 (id) | ||
BookView findById(long bookId); | ||
|
||
// 도서 목록 조회 (id list) | ||
List<BookView> findByIds(Collection<Long> bookIds); | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/java/com/study/bookcafe/application/query/book/BookQueryServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.study.bookcafe.application.query.book; | ||
|
||
import com.study.bookcafe.domain.query.book.BookQueryRepository; | ||
import com.study.bookcafe.domain.query.book.BookView; | ||
import org.springframework.stereotype.Service; | ||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
@Service | ||
public class BookQueryServiceImpl implements BookQueryService { | ||
|
||
private final BookQueryRepository bookQueryRepository; | ||
|
||
public BookQueryServiceImpl(BookQueryRepository bookQueryRepository) { | ||
this.bookQueryRepository = bookQueryRepository; | ||
} | ||
|
||
/** | ||
* 도서를 ID로 조회한다. | ||
* | ||
* @param bookId 도서 ID | ||
* @return 도서 | ||
*/ | ||
@Override | ||
public BookView findById(long bookId) { | ||
return bookQueryRepository.findById(bookId); | ||
} | ||
|
||
/** | ||
* 도서를 ID 목록으로 조회한다. | ||
* | ||
* @param bookIds 도서 ID 목록 | ||
* @return 도서 목록 | ||
*/ | ||
@Override | ||
public List<BookView> findByIds(Collection<Long> bookIds) { | ||
return bookQueryRepository.findByIds(bookIds); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/study/bookcafe/application/query/borrow/BorrowQueryService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.study.bookcafe.application.query.borrow; | ||
|
||
import com.study.bookcafe.domain.query.borrow.BorrowDetails; | ||
import java.util.List; | ||
|
||
public interface BorrowQueryService { | ||
|
||
// 도서 대출 조회 | ||
List<BorrowDetails> findBorrows(long memberId); | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/com/study/bookcafe/application/query/borrow/BorrowQueryServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.study.bookcafe.application.query.borrow; | ||
|
||
import com.study.bookcafe.domain.query.borrow.BorrowDetails; | ||
import com.study.bookcafe.domain.command.borrow.BorrowRepository; | ||
import com.study.bookcafe.domain.query.borrow.BorrowQueryRepository; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.List; | ||
|
||
@Service | ||
public class BorrowQueryServiceImpl implements BorrowQueryService { | ||
private final BorrowQueryRepository borrowQueryRepository; | ||
|
||
public BorrowQueryServiceImpl(BorrowQueryRepository borrowQueryRepository) { | ||
this.borrowQueryRepository = borrowQueryRepository; | ||
} | ||
|
||
/** | ||
* 대출 목록을 조회한다. | ||
* | ||
* @param memberId 회원 ID | ||
* @return 대출 목록 | ||
*/ | ||
@Override | ||
public List<BorrowDetails> findBorrows(long memberId) { | ||
return borrowQueryRepository.findByMemberId(memberId); | ||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/study/bookcafe/application/query/member/MemberQueryService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.study.bookcafe.application.query.member; | ||
|
||
import com.study.bookcafe.domain.query.borrow.BorrowDetails; | ||
import com.study.bookcafe.domain.command.member.Member; | ||
|
||
import java.util.List; | ||
|
||
public interface MemberQueryService { | ||
|
||
// 회원 조회 (id) | ||
Member findById(long memberId); | ||
|
||
// 도서 대출 조회 | ||
List<BorrowDetails> findBorrows(long memberId); | ||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/com/study/bookcafe/application/query/member/MemberQueryServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.study.bookcafe.application.query.member; | ||
|
||
import com.study.bookcafe.application.query.borrow.BorrowQueryService; | ||
import com.study.bookcafe.domain.query.borrow.BorrowDetails; | ||
import com.study.bookcafe.domain.command.member.Member; | ||
import com.study.bookcafe.domain.command.member.MemberRepository; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.List; | ||
|
||
@Service | ||
public class MemberQueryServiceImpl implements MemberQueryService { | ||
|
||
private final MemberRepository memberRepository; | ||
private final BorrowQueryService borrowService; | ||
|
||
public MemberQueryServiceImpl(MemberRepository memberRepository, BorrowQueryService borrowService) { | ||
this.memberRepository = memberRepository; | ||
this.borrowService = borrowService; | ||
} | ||
|
||
/** | ||
* 회원을 ID로 조회한다. | ||
* | ||
* @param memberId 회원 ID | ||
* @return 회원 | ||
*/ | ||
@Override | ||
public Member findById(long memberId) { | ||
return memberRepository.findById(memberId); | ||
} | ||
|
||
/** | ||
* 회원의 대출 목록을 조회한다. | ||
* | ||
* @param memberId 회원 ID | ||
* @return 대출 목록 | ||
*/ | ||
@Override | ||
public List<BorrowDetails> findBorrows(long memberId) { | ||
return borrowService.findBorrows(memberId); | ||
} | ||
} |
Oops, something went wrong.