Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
10e9f05
[refactor] 저장한 책 또는 참여중인 모임방 책 조회시 커서기반 무한스크롤하도록 추가함에 따라 기존 메서드 findS…
hd0rable Aug 28, 2025
3e6f42f
[refactor] 저장한 책 또는 참여중인 모임방 책 조회시 커서기반 무한스크롤하도록 추가함에 따라 BookQueryDto…
hd0rable Aug 28, 2025
76bd19f
[refactor] 저장한 책 또는 참여중인 모임방 책 조회시 커서기반 무한스크롤하도록 추가함에 따라 BookQueryMap…
hd0rable Aug 28, 2025
ce01650
[refactor] 저장한 책 또는 참여중인 모임방 책 조회시 커서기반 무한스크롤하도록 추가함에 따라 관련 컨트롤러에 커서파…
hd0rable Aug 28, 2025
a708ccc
[refactor] 저장한 책 또는 참여중인 모임방 책 조회시 커서기반 무한스크롤 추가 BookQueryPersistence…
hd0rable Aug 28, 2025
561551a
[refactor] 저장한 책 또는 참여중인 모임방 책 조회시 커서기반 무한스크롤 추가 BookQueryPort 관련 메서드…
hd0rable Aug 28, 2025
cf6011b
[refactor] 저장한 책 또는 참여중인 모임방 책 조회시 커서기반 무한스크롤 추가 BookQueryRepository …
hd0rable Aug 28, 2025
0c31d16
[refactor] 저장한 책 또는 참여중인 모임방 책 조회시 커서기반 무한스크롤 추가 BookQueryRepositoryI…
hd0rable Aug 28, 2025
5d89423
[refactor] 저장한 책 또는 참여중인 모임방 책 조회시 커서기반 무한스크롤 추가 response dto 수정 (#283)
hd0rable Aug 28, 2025
59f1b47
[refactor] 저장한 책 또는 참여중인 모임방 책 조회시 커서기반 무한스크롤 추가 서비스 로직 수정 (#283)
hd0rable Aug 28, 2025
26da7a4
[refactor] 저장한 책 또는 참여중인 모임방 책 조회시 커서기반 무한스크롤 추가 유즈케이스 반환값 수정 (#283)
hd0rable Aug 28, 2025
e3ede11
[refactor] 저장한 책 또는 참여중인 모임방 책 조회시 커서기반 무한스크롤 추가 RoomGetHomeJoinedLis…
hd0rable Aug 28, 2025
2e9297d
[feat] Double타입 커서정렬조건 추가로 getDouble 추가 (#283)
hd0rable Aug 28, 2025
e96f14a
[remove] 더미 파일 삭제 (#283)
hd0rable Aug 28, 2025
3c8c9d2
[refactor] 정렬조건 더 명확히 하기 위해 저장된 피드 조회시 메서드 이름 SavedAt로 명확히 수정(#283)
hd0rable Aug 28, 2025
dda3ac0
[refactor] 저장한 책 또는 참여중인 모임방 책 조회시 커서기반 무한스크롤 추가하면서 사용되지 않는 BookSelec…
hd0rable Aug 28, 2025
42547c0
[refactor] RecordPinQuery 빌더 추가 (#283)
hd0rable Aug 28, 2025
e55a487
[refactor] [모임홈] 진행중인 방 조회시 페이지기반 무한스크롤을 커서기반 무한스크롤로 수정 response 수정 (…
hd0rable Aug 28, 2025
a8b2502
[refactor] [모임홈] 진행중인 방 조회시 페이지기반 무한스크롤을 커서기반 무한스크롤로 수정 서비스로직 수정 (#283)
hd0rable Aug 28, 2025
3f86f01
[refactor] [모임홈] 진행중인 방 조회시 페이지기반 무한스크롤을 커서기반 무한스크롤로 수정 RoomParticip…
hd0rable Aug 28, 2025
d1d9dee
[refactor] [모임홈] 진행중인 방 조회시 페이지기반 무한스크롤을 커서기반 무한스크롤로 수정 RoomParticip…
hd0rable Aug 28, 2025
8905d50
[refactor] RecordPinQuery 빌더 추가 (#283)
hd0rable Aug 28, 2025
0fc9583
[refactor] [모임홈] 진행중인 방 조회시 페이지기반 무한스크롤을 커서기반 무한스크롤로 수정 컨트롤러 수정 (#283)
hd0rable Aug 28, 2025
2a7e32b
[refactor] [모임홈] 진행중인 방 조회시 페이지기반 무한스크롤을 커서기반 무한스크롤로 수정 searchHomeJoi…
hd0rable Aug 28, 2025
fdef166
[refactor] [모임홈] 진행중인 방 조회시 페이지기반 무한스크롤을 커서기반 무한스크롤로 수정 findHomeJoine…
hd0rable Aug 28, 2025
c03f771
[remove] [모임홈] 단위 테스트코드 삭제 (#283)
hd0rable Aug 28, 2025
bcb298c
[refactor] [모임홈] 진행중인 방 조회 테스트 코드 수정 (#283)
hd0rable Aug 28, 2025
ecda3e1
[refactor] 저장한 책 조회 테스트 코드 수정 (#283)
hd0rable Aug 28, 2025
b215548
[refactor] 저장한 책 또는 참여중인 모임방 책 조회 테스트코드 수정 (#283)
hd0rable Aug 28, 2025
944daa8
[refactor] 누락 userJpaRepository.deleteAllInBatch() 메서드 수정 (#283)
hd0rable Aug 28, 2025
787b988
[refactor] 변수명 통일 (#283)
hd0rable Aug 28, 2025
4515eb7
[refactor] 변수명 통일 (#283)
hd0rable Aug 28, 2025
3b4f81d
[refactor] 누락 유저 조인 추가 (#283)
hd0rable Aug 28, 2025
7a20f2e
[chore] 주석 오타 수정 (#283)
hd0rable Aug 29, 2025
b835fb9
Merge remote-tracking branch 'origin/develop' into refactor/#283-curs…
hd0rable Aug 29, 2025
0f15e6c
Merge remote-tracking branch 'origin/develop' into refactor/#283-curs…
hd0rable Aug 30, 2025
45233f0
[refactor] 테스트코드 수정 (#283)
hd0rable Aug 30, 2025
bea79e5
머지 충돌 해결
hd0rable Aug 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ public BaseResponse<BookRecruitingRoomsResponse> showRecruitingRoomsWithBook(
@GetMapping("/books/selectable-list")
public BaseResponse<BookSelectableListResponse> showSelectableBookList(
@Parameter(description = "저장한 책 또는 참여 중인 모임의 책을 구분하는 필드 (SAVED : 저장한 책 / JOINING : 모임 방의 책)", example = "SAVED") @RequestParam final String type,
@Parameter(hidden = true) @UserId final Long userId
) {
@Parameter(hidden = true) @UserId final Long userId,
@Parameter(description = "커서 (첫번째 요청시 : null, 다음 요청시 : 이전 요청에서 반환받은 nextCursor 값)")
@RequestParam(required = false) final String cursor)
{
return BaseResponse.ok(
BookSelectableListResponse.of(bookSelectableListUseCase.getSelectableBookList(BookSelectableType.from(type), userId))
bookSelectableListUseCase.getSelectableBookList(BookSelectableType.from(type), userId, cursor)
);
}

Expand All @@ -106,8 +108,11 @@ public BaseResponse<BookSelectableListResponse> showSelectableBookList(
description = "사용자가 저장한 책을 조회 합니다."
)
@GetMapping("/books/saved")
public BaseResponse<BookShowSavedListResponse> showSavedBookList(@Parameter(hidden = true) @UserId final Long userId) {
return BaseResponse.ok(BookShowSavedListResponse.of(bookShowSavedListUseCase.getSavedBookList(userId)));
public BaseResponse<BookShowSavedListResponse> showSavedBookList(
@Parameter(hidden = true) @UserId final Long userId,
@Parameter(description = "커서 (첫번째 요청시 : null, 다음 요청시 : 이전 요청에서 반환받은 nextCursor 값)")
@RequestParam(required = false) final String cursor) {
return BaseResponse.ok(bookShowSavedListUseCase.getSavedBookList(userId, cursor));
}

}
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
package konkuk.thip.book.adapter.in.web.response;

import konkuk.thip.book.application.port.in.dto.BookSelectableResult;

import java.util.List;

public record BookSelectableListResponse(
List<BookSelectableResult> bookList
List<BookSelectableDto> bookList,
String nextCursor,
boolean isLast
) {
public static BookSelectableListResponse of(List<BookSelectableResult> bookSelectableResults) {
return new BookSelectableListResponse(bookSelectableResults);
public record BookSelectableDto(
Long bookId,
String bookTitle,
String authorName,
String publisher,
String bookImageUrl,
String isbn
) {}

public static BookSelectableListResponse of(List<BookSelectableDto> bookList, String nextCursor, boolean isLast) {
return new BookSelectableListResponse(bookList, nextCursor, isLast);
}
Comment thread
hd0rable marked this conversation as resolved.
Comment on lines +10 to 21

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 이거 수정해주셨네요 감삼다

}
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
package konkuk.thip.book.adapter.in.web.response;

import konkuk.thip.book.application.port.in.dto.BookShowSavedInfoResult;

import java.util.List;

public record BookShowSavedListResponse(
List<BookShowSavedInfoResult> bookList
List<BookShowSavedDto> bookList,
String nextCursor,
boolean isLast
) {
public static BookShowSavedListResponse of(List<BookShowSavedInfoResult> bookSavedInfoResultList) {
return new BookShowSavedListResponse(bookSavedInfoResultList);
public record BookShowSavedDto(
Long bookId,
String bookTitle,
String authorName,
String publisher,
String bookImageUrl,
String isbn,
boolean isSaved
) {
}
public static BookShowSavedListResponse of(List<BookShowSavedDto> bookList, String nextCursor, boolean isLast) {
return new BookShowSavedListResponse(bookList, nextCursor, isLast);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@
import konkuk.thip.book.adapter.out.persistence.repository.BookJpaRepository;
import konkuk.thip.book.adapter.out.persistence.repository.SavedBookJpaRepository;
import konkuk.thip.book.application.port.out.BookQueryPort;
import konkuk.thip.book.domain.Book;
import konkuk.thip.common.exception.EntityNotFoundException;
import konkuk.thip.user.adapter.out.jpa.UserJpaEntity;
import konkuk.thip.book.application.port.out.dto.BookQueryDto;
import konkuk.thip.common.util.Cursor;
import konkuk.thip.common.util.CursorBasedList;
import konkuk.thip.user.adapter.out.persistence.repository.UserJpaRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

import static konkuk.thip.common.exception.code.ErrorCode.USER_NOT_FOUND;

@Repository
@RequiredArgsConstructor
Expand All @@ -37,28 +35,38 @@ public boolean existsBookByIsbn(String isbn) {
}

@Override
public List<Book> findSavedBooksByUserId(Long userId) {
UserJpaEntity user = userJpaRepository.findById(userId)
.orElseThrow(() -> new EntityNotFoundException(USER_NOT_FOUND));
public CursorBasedList<BookQueryDto> findSavedBooksBySavedAt(Long userId, Cursor cursor) {
LocalDateTime lastSavedAt = cursor.isFirstRequest() ? null : cursor.getLocalDateTime(0);
int pageSize = cursor.getPageSize();

List<BookQueryDto> dtos = bookJpaRepository.findSavedBooksBySavedAt(userId, lastSavedAt, pageSize);

return bookJpaRepository.findSavedBooksByUserId(user.getUserId()).stream()
.map(bookMapper::toDomainEntity)
.collect(Collectors.toList());
return CursorBasedList.of(dtos, pageSize, dto -> {
Cursor nextCursor = new Cursor(List.of(dto.savedCreatedAt().toString()));
return nextCursor.toEncodedString();
});
}
Comment thread
hd0rable marked this conversation as resolved.

@Override
public List<Book> findJoiningRoomsBooksByUserId(Long userId) {
UserJpaEntity user = userJpaRepository.findById(userId)
.orElseThrow(() -> new EntityNotFoundException(USER_NOT_FOUND));
public CursorBasedList<BookQueryDto> findJoiningRoomsBooksByRoomPercentage(Long userId, Cursor cursor) {
Double lastRoomPercentage = cursor.isFirstRequest() ? null : cursor.getDouble(0);
Long lastBookId = cursor.isFirstRequest() ? null : cursor.getLong(1);
int pageSize = cursor.getPageSize();

return bookJpaRepository.findJoiningRoomsBooksByUserId(user.getUserId())
.stream()
.map(bookMapper::toDomainEntity)
.collect(Collectors.toList());
List<BookQueryDto> dtos = bookJpaRepository.findJoiningRoomsBooksByRoomPercentage(userId, lastRoomPercentage, lastBookId, pageSize);

return CursorBasedList.of(dtos, pageSize, dto -> {
Cursor nextCursor = new Cursor(List.of(
dto.roomPercentage().toString(), // 내림차순 필드, 정렬순서 1
dto.bookId().toString() // 고유 ID, 중복 방지용
));
return nextCursor.toEncodedString();
});
}
Comment on lines +58 to 65

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Double 기반 커서 직렬화 안정성

JOINING의 roomPercentage를 Double 문자열로 커서에 넣고 eq 비교합니다. 부동소수 오차로 eq가 실패할 수 있습니다. 가능하면 BigDecimal 스케일 고정(예: 소수 1자리)로 직렬화/파싱하거나, DB 컬럼 스케일에 맞춘 문자열 포맷을 사용하세요.


@Override
public Set<Long> findUnusedBookIds() {
return bookJpaRepository.findUnusedBookIds();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,12 @@
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Optional;
import java.util.Set;

public interface BookJpaRepository extends JpaRepository<BookJpaEntity, Long> {
public interface BookJpaRepository extends JpaRepository<BookJpaEntity, Long>,BookQueryRepository {
Optional<BookJpaEntity> findByIsbn(String isbn);

@Query("SELECT b FROM BookJpaEntity b " +
"JOIN SavedBookJpaEntity s ON s.bookJpaEntity.bookId = b.bookId " +
"WHERE s.userJpaEntity.userId = :userId " +
"GROUP BY b " +
"ORDER BY MAX(s.createdAt) DESC")
List<BookJpaEntity> findSavedBooksByUserId(Long userId);

@Query("SELECT b FROM BookJpaEntity b " +
"JOIN RoomJpaEntity r ON r.bookJpaEntity.bookId = b.bookId " +
"JOIN RoomParticipantJpaEntity rp ON rp.roomJpaEntity.roomId = r.roomId " +
"WHERE rp.userJpaEntity.userId = :userId " +
" AND r.status = 'ACTIVE' " +
" AND r.startDate <= CURRENT_TIMESTAMP " + // 진행 중인 방만 조회 (모집 중 / 만료된 방 x)
"GROUP BY b " +
"ORDER BY MAX(r.roomPercentage) DESC") // 방의 진행률이 높은 순서로 정렬
List<BookJpaEntity> findJoiningRoomsBooksByUserId(Long userId);

boolean existsByIsbn(String isbn);

// Room, Feed, SavedBook에 모두 참조되지 않은 책 ID만 찾는 쿼리
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package konkuk.thip.book.adapter.out.persistence.repository;

import konkuk.thip.book.application.port.out.dto.BookQueryDto;

import java.time.LocalDateTime;
import java.util.List;

public interface BookQueryRepository {
List<BookQueryDto> findSavedBooksBySavedAt(Long userId, LocalDateTime lastSavedAt, int pageSize);

List<BookQueryDto> findJoiningRoomsBooksByRoomPercentage(Long userId, Double lastRoomPercentage, Long lastBookId, int pageSize);
Comment thread
hd0rable marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
package konkuk.thip.book.adapter.out.persistence.repository;

import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.dsl.Expressions;
import com.querydsl.core.types.dsl.NumberExpression;
import com.querydsl.jpa.impl.JPAQueryFactory;
import konkuk.thip.book.adapter.out.jpa.QBookJpaEntity;
import konkuk.thip.book.adapter.out.jpa.QSavedBookJpaEntity;
import konkuk.thip.book.application.port.out.dto.BookQueryDto;
import konkuk.thip.book.application.port.out.dto.QBookQueryDto;
import konkuk.thip.common.entity.StatusType;
import konkuk.thip.room.adapter.out.jpa.QRoomJpaEntity;
import konkuk.thip.room.adapter.out.jpa.QRoomParticipantJpaEntity;
import konkuk.thip.user.adapter.out.jpa.QUserJpaEntity;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

import static konkuk.thip.common.entity.StatusType.ACTIVE;

@Repository
@RequiredArgsConstructor
public class BookQueryRepositoryImpl implements BookQueryRepository {

private final JPAQueryFactory jpaQueryFactory;

private final QUserJpaEntity user = QUserJpaEntity.userJpaEntity;
private final QBookJpaEntity book = QBookJpaEntity.bookJpaEntity;
private final QSavedBookJpaEntity savedBook = QSavedBookJpaEntity.savedBookJpaEntity;

@Override
public List<BookQueryDto> findSavedBooksBySavedAt(Long userId, LocalDateTime savedAtCursor, int pageSize) {

// 검색 조건(where) 조립
// 유저가 저장한 책만: userId 조건
// 존재하는 유저만: ACTIVE
BooleanBuilder where = new BooleanBuilder();
where.and(savedBook.userJpaEntity.userId.eq(userId));
where.and(user.status.eq(ACTIVE));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filter 적용 pr에서 머지시에 삭제하겠습니다!!

수정 사유 : 중복 쿼리 발생


if (savedAtCursor != null) {
where.and(savedBook.createdAt.lt(savedAtCursor)); // 커서 기준: 저장일 기준 최신순
}
Comment thread
hd0rable marked this conversation as resolved.

return jpaQueryFactory
.select(new QBookQueryDto(
book.bookId,
book.title,
book.authorName,
book.publisher,
book.imageUrl,
book.isbn,
savedBook.createdAt
))
.from(savedBook)
.join(savedBook.userJpaEntity, user)
.join(savedBook.bookJpaEntity, book)
.where(where)
.orderBy(savedBook.createdAt.desc()) // 저장한 시간 최신순 (내림차순)
.limit(pageSize + 1)
.fetch();
}
Comment on lines +34 to +65

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p3: 이거 저번에 회의에서 createdAt을 필드로 잡으면 인덱스를 걸지 않아서 조회시에 full scan을 해야 해서 성능에 안좋다고 해서 pk로 다 바꾸기로 했던 것 같은데 이 쿼리 먼저 도입해보는거 어떨까요??

한번에 다 바꾸는게 나을까요?? @seongjunnoh @hd0rable 두 분 의견에 따르겠습니다!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

한번에 바꾸는것어떨까요?? 어차피이게 마지막 피쳐개발같아서여

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵넵 한번에 바꾸는게 좋을것 같습니다!


@Override
public List<BookQueryDto> findJoiningRoomsBooksByRoomPercentage(Long userId, Double roomPercentageCursor, Long bookIdCursor, int pageSize) {

QRoomJpaEntity room = QRoomJpaEntity.roomJpaEntity;
QRoomParticipantJpaEntity participant = QRoomParticipantJpaEntity.roomParticipantJpaEntity;

NumberExpression<Double> maxRoomPercentage = Expressions.numberTemplate(Double.class, "max({0})", room.roomPercentage);

// 검색 조건(where) 조립
// 유저가 참여한 방만: userId 조건
// 존재하는 유저 방 관계만: ACTIVE, 존재하는 유저만: ACTIVE, 존재하는 방만: ACTIVE
// 활동 기간 중인 방만: startDate ≤ today ≤ endDate
BooleanBuilder where = new BooleanBuilder();
where.and(participant.userJpaEntity.userId.eq(userId));
where.and(participant.status.eq(ACTIVE));
where.and(user.status.eq(ACTIVE));
where.and(room.status.eq(StatusType.ACTIVE));
where.and(room.startDate.loe(LocalDate.now()));
where.and(room.endDate.goe(LocalDate.now()));

BooleanBuilder having = new BooleanBuilder();
if (roomPercentageCursor != null && bookIdCursor != null) {
having.and(
maxRoomPercentage.lt(roomPercentageCursor)
.or(maxRoomPercentage.eq(roomPercentageCursor).and(book.bookId.gt(bookIdCursor)))
);
}

return jpaQueryFactory
.select(new QBookQueryDto(
book.bookId,
book.title,
book.authorName,
book.publisher,
book.imageUrl,
book.isbn,
maxRoomPercentage
))
.from(room)
.join(participant).on(participant.roomJpaEntity.eq(room))
.join(participant.userJpaEntity, user)
.join(room.bookJpaEntity, book)
.where(where)
.groupBy(book.bookId)
.having(having) // 집계 함수 조건은 having 절에 넣기
.orderBy(maxRoomPercentage.desc(), book.bookId.asc()) // 방 진행도 높은 순 (내림차순), 같으면 책 아이디 작은 순 (오름차순)
.limit(pageSize + 1)
.fetch();
}

}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package konkuk.thip.book.application.mapper;

import konkuk.thip.book.adapter.in.web.response.BookRecruitingRoomsResponse;
import konkuk.thip.book.application.port.in.dto.BookSelectableResult;
import konkuk.thip.book.application.port.in.dto.BookShowSavedInfoResult;
import konkuk.thip.book.adapter.in.web.response.BookSelectableListResponse;
import konkuk.thip.book.adapter.in.web.response.BookShowSavedListResponse;
import konkuk.thip.book.application.port.in.dto.BookPinResult;
import konkuk.thip.book.application.port.out.dto.BookQueryDto;
import konkuk.thip.book.domain.Book;
import konkuk.thip.common.util.DateUtil;
import konkuk.thip.room.application.port.out.dto.RoomQueryDto;
Expand All @@ -27,25 +29,18 @@ public interface BookQueryMapper {

List<BookRecruitingRoomsResponse.BookRecruitingRoomDto> toRecruitingRoomDtoList(List<RoomQueryDto> roomDtos);

@Mapping(target = "bookId", source = "book.id")
@Mapping(target = "bookTitle", source = "book.title")
@Mapping(target = "authorName", source = "book.authorName")
@Mapping(target = "publisher", source = "book.publisher")
@Mapping(target = "bookImageUrl", source = "book.imageUrl")
@Mapping(target = "isbn", source = "book.isbn")
BookSelectableResult toBookSelectableResult(Book book);
BookPinResult toBookPinResult(Book book);

List<BookSelectableResult> toBookSelectableResultList(List<Book> books);
@Mapping(target = "isSaved", constant = "true")
BookShowSavedListResponse.BookShowSavedDto toBookShowSavedDto(BookQueryDto dto);

List<BookShowSavedListResponse.BookShowSavedDto> toBookShowSavedListResponse(List<BookQueryDto> dtos);

@Mapping(target = "bookId", source = "book.id")
@Mapping(target = "bookTitle", source = "book.title")
@Mapping(target = "authorName", source = "book.authorName")
@Mapping(target = "publisher", source = "book.publisher")
@Mapping(target = "bookImageUrl", source = "book.imageUrl")
@Mapping(target = "isbn", source = "book.isbn")
@Mapping(target = "isSaved", constant = "true")
BookShowSavedInfoResult toBookShowSavedInfoResult(Book book);
BookSelectableListResponse.BookSelectableDto toBookSelectableDto(BookQueryDto dto);

List<BookShowSavedInfoResult> toBookShowSavedInfoResultList(List<Book> savedBookList);
List<BookSelectableListResponse.BookSelectableDto> toBookSelectableListResponse(List<BookQueryDto> contents);
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package konkuk.thip.book.application.port.in;

import konkuk.thip.book.application.port.in.dto.BookSelectableResult;
import konkuk.thip.book.adapter.in.web.response.BookSelectableListResponse;
import konkuk.thip.book.application.port.in.dto.BookSelectableType;

import java.util.List;

public interface BookSelectableListUseCase {
List<BookSelectableResult> getSelectableBookList(BookSelectableType bookSelectableType, Long userId);
BookSelectableListResponse getSelectableBookList(BookSelectableType bookSelectableType, Long userId, String cursor);
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package konkuk.thip.book.application.port.in;

import konkuk.thip.book.application.port.in.dto.BookShowSavedInfoResult;

import java.util.List;
import konkuk.thip.book.adapter.in.web.response.BookShowSavedListResponse;

public interface BookShowSavedListUseCase {
List<BookShowSavedInfoResult> getSavedBookList(Long userId);
BookShowSavedListResponse getSavedBookList(Long userId, String cursor);
}
Loading