File tree Expand file tree Collapse file tree 4 files changed +9
-5
lines changed
data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper
model/src/main/kotlin/com/ninecraft/booket/core/model
network/src/main/kotlin/com/ninecraft/booket/core/network/response
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book Expand file tree Collapse file tree 4 files changed +9
-5
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff line change @@ -6,14 +6,14 @@ import androidx.compose.runtime.Stable
66data 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)
Original file line number Diff line number Diff 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)
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments