Skip to content

Commit e43385e

Browse files
committed
[BOOK-212] chore: BookUpsertResponse 변경 사항 반영
TermsAgreementUi 패딩 figma와 같도록 적용
1 parent edcdea6 commit e43385e

File tree

20 files changed

+132
-117
lines changed

20 files changed

+132
-117
lines changed

core/common/src/main/kotlin/com/ninecraft/booket/core/common/extensions/Emotion.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ fun Emotion.toTextColor(): Color {
77
return when (this) {
88
Emotion.WARM -> Color(0xFFE3931B)
99
Emotion.JOY -> Color(0xFFEE6B33)
10-
Emotion.TENSION -> Color(0xFF9A55E4)
11-
Emotion.SADNESS -> Color(0xFF2872E9)
10+
Emotion.SAD -> Color(0xFF9A55E4)
11+
Emotion.INSIGHT -> Color(0xFF2872E9)
1212
}
1313
}
1414

1515
fun Emotion.toBackgroundColor(): Color {
1616
return when (this) {
1717
Emotion.WARM -> Color(0xFFFFF5D3)
1818
Emotion.JOY -> Color(0xFFFFEBE3)
19-
Emotion.TENSION -> Color(0xFFF3E8FF)
20-
Emotion.SADNESS -> Color(0xFFE1ECFF)
19+
Emotion.SAD -> Color(0xFFF3E8FF)
20+
Emotion.INSIGHT -> Color(0xFFE1ECFF)
2121
}
2222
}

core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/BookRepository.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ interface BookRepository {
1919

2020
suspend fun removeBookRecentSearch(query: String)
2121

22-
suspend fun getBookDetail(isbn: String): Result<BookDetailModel>
22+
suspend fun getBookDetail(isbn13: String): Result<BookDetailModel>
2323

2424
suspend fun upsertBook(
25-
bookIsbn: String,
25+
isbn13: String,
2626
bookStatus: String,
2727
): Result<BookUpsertModel>
2828

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
@@ -97,14 +97,15 @@ internal fun BookUpsertResponse.toModel(): BookUpsertModel {
9797
return BookUpsertModel(
9898
userBookId = userBookId,
9999
userId = userId,
100-
bookIsbn = bookIsbn,
100+
isbn13 = isbn13,
101101
bookTitle = bookTitle,
102102
bookAuthor = bookAuthor,
103103
status = status,
104104
coverImageUrl = coverImageUrl,
105105
publisher = publisher,
106106
createdAt = createdAt,
107107
updatedAt = updatedAt,
108+
recordCount = recordCount,
108109
)
109110
}
110111

core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultBookRepository.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ internal class DefaultBookRepository @Inject constructor(
3434
bookRecentSearchDataSource.removeRecentSearch(query)
3535
}
3636

37-
override suspend fun getBookDetail(isbn: String) = runSuspendCatching {
38-
service.getBookDetail(isbn).toModel()
37+
override suspend fun getBookDetail(isbn13: String) = runSuspendCatching {
38+
service.getBookDetail(isbn13).toModel()
3939
}
4040

41-
override suspend fun upsertBook(bookIsbn: String, bookStatus: String) = runSuspendCatching {
42-
service.upsertBook(BookUpsertRequest(bookIsbn, bookStatus)).toModel()
41+
override suspend fun upsertBook(isbn13: String, bookStatus: String) = runSuspendCatching {
42+
service.upsertBook(BookUpsertRequest(isbn13, bookStatus)).toModel()
4343
}
4444

4545
override suspend fun filterLibraryBooks(status: String?, page: Int, size: Int) = runSuspendCatching {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ data class BookUpsertModel(
1414
val publisher: String,
1515
val createdAt: String,
1616
val updatedAt: String,
17+
val recordCount: Int,
1718
)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ enum class Emotion(
1818
) {
1919
WARM("따뜻함"),
2020
JOY("즐거움"),
21-
TENSION("긴장감"),
22-
SADNESS("슬픔"),
21+
SAD("슬픔"),
22+
INSIGHT("깨달음"),
2323
;
2424

2525
companion object {

core/network/src/main/kotlin/com/ninecraft/booket/core/network/request/BookUpsertRequest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import kotlinx.serialization.Serializable
55

66
@Serializable
77
data class BookUpsertRequest(
8-
@SerialName("bookIsbn")
9-
val bookIsbn: String,
8+
@SerialName("isbn13")
9+
val isbn13: String,
1010
@SerialName("bookStatus")
1111
val bookStatus: String,
1212
)

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ data class BookUpsertResponse(
99
val userBookId: String,
1010
@SerialName("userId")
1111
val userId: String,
12-
@SerialName("bookIsbn")
13-
val bookIsbn: String,
12+
@SerialName("isbn13")
13+
val isbn13: String,
1414
@SerialName("bookTitle")
1515
val bookTitle: String,
1616
@SerialName("bookAuthor")
@@ -25,4 +25,6 @@ data class BookUpsertResponse(
2525
val createdAt: String,
2626
@SerialName("updatedAt")
2727
val updatedAt: String,
28+
@SerialName("recordCount")
29+
val recordCount: Int,
2830
)

feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ class BookDetailPresenter @AssistedInject constructor(
116116
}
117117
}
118118

119-
fun upsertBook(bookIsbn: String, bookStatus: String) {
119+
fun upsertBook(isbn13: String, bookStatus: String) {
120120
scope.launch {
121-
bookRepository.upsertBook(bookIsbn, bookStatus)
121+
bookRepository.upsertBook(isbn13, bookStatus)
122122
.onSuccess {
123123
currentBookStatus = BookStatus.fromValue(bookStatus) ?: BookStatus.BEFORE_READING
124124
bookDetail = bookDetail.copy(userBookStatus = bookStatus)

feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/CollectedSeeds.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ private fun CollectedSeedPreview() {
9999
seedsStats = persistentListOf(
100100
EmotionModel(Emotion.WARM, 3),
101101
EmotionModel(Emotion.JOY, 2),
102-
EmotionModel(Emotion.TENSION, 1),
103-
EmotionModel(Emotion.SADNESS, 3),
102+
EmotionModel(Emotion.SAD, 1),
103+
EmotionModel(Emotion.INSIGHT, 3),
104104
),
105105
)
106106
}

0 commit comments

Comments
 (0)