-
Notifications
You must be signed in to change notification settings - Fork 0
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
미션 상태 - 인원 미달, 종료 대기 대응 #73
Open
eshc123
wants to merge
5
commits into
dev
Choose a base branch
from
feature/add-mission-status
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
5 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 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
17 changes: 17 additions & 0 deletions
17
...rc/main/java/com/goalpanzi/mission_mate/core/domain/common/model/mission/MissionStatus.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,17 @@ | ||
package com.goalpanzi.mission_mate.core.domain.common.model.mission | ||
|
||
enum class MissionStatus { | ||
CREATED, | ||
CANCELED, | ||
IN_PROGRESS, | ||
DELETED, | ||
PENDING_COMPLETION, | ||
COMPLETED; | ||
|
||
companion object { | ||
val statusString: String = listOf(CREATED, CANCELED, IN_PROGRESS, PENDING_COMPLETION) | ||
.joinToString(",") { it.name } | ||
} | ||
} | ||
|
||
|
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
...ain/java/com/goalpanzi/mission_mate/core/domain/mission/usecase/CompleteMissionUseCase.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 com.goalpanzi.mission_mate.core.domain.mission.usecase | ||
|
||
import com.goalpanzi.mission_mate.core.domain.common.DomainResult | ||
import com.goalpanzi.mission_mate.core.domain.mission.repository.MissionRepository | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.flow | ||
import javax.inject.Inject | ||
|
||
class CompleteMissionUseCase @Inject constructor( | ||
private val missionRepository: MissionRepository | ||
) { | ||
operator fun invoke(missionId: Long) : Flow<DomainResult<Unit>> = flow { | ||
emit(missionRepository.completeMission(missionId)) | ||
} | ||
} | ||
|
4 changes: 3 additions & 1 deletion
4
...boarding/src/main/java/com/goalpanzi/mission_mate/core/domain/onboarding/model/Mission.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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
package com.goalpanzi.mission_mate.core.domain.onboarding.model | ||
|
||
import com.goalpanzi.mission_mate.core.domain.common.model.mission.MissionStatus | ||
|
||
data class Mission( | ||
val missionId : Long, | ||
val description : String, | ||
val missionStatus : String | ||
val missionStatus : MissionStatus | ||
) |
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
8 changes: 8 additions & 0 deletions
8
...main/java/com/goalpanzi/mission_mate/core/network/model/request/CompleteMissionRequest.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,8 @@ | ||
package com.goalpanzi.mission_mate.core.network.model.request | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class CompleteMissionRequest( | ||
val missionId : Long | ||
) |
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
...main/java/com/goalpanzi/mission_mate/core/network/model/response/MissionStatusResponse.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 com.goalpanzi.mission_mate.core.network.model.response | ||
|
||
enum class MissionStatusResponse { | ||
CREATED, | ||
CANCELED, | ||
IN_PROGRESS, | ||
DELETED, | ||
PENDING_COMPLETION, | ||
COMPLETED | ||
} | ||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enum을 리스폰스로 받거나 리퀘스트로 json 파싱해서 넘겨줄 때 SerializedName 쓰거나 JsonAdapter 사용하는 방식도 있는데, 우리가 kotlin-serialize 사용하고 있어서 그 방법으로는 못하는거야?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
못한다기보다는 안 써도 되는 형태라고 봐야하지 않을까 싶어! https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/builtin-classes.md#enum-classes
보면 enum class name이랑 동일한 경우 그대로 사용해도 되고 다른 경우에는 @SerialName 를 통해 지정을 해도 되는 형태인 것 같아.
필드값으로 들어가는 enum class 에 대해서는 @serializable annotation을 안 써도 되는지에 대해서 확실하게 몰랐는데 공식 가이드에서 안 써도 된다고 적혀있네!