This repository has been archived by the owner on Apr 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Ranking Response data class 작성 feature/inflate-ranking * feat: Ranking 서비스 인터페이스 작성 feature/inflate-ranking * feat: Rank Data 모듈 모델 작성 feature/inflate-ranking * feat: Rank Domain 모듈 작성 feature/inflate-ranking * feat: 모듈의 모델간 데이터 Mapping 함수 작성 feature/inflate-ranking * feat: 랭킹 Ui 모델 변경 서버 통신으로 받는 값 추가 feature/inflate-ranking * feat: 랭킹 DataSource 작성 feature/inflate-ranking * feat: 랭킹 Repository 작성 feature/inflate-ranking * feat: 미션 Repository 접근자 수정 feature/inflate-ranking * feat: RankDataSource Injection 추가 feature/inflate-ranking * feat: RankRepository Injection 추가 feature/inflate-ranking * feat: Ranking Service 주입 모듈 추가 * feat: StampFloating Button 에 없던 클릭 리스너 추가 * feat: 랭킹 기능 완성 * feat: MissionScreen 변경사항 적용 * feat: 미사용 datasource 코드 삭제 feature/inflate-ranking * feat: 미사용 datasource 변경으로 인한 레포지터리 코드 변경 전체 조회에서 필터를 거는 방식으로 변경 feature/inflate-ranking * feat: 자신의 랭킹 표시 추가 feature/inflate-ranking * feat: 미션 수정 및 destination 시도끝에 실패;; feature/inflate-ranking * feat: 줄바꿈 이상한거 변경 feature/inflate-ranking * feat: 완료 미션 로티 기본 인자 수정 feature/inflate-ranking * feat: 미션 레벨 표시 이상하던 것 수정 feature/inflate-ranking * feat: 이전에 Destination 안되서 주석처리 한거 해제 feature/inflate-ranking * feat: 미션컴포넌트 수정 미션 컴포넌트 자체 크기가 이상한 것 수정 미션 텍스트 줄바꿈 안되는 부분 수정 feature/inflate-ranking * feat: 졸려 죽것다 나눠서 커밋이고 나발이고 미안하다... feature/inflate-ranking * feat: 이상한거 적어둔거 컷 feature/inflate-ranking * style: 린트 수정 * style: 린트 수정
- Loading branch information
Showing
109 changed files
with
1,141 additions
and
326 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
|
@@ -31,4 +31,4 @@ class App : Application() { | |
companion object { | ||
val networkFlipperPlugin = NetworkFlipperPlugin() | ||
} | ||
} | ||
} |
This file contains 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 |
---|---|---|
|
@@ -17,4 +17,4 @@ class MainActivity : ComponentActivity() { | |
DestinationsNavHost(navGraph = NavGraphs.root) | ||
} | ||
} | ||
} | ||
} |
This file contains 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 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 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 |
---|---|---|
|
@@ -34,4 +34,4 @@ annotation class LoginNavGraph( | |
@NavGraph | ||
annotation class SignUpNavGraph( | ||
val start: Boolean = false | ||
) | ||
) |
This file contains 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 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 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 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
16 changes: 16 additions & 0 deletions
16
app/src/main/java/org/sopt/stamp/data/mapper/RankMapper.kt
This file contains 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 org.sopt.stamp.data.mapper // ktlint-disable filename | ||
|
||
import org.sopt.stamp.data.remote.model.RankData | ||
import org.sopt.stamp.domain.model.Rank | ||
|
||
internal fun List<RankData>.toDomain(): List<Rank> = this.map { | ||
it.toDomain() | ||
} | ||
|
||
internal fun RankData.toDomain(): Rank = Rank( | ||
rank, | ||
userId, | ||
nickname, | ||
point, | ||
profileMessage | ||
) |
13 changes: 13 additions & 0 deletions
13
app/src/main/java/org/sopt/stamp/data/remote/api/RankService.kt
This file contains 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,13 @@ | ||
package org.sopt.stamp.data.remote.api | ||
|
||
import org.sopt.stamp.data.remote.model.response.RankResponse | ||
import retrofit2.http.GET | ||
|
||
internal interface RankService { | ||
|
||
@GET("rank") | ||
suspend fun getRanking(): List<RankResponse> | ||
|
||
@GET("rank/detail") | ||
suspend fun getRankDetail(): List<RankResponse> | ||
} |
This file contains 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 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 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 |
---|---|---|
|
@@ -38,4 +38,4 @@ interface UserService { | |
// 비밀번호 변경 | ||
// 닉네임 변경 | ||
// 탈퇴하기 | ||
} | ||
} |
This file contains 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
16 changes: 16 additions & 0 deletions
16
app/src/main/java/org/sopt/stamp/data/remote/mapper/RankMapper.kt
This file contains 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 org.sopt.stamp.data.remote.mapper // ktlint-disable filename | ||
|
||
import org.sopt.stamp.data.remote.model.RankData | ||
import org.sopt.stamp.data.remote.model.response.RankResponse | ||
|
||
internal fun List<RankResponse>.toData(): List<RankData> = this.map { | ||
it.toData() | ||
} | ||
|
||
internal fun RankResponse.toData(): RankData = RankData( | ||
rank, | ||
userId, | ||
nickname, | ||
point, | ||
profileMessage | ||
) |
This file contains 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 |
---|---|---|
|
@@ -6,4 +6,4 @@ data class MissionData( | |
val level: Int, | ||
val profileImage: List<String>?, | ||
val isCompleted: Boolean | ||
) | ||
) |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/org/sopt/stamp/data/remote/model/RankData.kt
This file contains 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,9 @@ | ||
package org.sopt.stamp.data.remote.model | ||
|
||
data class RankData( | ||
val rank: Int, | ||
val userId: Int, | ||
val nickname: String, | ||
val point: Int, | ||
val profileMessage: String? | ||
) |
This file contains 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 |
---|---|---|
|
@@ -6,4 +6,4 @@ import kotlinx.serialization.Serializable | |
data class LoginRequest( | ||
val email: String, | ||
val password: String | ||
) | ||
) |
This file contains 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 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 |
---|---|---|
|
@@ -9,4 +9,4 @@ data class MissionResponse( | |
val level: Int, | ||
val profileImage: List<String>?, | ||
val isCompleted: Boolean | ||
) | ||
) |
This file contains 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
10 changes: 10 additions & 0 deletions
10
app/src/main/java/org/sopt/stamp/data/remote/model/response/RankResponse.kt
This file contains 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 org.sopt.stamp.data.remote.model.response | ||
|
||
@kotlinx.serialization.Serializable | ||
data class RankResponse( | ||
val rank: Int, | ||
val userId: Int, | ||
val nickname: String, | ||
val point: Int, | ||
val profileMessage: String? | ||
) |
This file contains 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 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 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
24 changes: 24 additions & 0 deletions
24
app/src/main/java/org/sopt/stamp/data/remote/source/RemoteRankingDataSource.kt
This file contains 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,24 @@ | ||
package org.sopt.stamp.data.remote.source | ||
|
||
import org.sopt.stamp.data.error.ErrorData | ||
import org.sopt.stamp.data.remote.api.RankService | ||
import org.sopt.stamp.data.remote.mapper.toData | ||
import org.sopt.stamp.data.remote.model.RankData | ||
import org.sopt.stamp.data.source.RankingDataSource | ||
import java.net.UnknownHostException | ||
import javax.inject.Inject | ||
|
||
internal class RemoteRankingDataSource @Inject constructor( | ||
private val rankService: RankService | ||
) : RankingDataSource { | ||
override suspend fun getRanking(): Result<List<RankData>> { | ||
val result = kotlin.runCatching { | ||
rankService.getRanking().toData() | ||
} | ||
return when (val exception = result.exceptionOrNull()) { | ||
null -> result | ||
is UnknownHostException -> Result.failure(ErrorData.NetworkUnavailable) | ||
else -> Result.failure(exception) | ||
} | ||
} | ||
} |
This file contains 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.