Skip to content

Commit 6007d66

Browse files
authored
[BOOK-324] �fix: 내서재와 독서기록 기본정렬을 수정합니다. (#117) (#118)
1 parent 040137b commit 6007d66

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

apis/src/main/kotlin/org/yapp/apis/book/controller/BookController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class BookController(
7171
@RequestParam(required = false) status: BookStatus?,
7272
@RequestParam(required = false) sort: UserBookSortType?,
7373
@RequestParam(required = false) title: String?,
74-
@PageableDefault(size = 10, sort = ["createdAt"], direction = Sort.Direction.DESC)
74+
@PageableDefault(size = 10, sort = ["updatedAt"], direction = Sort.Direction.DESC)
7575
pageable: Pageable
7676
): ResponseEntity<UserBookPageResponse> {
7777
val response = bookUseCase.getUserLibraryBooks(userId, status, sort, title, pageable)

apis/src/main/kotlin/org/yapp/apis/readingrecord/controller/ReadingRecordController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class ReadingRecordController(
6363
@AuthenticationPrincipal userId: UUID,
6464
@PathVariable userBookId: UUID,
6565
@RequestParam(required = false) sort: ReadingRecordSortType?,
66-
@PageableDefault(size = 10, sort = ["createdAt"], direction = Sort.Direction.DESC)
66+
@PageableDefault(size = 10, sort = ["updatedAt"], direction = Sort.Direction.DESC)
6767
pageable: Pageable
6868
): ResponseEntity<ReadingRecordPageResponse> {
6969
val response = readingRecordUseCase.getReadingRecordsByUserBookId(

domain/src/main/kotlin/org/yapp/domain/readingrecord/ReadingRecordSortType.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package org.yapp.domain.readingrecord
33
enum class ReadingRecordSortType {
44
CREATED_DATE_ASC,
55
CREATED_DATE_DESC,
6+
UPDATED_DATE_ASC,
7+
UPDATED_DATE_DESC,
68
PAGE_NUMBER_ASC,
79
PAGE_NUMBER_DESC;
810
}

infra/src/main/kotlin/org/yapp/infra/readingrecord/repository/impl/JpaReadingRecordQuerydslRepositoryImpl.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ class JpaReadingRecordQuerydslRepositoryImpl(
5959

6060
ReadingRecordSortType.CREATED_DATE_ASC -> arrayOf(readingRecord.createdAt.asc())
6161
ReadingRecordSortType.CREATED_DATE_DESC -> arrayOf(readingRecord.createdAt.desc())
62-
null -> arrayOf(readingRecord.createdAt.desc())
62+
ReadingRecordSortType.UPDATED_DATE_ASC -> arrayOf(readingRecord.updatedAt.asc())
63+
ReadingRecordSortType.UPDATED_DATE_DESC -> arrayOf(readingRecord.updatedAt.desc())
64+
null -> arrayOf(readingRecord.updatedAt.desc())
6365
}
6466
}
6567

0 commit comments

Comments
 (0)