Skip to content

Commit 8090ee7

Browse files
committed
[BOOK-250] fix: DTO 변경사항 적용 및 lastPage 판별 로직 수정
1 parent 19cc8fc commit 8090ee7

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ internal fun BookSearchResponse.toModel(): BookSearchModel {
5454
return BookSearchModel(
5555
version = version,
5656
title = title,
57-
link = link,
5857
pubDate = pubDate,
5958
totalResults = totalResults,
6059
startIndex = startIndex,
6160
itemsPerPage = itemsPerPage,
6261
query = query,
6362
searchCategoryId = searchCategoryId,
6463
searchCategoryName = searchCategoryName,
64+
lastPage = lastPage,
6565
books = books.map { it.toModel() },
6666
)
6767
}
@@ -73,6 +73,7 @@ internal fun BookSummary.toModel(): BookSummaryModel {
7373
author = author,
7474
publisher = publisher,
7575
coverImageUrl = coverImageUrl,
76+
link = link,
7677
userBookStatus = userBookStatus,
7778
)
7879
}

core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import androidx.compose.runtime.Stable
66
data class BookSearchModel(
77
val version: String = "",
88
val title: String = "",
9-
val link: String = "",
109
val pubDate: String = "",
1110
val totalResults: Int = 0,
1211
val startIndex: Int = 0,
1312
val itemsPerPage: Int = 0,
1413
val query: String = "",
1514
val searchCategoryId: Int = 0,
1615
val searchCategoryName: String = "",
16+
val lastPage: Boolean = false,
1717
val books: List<BookSummaryModel> = emptyList(),
1818
)
1919

@@ -24,5 +24,6 @@ data class BookSummaryModel(
2424
val author: String = "",
2525
val publisher: String = "",
2626
val coverImageUrl: String = "",
27+
val link: String = "",
2728
val userBookStatus: String = "",
2829
)

core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/BookSearchResponse.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ data class BookSearchResponse(
99
val version: String,
1010
@SerialName("title")
1111
val title: String,
12-
@SerialName("link")
13-
val link: String,
1412
@SerialName("pubDate")
1513
val pubDate: String,
1614
@SerialName("totalResults")
@@ -25,6 +23,8 @@ data class BookSearchResponse(
2523
val searchCategoryId: Int,
2624
@SerialName("searchCategoryName")
2725
val searchCategoryName: String,
26+
@SerialName("lastPage")
27+
val lastPage: Boolean,
2828
@SerialName("books")
2929
val books: List<BookSummary>,
3030
)
@@ -41,6 +41,8 @@ data class BookSummary(
4141
val publisher: String,
4242
@SerialName("coverImageUrl")
4343
val coverImageUrl: String,
44+
@SerialName("link")
45+
val link: String,
4446
@SerialName("userBookStatus")
4547
val userBookStatus: String,
4648
)

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class BookSearchPresenter @AssistedInject constructor(
8080
}
8181

8282
currentStartIndex = startIndex
83-
isLastPage = result.books.size < PAGE_SIZE
83+
isLastPage = result.lastPage
8484

8585
if (startIndex == START_INDEX) {
8686
uiState = UiState.Success

0 commit comments

Comments
 (0)