-
Notifications
You must be signed in to change notification settings - Fork 1
[Feature/#52] 홈 화면 추가된 API 연동 #55
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
13 commits
Select commit
Hold shift + click to select a range
22b43bf
Feat: routineCompletionId 필드 추가
wjdrjs00 83a6d18
Feat: 반복루틴 단일 삭제를 위한 도메인 모델 정의
wjdrjs00 e8f6d41
Feat: 반복루틴 단일 삭제를 위한 Dto 모델 정의
wjdrjs00 55db036
Feat: 반복루틴 단일 삭제 API 연동
wjdrjs00 7ae11c6
Feat: 반복 루틴 단일 삭제 관련 Intent 추가
wjdrjs00 341a1eb
Feat: 루틴 당일 삭제 기능 구현
wjdrjs00 4808be9
Feat: 사용자 프로필 정보 조회 기능 추가
wjdrjs00 d5b86ac
Feat: 나의 감정 조회를 위한 도메인 모델 정의
wjdrjs00 b9c7ef9
Feat: 나의 감정 조회 API 연동
wjdrjs00 65d1dfb
Feat: 오늘의 감정 구슬 기능 구현
wjdrjs00 bb3ec6d
Refactor: AuthToken 모델 role 필드 제거
wjdrjs00 473f74d
Merge branch 'develop' into feature/#52-home-api
wjdrjs00 b2b1a76
Refactor: 루틴 삭제 시 BottomSheet 상태 초기화
wjdrjs00 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
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
2 changes: 2 additions & 0 deletions
2
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,9 +1,11 @@ | ||
| package com.threegap.bitnagil.data.emotion.datasource | ||
|
|
||
| import com.threegap.bitnagil.data.emotion.model.response.GetEmotionsResponse | ||
| import com.threegap.bitnagil.data.emotion.model.response.MyEmotionResponseDto | ||
| import com.threegap.bitnagil.data.emotion.model.response.RegisterEmotionResponse | ||
|
|
||
| interface EmotionDataSource { | ||
| suspend fun getEmotions(): Result<GetEmotionsResponse> | ||
| suspend fun registerEmotion(emotion: String): Result<RegisterEmotionResponse> | ||
| suspend fun getMyEmotionMarble(currentDate: String): Result<MyEmotionResponseDto> | ||
| } |
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
23 changes: 23 additions & 0 deletions
23
data/src/main/java/com/threegap/bitnagil/data/emotion/model/response/MyEmotionResponseDto.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,23 @@ | ||
| package com.threegap.bitnagil.data.emotion.model.response | ||
|
|
||
| import com.threegap.bitnagil.domain.emotion.model.Emotion | ||
| import com.threegap.bitnagil.domain.emotion.model.MyEmotion | ||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class MyEmotionResponseDto( | ||
| @SerialName("emotionMarbleType") | ||
| val emotionMarbleType: String?, | ||
| @SerialName("emotionMarbleName") | ||
| val emotionMarbleName: String?, | ||
| @SerialName("imageUrl") | ||
| val imageUrl: String?, | ||
| ) | ||
|
|
||
| fun MyEmotionResponseDto.toDomain(): MyEmotion = | ||
| MyEmotion( | ||
| emotionMarbleType = emotionMarbleType?.let { Emotion.valueOf(it) }, | ||
| emotionMarbleName = emotionMarbleName, | ||
| imageUrl = imageUrl, | ||
| ) | ||
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
2 changes: 2 additions & 0 deletions
2
data/src/main/java/com/threegap/bitnagil/data/routine/datasource/RoutineRemoteDataSource.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,12 @@ | ||
| package com.threegap.bitnagil.data.routine.datasource | ||
|
|
||
| import com.threegap.bitnagil.data.routine.model.request.RoutineByDayDeletionRequestDto | ||
| import com.threegap.bitnagil.data.routine.model.request.RoutineCompletionRequestDto | ||
| import com.threegap.bitnagil.data.routine.model.response.RoutinesResponseDto | ||
|
|
||
| interface RoutineRemoteDataSource { | ||
| suspend fun fetchWeeklyRoutines(startDate: String, endDate: String): Result<RoutinesResponseDto> | ||
| suspend fun syncRoutineCompletion(routineCompletionRequestDto: RoutineCompletionRequestDto): Result<Unit> | ||
| suspend fun deleteRoutine(routineId: String): Result<Unit> | ||
| suspend fun deleteRoutineByDay(routineByDayDeletionRequestDto: RoutineByDayDeletionRequestDto): Result<Unit> | ||
| } |
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
28 changes: 28 additions & 0 deletions
28
...n/java/com/threegap/bitnagil/data/routine/model/request/RoutineByDayDeletionRequestDto.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,28 @@ | ||
| package com.threegap.bitnagil.data.routine.model.request | ||
|
|
||
| import com.threegap.bitnagil.domain.routine.model.RoutineByDayDeletion | ||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class RoutineByDayDeletionRequestDto( | ||
| @SerialName("routineCompletionId") | ||
| val routineCompletionId: Int?, | ||
| @SerialName("routineId") | ||
| val routineId: String, | ||
| @SerialName("subRoutineInfosForDelete") | ||
| val subRoutineInfosForDelete: List<SubRoutineDeletionInfoDto>, | ||
| @SerialName("performedDate") | ||
| val performedDate: String, | ||
| @SerialName("historySeq") | ||
| val historySeq: Int, | ||
| ) | ||
|
|
||
| fun RoutineByDayDeletion.toDto() = | ||
| RoutineByDayDeletionRequestDto( | ||
| routineCompletionId = this.routineCompletionId, | ||
| routineId = this.routineId, | ||
| subRoutineInfosForDelete = this.subRoutineInfosForDelete.map { it.toDto() }, | ||
| performedDate = this.performedDate, | ||
| historySeq = this.historySeq, | ||
| ) |
19 changes: 19 additions & 0 deletions
19
...c/main/java/com/threegap/bitnagil/data/routine/model/request/SubRoutineDeletionInfoDto.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,19 @@ | ||
| package com.threegap.bitnagil.data.routine.model.request | ||
|
|
||
| import com.threegap.bitnagil.domain.routine.model.SubRoutineDeletionInfo | ||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class SubRoutineDeletionInfoDto( | ||
| @SerialName("routineCompletionId") | ||
| val routineCompletionId: Int?, | ||
| @SerialName("subRoutineId") | ||
| val subRoutineId: String, | ||
| ) | ||
|
|
||
| fun SubRoutineDeletionInfo.toDto() = | ||
| SubRoutineDeletionInfoDto( | ||
| routineCompletionId = this.routineCompletionId, | ||
| subRoutineId = this.subRoutineId, | ||
| ) |
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
7 changes: 7 additions & 0 deletions
7
data/src/main/java/com/threegap/bitnagil/data/user/datasource/UserDataSource.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,7 @@ | ||
| package com.threegap.bitnagil.data.user.datasource | ||
|
|
||
| import com.threegap.bitnagil.data.user.model.response.UserProfileResponseDto | ||
|
|
||
| interface UserDataSource { | ||
| suspend fun fetchUserProfile(): Result<UserProfileResponseDto> | ||
| } |
16 changes: 16 additions & 0 deletions
16
data/src/main/java/com/threegap/bitnagil/data/user/datasourceImpl/UserDataSourceImpl.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,16 @@ | ||
| package com.threegap.bitnagil.data.user.datasourceImpl | ||
|
|
||
| import com.threegap.bitnagil.data.common.safeApiCall | ||
| import com.threegap.bitnagil.data.user.datasource.UserDataSource | ||
| import com.threegap.bitnagil.data.user.model.response.UserProfileResponseDto | ||
| import com.threegap.bitnagil.data.user.service.UserService | ||
| import javax.inject.Inject | ||
|
|
||
| class UserDataSourceImpl @Inject constructor( | ||
| private val userService: UserService, | ||
| ) : UserDataSource { | ||
| override suspend fun fetchUserProfile(): Result<UserProfileResponseDto> = | ||
| safeApiCall { | ||
| userService.fetchUserProfile() | ||
| } | ||
| } |
16 changes: 16 additions & 0 deletions
16
data/src/main/java/com/threegap/bitnagil/data/user/model/response/UserProfileResponseDto.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,16 @@ | ||
| package com.threegap.bitnagil.data.user.model.response | ||
|
|
||
| import com.threegap.bitnagil.domain.user.model.UserProfile | ||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class UserProfileResponseDto( | ||
| @SerialName("nickname") | ||
| val nickname: String, | ||
| ) | ||
|
|
||
| fun UserProfileResponseDto.toDomain() = | ||
| UserProfile( | ||
| nickname = this.nickname, | ||
| ) |
14 changes: 14 additions & 0 deletions
14
data/src/main/java/com/threegap/bitnagil/data/user/repositoryImpl/UserRepositoryImpl.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,14 @@ | ||
| package com.threegap.bitnagil.data.user.repositoryImpl | ||
|
|
||
| import com.threegap.bitnagil.data.user.datasource.UserDataSource | ||
| import com.threegap.bitnagil.data.user.model.response.toDomain | ||
| import com.threegap.bitnagil.domain.user.model.UserProfile | ||
| import com.threegap.bitnagil.domain.user.repository.UserRepository | ||
| import javax.inject.Inject | ||
|
|
||
| class UserRepositoryImpl @Inject constructor( | ||
| private val userDataSource: UserDataSource, | ||
| ) : UserRepository { | ||
| override suspend fun fetchUserProfile(): Result<UserProfile> = | ||
| userDataSource.fetchUserProfile().map { it.toDomain() } | ||
| } |
10 changes: 10 additions & 0 deletions
10
data/src/main/java/com/threegap/bitnagil/data/user/service/UserService.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,10 @@ | ||
| package com.threegap.bitnagil.data.user.service | ||
|
|
||
| import com.threegap.bitnagil.data.user.model.response.UserProfileResponseDto | ||
| import com.threegap.bitnagil.network.model.BaseResponse | ||
| import retrofit2.http.GET | ||
|
|
||
| interface UserService { | ||
| @GET("/api/v1/users/nickname") | ||
| suspend fun fetchUserProfile(): BaseResponse<UserProfileResponseDto> | ||
| } |
7 changes: 7 additions & 0 deletions
7
domain/src/main/java/com/threegap/bitnagil/domain/emotion/model/MyEmotion.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,7 @@ | ||
| package com.threegap.bitnagil.domain.emotion.model | ||
|
|
||
| data class MyEmotion( | ||
| val emotionMarbleType: Emotion?, | ||
| val emotionMarbleName: String?, | ||
| val imageUrl: String?, | ||
| ) |
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.