-
Notifications
You must be signed in to change notification settings - Fork 0
완료한 미션 목록 조회 API 연동 #92
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
2 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /build |
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,55 @@ | ||
| import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
|
|
||
| plugins { | ||
| alias(libs.plugins.android.library) | ||
| alias(libs.plugins.jetbrains.kotlin.android) | ||
| alias(libs.plugins.hilt.android) | ||
| alias(libs.plugins.kotlin.ksp) | ||
| } | ||
|
|
||
| android { | ||
| namespace = "com.goalpanzi.mission_mate.core.data.history" | ||
| compileSdk = 34 | ||
|
|
||
| defaultConfig { | ||
| minSdk = 26 | ||
|
|
||
| testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
| } | ||
|
|
||
| buildTypes { | ||
| release { | ||
| proguardFiles( | ||
| getDefaultProguardFile("proguard-android-optimize.txt"), | ||
| "proguard-rules.pro" | ||
| ) | ||
| } | ||
| } | ||
| compileOptions { | ||
| sourceCompatibility = JavaVersion.VERSION_17 | ||
| targetCompatibility = JavaVersion.VERSION_17 | ||
| } | ||
| kotlin { | ||
| compilerOptions { | ||
| jvmTarget.set(JvmTarget.JVM_17) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| dependencies { | ||
|
|
||
| implementation(libs.bundles.test) | ||
| implementation(libs.bundles.coroutines) | ||
| implementation(libs.retrofit) | ||
|
|
||
| ksp(libs.hilt.compiler) | ||
| implementation(libs.hilt.android) | ||
|
|
||
| implementation(project(":core:data:common")) | ||
| implementation(project(":core:data:mission")) | ||
| implementation(project(":core:domain:common")) | ||
| implementation(project(":core:domain:history")) | ||
| implementation(project(":core:domain:mission")) | ||
| implementation(project(":core:network")) | ||
| implementation(project(":core:datastore")) | ||
| } |
Empty file.
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,21 @@ | ||
| # Add project specific ProGuard rules here. | ||
| # You can control the set of applied configuration files using the | ||
| # proguardFiles setting in build.gradle. | ||
| # | ||
| # For more details, see | ||
| # http://developer.android.com/guide/developing/tools/proguard.html | ||
|
|
||
| # If your project uses WebView with JS, uncomment the following | ||
| # and specify the fully qualified class name to the JavaScript interface | ||
| # class: | ||
| #-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
| # public *; | ||
| #} | ||
|
|
||
| # Uncomment this to preserve the line number information for | ||
| # debugging stack traces. | ||
| #-keepattributes SourceFile,LineNumberTable | ||
|
|
||
| # If you keep the line number information, uncomment this to | ||
| # hide the original source file name. | ||
| #-renamesourcefileattribute SourceFile |
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,4 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
|
||
| </manifest> |
16 changes: 16 additions & 0 deletions
16
...istory/src/main/java/com/goalpanzi/mission_mate/core/data/history/di/HistoryDataModule.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.goalpanzi.mission_mate.core.data.history.di | ||
|
|
||
| import com.goalpanzi.mission_mate.core.data.history.repository.HistoryRepositoryImpl | ||
| import com.goalpanzi.mission_mate.core.domain.history.repository.HistoryRepository | ||
| import dagger.Binds | ||
| import dagger.Module | ||
| import dagger.hilt.InstallIn | ||
| import dagger.hilt.components.SingletonComponent | ||
|
|
||
| @Module | ||
| @InstallIn(SingletonComponent::class) | ||
| internal abstract class HistoryDataModule { | ||
|
|
||
| @Binds | ||
| abstract fun bindHistoryRepository(impl: HistoryRepositoryImpl): HistoryRepository | ||
| } |
29 changes: 29 additions & 0 deletions
29
...istory/src/main/java/com/goalpanzi/mission_mate/core/data/history/mapper/HistoryMapper.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,29 @@ | ||
| package com.goalpanzi.mission_mate.core.data.history.mapper | ||
|
|
||
| import com.goalpanzi.mission_mate.core.domain.history.model.MissionHistories | ||
| import com.goalpanzi.mission_mate.core.domain.history.model.MissionHistory | ||
| import com.goalpanzi.mission_mate.core.mission.mapper.toModel | ||
| import com.goalpanzi.mission_mate.core.network.model.response.MissionHistoriesResponse | ||
| import com.goalpanzi.mission_mate.core.network.model.response.MissionHistoryResponse | ||
|
|
||
| fun MissionHistoryResponse.toModel(): MissionHistory = MissionHistory( | ||
| missionId = missionId, | ||
| description = description, | ||
| missionStartDate = missionStartDate, | ||
| missionEndDate = missionEndDate, | ||
| myVerificationCount = myVerificationCount, | ||
| totalVerificationCount = totalVerificationCount, | ||
| rank = rank, | ||
| randomImageUrlList = randomImageUrlList, | ||
| memberCount = memberCount, | ||
| missionMembers = missionMembers.map { | ||
| it.toModel() | ||
| } | ||
| ) | ||
|
|
||
| fun MissionHistoriesResponse.toModel(): MissionHistories = MissionHistories( | ||
| hasNext = hasNext, | ||
| resultList = resultList.map { | ||
| it.toModel() | ||
| } | ||
| ) |
22 changes: 22 additions & 0 deletions
22
...ain/java/com/goalpanzi/mission_mate/core/data/history/repository/HistoryRepositoryImpl.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,22 @@ | ||
| package com.goalpanzi.mission_mate.core.data.history.repository | ||
|
|
||
| import com.goalpanzi.mission_mate.core.data.common.handleResult | ||
| import com.goalpanzi.mission_mate.core.data.history.mapper.toModel | ||
| import com.goalpanzi.mission_mate.core.domain.common.DomainResult | ||
| import com.goalpanzi.mission_mate.core.domain.common.convert | ||
| import com.goalpanzi.mission_mate.core.domain.history.model.MissionHistories | ||
| import com.goalpanzi.mission_mate.core.domain.history.repository.HistoryRepository | ||
| import com.goalpanzi.mission_mate.core.network.service.HistoryService | ||
| import javax.inject.Inject | ||
|
|
||
| class HistoryRepositoryImpl @Inject constructor( | ||
| private val historyService: HistoryService | ||
| ) : HistoryRepository { | ||
| override suspend fun getMissionHistories(page: Int): DomainResult<MissionHistories> = | ||
| handleResult { | ||
| historyService.getMyMissionHistories(page) | ||
| }.convert { | ||
| it.toModel() | ||
| } | ||
|
|
||
| } |
17 changes: 17 additions & 0 deletions
17
...ata/history/src/test/java/com/goalpanzi/mission_mate/core/data/history/ExampleUnitTest.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,17 @@ | ||
| package com.goalpanzi.mission_mate.core.data.history | ||
|
|
||
| import org.junit.Test | ||
|
|
||
| import org.junit.Assert.* | ||
|
|
||
| /** | ||
| * Example local unit test, which will execute on the development machine (host). | ||
| * | ||
| * See [testing documentation](http://d.android.com/tools/testing). | ||
| */ | ||
| class ExampleUnitTest { | ||
| @Test | ||
| fun addition_isCorrect() { | ||
| assertEquals(4, 2 + 2) | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /build |
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 @@ | ||
| plugins { | ||
| id("java-library") | ||
| alias(libs.plugins.kotlin.jvm) | ||
| alias(libs.plugins.kotlin.ksp) | ||
| } | ||
|
|
||
| java { | ||
| sourceCompatibility = JavaVersion.VERSION_17 | ||
| targetCompatibility = JavaVersion.VERSION_17 | ||
|
|
||
| toolchain { | ||
| languageVersion.set(JavaLanguageVersion.of(17)) | ||
| } | ||
| } | ||
|
|
||
| kotlin { | ||
| jvmToolchain(17) | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation(libs.bundles.test) | ||
| implementation(libs.coroutines.core) | ||
| implementation(libs.hilt.core) | ||
| ksp(libs.hilt.compiler) | ||
|
|
||
| implementation(project(":core:domain:common")) | ||
| implementation(project(":core:domain:mission")) | ||
| } |
6 changes: 6 additions & 0 deletions
6
...ry/src/main/java/com/goalpanzi/mission_mate/core/domain/history/model/MissionHistories.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,6 @@ | ||
| package com.goalpanzi.mission_mate.core.domain.history.model | ||
|
|
||
| data class MissionHistories( | ||
| val hasNext: Boolean, | ||
| val resultList: List<MissionHistory> | ||
| ) |
16 changes: 16 additions & 0 deletions
16
...tory/src/main/java/com/goalpanzi/mission_mate/core/domain/history/model/MissionHistory.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.goalpanzi.mission_mate.core.domain.history.model | ||
|
|
||
| import com.goalpanzi.mission_mate.core.domain.mission.model.MissionBoardMember | ||
|
|
||
| data class MissionHistory( | ||
| val missionId: Long, | ||
| val description: String, | ||
| val missionStartDate: String, | ||
| val missionEndDate: String, | ||
| val myVerificationCount: Int, | ||
| val totalVerificationCount: Int, | ||
| val rank: Int, | ||
| val randomImageUrlList: List<String>, | ||
| val memberCount: Int, | ||
| val missionMembers: List<MissionBoardMember> | ||
| ) |
8 changes: 8 additions & 0 deletions
8
.../main/java/com/goalpanzi/mission_mate/core/domain/history/repository/HistoryRepository.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,8 @@ | ||
| package com.goalpanzi.mission_mate.core.domain.history.repository | ||
|
|
||
| import com.goalpanzi.mission_mate.core.domain.common.DomainResult | ||
| import com.goalpanzi.mission_mate.core.domain.history.model.MissionHistories | ||
|
|
||
| interface HistoryRepository { | ||
| suspend fun getMissionHistories(page: Int) : DomainResult<MissionHistories> | ||
| } |
17 changes: 17 additions & 0 deletions
17
...java/com/goalpanzi/mission_mate/core/domain/history/usecase/GetMissionHistoriesUseCase.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,17 @@ | ||
| package com.goalpanzi.mission_mate.core.domain.history.usecase | ||
|
|
||
| import com.goalpanzi.mission_mate.core.domain.common.DomainResult | ||
| import com.goalpanzi.mission_mate.core.domain.history.model.MissionHistories | ||
| import com.goalpanzi.mission_mate.core.domain.history.repository.HistoryRepository | ||
| import kotlinx.coroutines.flow.Flow | ||
| import kotlinx.coroutines.flow.flow | ||
| import javax.inject.Inject | ||
|
|
||
| class GetMissionHistoriesUseCase @Inject constructor( | ||
| private val historyRepository: HistoryRepository | ||
| ) { | ||
| operator fun invoke(page: Int) : Flow<DomainResult<MissionHistories>> = flow { | ||
| emit(historyRepository.getMissionHistories(page)) | ||
| } | ||
| } | ||
|
|
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
9 changes: 9 additions & 0 deletions
9
...n/java/com/goalpanzi/mission_mate/core/network/model/response/MissionHistoriesResponse.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,9 @@ | ||
| package com.goalpanzi.mission_mate.core.network.model.response | ||
|
|
||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class MissionHistoriesResponse( | ||
| val hasNext: Boolean, | ||
| val resultList: List<MissionHistoryResponse> | ||
| ) |
17 changes: 17 additions & 0 deletions
17
...ain/java/com/goalpanzi/mission_mate/core/network/model/response/MissionHistoryResponse.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,17 @@ | ||
| package com.goalpanzi.mission_mate.core.network.model.response | ||
|
|
||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class MissionHistoryResponse( | ||
| val missionId: Long, | ||
| val description: String, | ||
| val missionStartDate: String, | ||
| val missionEndDate: String, | ||
| val myVerificationCount: Int, | ||
| val totalVerificationCount: Int, | ||
| val rank: Int, | ||
| val randomImageUrlList: List<String>, | ||
| val memberCount: Int, | ||
| val missionMembers: List<MissionBoardMemberResponse>, | ||
| ) |
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.