Skip to content

Commit 78b28d4

Browse files
committed
Merge branch 'develop' into BOOK-167-feature/#69
# Conflicts: # feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterBottomSheet.kt # feature/search/src/main/res/values/strings.xml
2 parents 6bed0bc + c5ae3b2 commit 78b28d4

124 files changed

Lines changed: 3810 additions & 477 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

core/common/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ dependencies {
1616
projects.core.model,
1717
projects.core.network,
1818

19+
libs.kotlinx.collections.immutable,
20+
1921
libs.logger,
2022
)
2123
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.ninecraft.booket.core.common.constants
2+
3+
import com.ninecraft.booket.core.common.R
4+
5+
enum class BookStatus(val value: String) {
6+
BEFORE_READING("BEFORE_READING"),
7+
READING("READING"),
8+
COMPLETED("COMPLETED"),
9+
;
10+
11+
fun getDisplayNameRes(): Int {
12+
return when (this) {
13+
BEFORE_READING -> R.string.book_status_before
14+
READING -> R.string.book_status_reading
15+
COMPLETED -> R.string.book_status_completed
16+
}
17+
}
18+
19+
companion object Companion {
20+
fun fromValue(value: String): BookStatus? {
21+
return entries.find { it.value == value }
22+
}
23+
}
24+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.ninecraft.booket.core.common.constants
22

33
enum class WebViewConstants(val url: String, val title: String) {
4-
PRIVACY_POLICY("https://www.google.com", "개인정보처리방침"),
5-
TERMS_OF_SERVICE("https://m.naver.com", "이용약관"),
4+
PRIVACY_POLICY("https://sites.google.com/view/reed-privacypolicy", "개인정보처리방침"),
5+
TERMS_OF_SERVICE("https://sites.google.com/view/reed-termsofuse", "이용약관"),
66
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.ninecraft.booket.core.common.extensions
2+
3+
import androidx.compose.ui.graphics.Color
4+
import com.ninecraft.booket.core.model.Emotion
5+
6+
fun Emotion.toTextColor(): Color {
7+
return when (this) {
8+
Emotion.WARM -> Color(0xFFE3931B)
9+
Emotion.JOY -> Color(0xFFEE6B33)
10+
Emotion.TENSION -> Color(0xFF9A55E4)
11+
Emotion.SADNESS -> Color(0xFF2872E9)
12+
}
13+
}
14+
15+
fun Emotion.toBackgroundColor(): Color {
16+
return when (this) {
17+
Emotion.WARM -> Color(0xFFFFF5D3)
18+
Emotion.JOY -> Color(0xFFFFEBE3)
19+
Emotion.TENSION -> Color(0xFFF3E8FF)
20+
Emotion.SADNESS -> Color(0xFFE1ECFF)
21+
}
22+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.ninecraft.booket.core.common.util
2+
3+
import com.ninecraft.booket.core.model.EmotionModel
4+
5+
data class EmotionAnalysisResult(
6+
val topEmotions: List<EmotionModel>,
7+
val displayType: EmotionDisplayType,
8+
)
9+
10+
enum class EmotionDisplayType {
11+
SINGLE, // 1개 감정이 1위
12+
DUAL, // 2개 감정이 공동 1위
13+
BALANCED, // 3개 이상 감정이 공동 1위
14+
}
15+
16+
fun analyzeEmotions(emotions: List<EmotionModel>): EmotionAnalysisResult {
17+
if (emotions.isEmpty()) {
18+
return EmotionAnalysisResult(emptyList(), EmotionDisplayType.BALANCED)
19+
}
20+
21+
val maxCount = emotions.maxOf { it.count }
22+
val topEmotions = emotions.filter { it.count == maxCount }
23+
24+
val displayType = when (topEmotions.size) {
25+
1 -> EmotionDisplayType.SINGLE
26+
2 -> EmotionDisplayType.DUAL
27+
else -> EmotionDisplayType.BALANCED
28+
}
29+
30+
return EmotionAnalysisResult(topEmotions, displayType)
31+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="book_status_before">읽기 전</string>
4+
<string name="book_status_reading">읽는 중</string>
5+
<string name="book_status_completed">독서 완료</string>
6+
<string name="record_sort_page_ascending">페이지순</string>
7+
<string name="record_sort_recent_register">최신 등록순</string>
8+
</resources>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
package com.ninecraft.booket.core.data.api.repository
22

3+
import com.ninecraft.booket.core.model.AutoLoginState
4+
import kotlinx.coroutines.flow.Flow
5+
36
interface AuthRepository {
47
suspend fun login(accessToken: String): Result<Unit>
58

69
suspend fun logout(): Result<Unit>
10+
11+
suspend fun agreeTerms(termsAgreed: Boolean): Result<Unit>
12+
13+
val autoLoginState: Flow<AutoLoginState>
714
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.ninecraft.booket.core.data.api.repository
2+
3+
import com.ninecraft.booket.core.model.HomeModel
4+
5+
interface HomeRepository {
6+
suspend fun getHome(): Result<HomeModel>
7+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.ninecraft.booket.core.data.api.repository
2+
3+
import com.ninecraft.booket.core.model.RecordRegisterModel
4+
5+
interface RecordRepository {
6+
suspend fun postRecord(
7+
userBookId: String,
8+
pageNumber: Int,
9+
quote: String,
10+
emotionTags: List<String>,
11+
review: String,
12+
): Result<RecordRegisterModel>
13+
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
package com.ninecraft.booket.core.data.api.repository
22

3+
import com.ninecraft.booket.core.model.OnboardingState
34
import com.ninecraft.booket.core.model.UserProfileModel
45
import kotlinx.coroutines.flow.Flow
56

67
interface UserRepository {
78
suspend fun getUserProfile(): Result<UserProfileModel>
89

9-
val isOnboardingCompleted: Flow<Boolean>
10+
val onboardingState: Flow<OnboardingState>
1011

1112
suspend fun setOnboardingCompleted(isCompleted: Boolean)
1213
}

0 commit comments

Comments
 (0)