From 8090ee765092153f97549fefb1f19705fcca1297 Mon Sep 17 00:00:00 2001 From: seoyoon Date: Sun, 10 Aug 2025 20:04:55 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[BOOK-250]=20fix:=20DTO=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=EC=82=AC=ED=95=AD=20=EC=A0=81=EC=9A=A9=20=EB=B0=8F=20?= =?UTF-8?q?lastPage=20=ED=8C=90=EB=B3=84=20=EB=A1=9C=EC=A7=81=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../booket/core/data/impl/mapper/ResponseToModel.kt | 3 ++- .../com/ninecraft/booket/core/model/BookSearchModel.kt | 3 ++- .../booket/core/network/response/BookSearchResponse.kt | 6 ++++-- .../booket/feature/search/book/BookSearchPresenter.kt | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt b/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt index fc8702a7..e3a6d3a8 100644 --- a/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt +++ b/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt @@ -54,7 +54,6 @@ internal fun BookSearchResponse.toModel(): BookSearchModel { return BookSearchModel( version = version, title = title, - link = link, pubDate = pubDate, totalResults = totalResults, startIndex = startIndex, @@ -62,6 +61,7 @@ internal fun BookSearchResponse.toModel(): BookSearchModel { query = query, searchCategoryId = searchCategoryId, searchCategoryName = searchCategoryName, + lastPage = lastPage, books = books.map { it.toModel() }, ) } @@ -73,6 +73,7 @@ internal fun BookSummary.toModel(): BookSummaryModel { author = author, publisher = publisher, coverImageUrl = coverImageUrl, + link = link, userBookStatus = userBookStatus, ) } diff --git a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt index ec3761fa..b54b0a1c 100644 --- a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt +++ b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt @@ -6,7 +6,6 @@ import androidx.compose.runtime.Stable data class BookSearchModel( val version: String = "", val title: String = "", - val link: String = "", val pubDate: String = "", val totalResults: Int = 0, val startIndex: Int = 0, @@ -14,6 +13,7 @@ data class BookSearchModel( val query: String = "", val searchCategoryId: Int = 0, val searchCategoryName: String = "", + val lastPage: Boolean = false, val books: List = emptyList(), ) @@ -24,5 +24,6 @@ data class BookSummaryModel( val author: String = "", val publisher: String = "", val coverImageUrl: String = "", + val link: String = "", val userBookStatus: String = "", ) diff --git a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/BookSearchResponse.kt b/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/BookSearchResponse.kt index be1cb8bf..ae2b8067 100644 --- a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/BookSearchResponse.kt +++ b/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/BookSearchResponse.kt @@ -9,8 +9,6 @@ data class BookSearchResponse( val version: String, @SerialName("title") val title: String, - @SerialName("link") - val link: String, @SerialName("pubDate") val pubDate: String, @SerialName("totalResults") @@ -25,6 +23,8 @@ data class BookSearchResponse( val searchCategoryId: Int, @SerialName("searchCategoryName") val searchCategoryName: String, + @SerialName("lastPage") + val lastPage: Boolean, @SerialName("books") val books: List, ) @@ -41,6 +41,8 @@ data class BookSummary( val publisher: String, @SerialName("coverImageUrl") val coverImageUrl: String, + @SerialName("link") + val link: String, @SerialName("userBookStatus") val userBookStatus: String, ) diff --git a/feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt b/feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt index e5516b38..89615b50 100644 --- a/feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt +++ b/feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt @@ -80,7 +80,7 @@ class BookSearchPresenter @AssistedInject constructor( } currentStartIndex = startIndex - isLastPage = result.books.size < PAGE_SIZE + isLastPage = result.lastPage if (startIndex == START_INDEX) { uiState = UiState.Success From 43442672720fa127289c88505cc718a08b3aa14e Mon Sep 17 00:00:00 2001 From: seoyoon Date: Sun, 10 Aug 2025 20:20:19 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[BOOK-250]=20refactor:=20=EB=B9=88=20isbn?= =?UTF-8?q?=EC=9D=B4=20=EB=8C=80=EC=9D=91=20=EB=A1=9C=EC=A7=81=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - LazyColumn item key를 title-isbn13 조합으로 변경 - BookItem 클릭 시 isbn이 비어 있으면 토스트 메세지로 안내 --- .../booket/core/data/impl/mapper/ResponseToModel.kt | 1 + .../com/ninecraft/booket/core/model/BookSearchModel.kt | 1 + .../booket/feature/search/book/BookSearchPresenter.kt | 8 ++++++-- .../ninecraft/booket/feature/search/book/BookSearchUi.kt | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt b/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt index e3a6d3a8..1d61416c 100644 --- a/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt +++ b/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt @@ -75,6 +75,7 @@ internal fun BookSummary.toModel(): BookSummaryModel { coverImageUrl = coverImageUrl, link = link, userBookStatus = userBookStatus, + key = "$title-$isbn13", ) } diff --git a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt index b54b0a1c..cc592841 100644 --- a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt +++ b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt @@ -26,4 +26,5 @@ data class BookSummaryModel( val coverImageUrl: String = "", val link: String = "", val userBookStatus: String = "", + val key: String = "", ) diff --git a/feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt b/feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt index 89615b50..62efcce8 100644 --- a/feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt +++ b/feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt @@ -40,7 +40,6 @@ class BookSearchPresenter @AssistedInject constructor( private val repository: BookRepository, ) : Presenter { companion object { - private const val PAGE_SIZE = 20 private const val START_INDEX = 1 } @@ -185,7 +184,12 @@ class BookSearchPresenter @AssistedInject constructor( is BookSearchUiEvent.OnBookClick -> { selectedBookIsbn = event.isbn13 - isBookRegisterBottomSheetVisible = true + + if (selectedBookIsbn.isEmpty()) { + sideEffect = BookSearchSideEffect.ShowToast("isbn이 없는 도서는 등록할 수 없습니다") + } else { + isBookRegisterBottomSheetVisible = true + } } is BookSearchUiEvent.OnBookRegisterBottomSheetDismiss -> { diff --git a/feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUi.kt b/feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUi.kt index 436e7b7d..28b8ea15 100644 --- a/feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUi.kt +++ b/feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUi.kt @@ -222,7 +222,7 @@ internal fun SearchContent( ) { items( count = state.books.size, - key = { index -> state.books[index].isbn13 }, + key = { index -> state.books[index].key }, ) { index -> Column { BookItem( From f2d3b713869359c0e0523dec148162da57787db9 Mon Sep 17 00:00:00 2001 From: seoyoon Date: Sun, 10 Aug 2025 20:25:45 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[BOOK-250]=20chore:=20=EB=B2=84=EC=A0=84=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ninecraft/booket/convention/ApplicationConstants.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-logic/src/main/kotlin/com/ninecraft/booket/convention/ApplicationConstants.kt b/build-logic/src/main/kotlin/com/ninecraft/booket/convention/ApplicationConstants.kt index 9119622b..d1a366c2 100644 --- a/build-logic/src/main/kotlin/com/ninecraft/booket/convention/ApplicationConstants.kt +++ b/build-logic/src/main/kotlin/com/ninecraft/booket/convention/ApplicationConstants.kt @@ -6,7 +6,7 @@ internal object ApplicationConstants { const val MIN_SDK = 28 const val TARGET_SDK = 35 const val COMPILE_SDK = 35 - const val VERSION_CODE = 1 + const val VERSION_CODE = 2 const val VERSION_NAME = "1.0.0" const val JAVA_VERSION_INT = 17 val javaVersion = JavaVersion.VERSION_17 From a80f2f5236faf1b100d10650952f3a3791a06fc6 Mon Sep 17 00:00:00 2001 From: seoyoon Date: Sun, 10 Aug 2025 20:30:43 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[BOOK-250]=20chore:=20=EB=B2=84=EC=A0=84=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=202=20->=203=EC=9C=BC=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ninecraft/booket/convention/ApplicationConstants.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-logic/src/main/kotlin/com/ninecraft/booket/convention/ApplicationConstants.kt b/build-logic/src/main/kotlin/com/ninecraft/booket/convention/ApplicationConstants.kt index d1a366c2..7dd72860 100644 --- a/build-logic/src/main/kotlin/com/ninecraft/booket/convention/ApplicationConstants.kt +++ b/build-logic/src/main/kotlin/com/ninecraft/booket/convention/ApplicationConstants.kt @@ -6,7 +6,7 @@ internal object ApplicationConstants { const val MIN_SDK = 28 const val TARGET_SDK = 35 const val COMPILE_SDK = 35 - const val VERSION_CODE = 2 + const val VERSION_CODE = 3 const val VERSION_NAME = "1.0.0" const val JAVA_VERSION_INT = 17 val javaVersion = JavaVersion.VERSION_17