-
Notifications
You must be signed in to change notification settings - Fork 0
[Fix/#73] 감정 구슬 관련 기능 수정 #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
61889dc
Add: coil-compose, coil-network 라이브러리 추가
l5x5l 90494f7
REFACTOR: 감정 구슬 관련 데이터 형식을 서버 데이터 기반으로 통일화
l5x5l 6b12a55
FEAT: 감정 구슬 변화여부를 홈 화면에서 감지하여 감정 구슬을 갱신할 수 있도록 구현
l5x5l cc7a40f
CHORE: ktlint 적용
l5x5l e615480
FIX: 감정 구슬 업데이트시 오늘 날짜에 대한 감정 구슬을 가져오도록 수정
l5x5l File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
data/src/main/java/com/threegap/bitnagil/data/emotion/datasource/EmotionDataSource.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
package com.threegap.bitnagil.data.emotion.datasource | ||
|
||
import com.threegap.bitnagil.data.emotion.model.dto.EmotionDto | ||
import com.threegap.bitnagil.data.emotion.model.response.MyEmotionResponseDto | ||
import com.threegap.bitnagil.data.emotion.model.response.GetEmotionResponse | ||
import com.threegap.bitnagil.data.emotion.model.response.RegisterEmotionResponse | ||
|
||
interface EmotionDataSource { | ||
suspend fun getEmotions(): Result<List<EmotionDto>> | ||
suspend fun registerEmotion(emotion: String): Result<RegisterEmotionResponse> | ||
suspend fun getMyEmotionMarble(currentDate: String): Result<MyEmotionResponseDto> | ||
suspend fun getEmotionMarble(currentDate: String): Result<GetEmotionResponse> | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 5 additions & 8 deletions
13
domain/src/main/java/com/threegap/bitnagil/domain/emotion/model/Emotion.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
package com.threegap.bitnagil.domain.emotion.model | ||
|
||
enum class Emotion { | ||
CALM, | ||
VITALITY, | ||
LETHARGY, | ||
ANXIETY, | ||
SATISFACTION, | ||
FATIGUE, | ||
} | ||
data class Emotion( | ||
val emotionType: String, | ||
val emotionMarbleName: String, | ||
val imageUrl: String, | ||
) |
5 changes: 5 additions & 0 deletions
5
domain/src/main/java/com/threegap/bitnagil/domain/emotion/model/EmotionChangeEvent.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.threegap.bitnagil.domain.emotion.model | ||
|
||
sealed interface EmotionChangeEvent { | ||
data class ChangeEmotion(val emotionType: String) : EmotionChangeEvent | ||
} |
7 changes: 0 additions & 7 deletions
7
domain/src/main/java/com/threegap/bitnagil/domain/emotion/model/MyEmotion.kt
This file was deleted.
Oops, something went wrong.
8 changes: 5 additions & 3 deletions
8
domain/src/main/java/com/threegap/bitnagil/domain/emotion/repository/EmotionRepository.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
package com.threegap.bitnagil.domain.emotion.repository | ||
|
||
import com.threegap.bitnagil.domain.emotion.model.Emotion | ||
import com.threegap.bitnagil.domain.emotion.model.EmotionChangeEvent | ||
import com.threegap.bitnagil.domain.emotion.model.EmotionRecommendRoutine | ||
import com.threegap.bitnagil.domain.emotion.model.MyEmotion | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface EmotionRepository { | ||
suspend fun getEmotions(): Result<List<Emotion>> | ||
suspend fun registerEmotion(emotion: Emotion): Result<List<EmotionRecommendRoutine>> | ||
suspend fun getMyEmotionMarble(currentDate: String): Result<MyEmotion> | ||
suspend fun registerEmotion(emotionMarbleType: String): Result<List<EmotionRecommendRoutine>> | ||
suspend fun getEmotionMarble(currentDate: String): Result<Emotion?> | ||
suspend fun getEmotionChangeEventFlow(): Flow<EmotionChangeEvent> | ||
} |
12 changes: 12 additions & 0 deletions
12
...ain/java/com/threegap/bitnagil/domain/emotion/usecase/GetEmotionChangeEventFlowUseCase.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.threegap.bitnagil.domain.emotion.usecase | ||
|
||
import com.threegap.bitnagil.domain.emotion.model.EmotionChangeEvent | ||
import com.threegap.bitnagil.domain.emotion.repository.EmotionRepository | ||
import kotlinx.coroutines.flow.Flow | ||
import javax.inject.Inject | ||
|
||
class GetEmotionChangeEventFlowUseCase @Inject constructor( | ||
private val repository: EmotionRepository, | ||
) { | ||
suspend operator fun invoke(): Flow<EmotionChangeEvent> = repository.getEmotionChangeEventFlow() | ||
} |
12 changes: 12 additions & 0 deletions
12
domain/src/main/java/com/threegap/bitnagil/domain/emotion/usecase/GetEmotionUseCase.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.threegap.bitnagil.domain.emotion.usecase | ||
|
||
import com.threegap.bitnagil.domain.emotion.model.Emotion | ||
import com.threegap.bitnagil.domain.emotion.repository.EmotionRepository | ||
import javax.inject.Inject | ||
|
||
class GetEmotionUseCase @Inject constructor( | ||
private val emotionRepository: EmotionRepository, | ||
) { | ||
suspend operator fun invoke(currentDate: String): Result<Emotion?> = | ||
emotionRepository.getEmotionMarble(currentDate) | ||
} |
12 changes: 0 additions & 12 deletions
12
domain/src/main/java/com/threegap/bitnagil/domain/emotion/usecase/GetMyEmotionUseCase.kt
This file was deleted.
Oops, something went wrong.
5 changes: 2 additions & 3 deletions
5
domain/src/main/java/com/threegap/bitnagil/domain/emotion/usecase/RegisterEmotionUseCase.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
package com.threegap.bitnagil.domain.emotion.usecase | ||
|
||
import com.threegap.bitnagil.domain.emotion.model.Emotion | ||
import com.threegap.bitnagil.domain.emotion.model.EmotionRecommendRoutine | ||
import com.threegap.bitnagil.domain.emotion.repository.EmotionRepository | ||
import javax.inject.Inject | ||
|
||
class RegisterEmotionUseCase @Inject constructor( | ||
private val emotionRepository: EmotionRepository, | ||
) { | ||
suspend operator fun invoke(emotion: Emotion): Result<List<EmotionRecommendRoutine>> { | ||
return emotionRepository.registerEmotion(emotion) | ||
suspend operator fun invoke(emotionType: String): Result<List<EmotionRecommendRoutine>> { | ||
return emotionRepository.registerEmotion(emotionType) | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.