-
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.
- Loading branch information
1 parent
88d1487
commit 6bb469d
Showing
33 changed files
with
493 additions
and
109 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
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
core/data/src/main/kotlin/com/withpeace/withpeace/core/data/mapper/RecentPostMapper.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.withpeace.withpeace.core.data.mapper | ||
|
||
import com.withpeace.withpeace.core.domain.model.post.RecentPost | ||
import com.withpeace.withpeace.core.network.di.response.post.RecentPostResponse | ||
|
||
fun RecentPostResponse.toDomain(): RecentPost { | ||
return RecentPost( | ||
id = postId, title = title, type = type.toDomain(), | ||
) | ||
} |
17 changes: 17 additions & 0 deletions
17
...rc/main/kotlin/com/withpeace/withpeace/core/data/mapper/youthpolicy/PolicyFilterMapper.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.withpeace.withpeace.core.data.mapper.youthpolicy | ||
|
||
import com.withpeace.withpeace.core.domain.model.policy.PolicyClassification | ||
import com.withpeace.withpeace.core.domain.model.policy.PolicyFilters | ||
import com.withpeace.withpeace.core.domain.model.policy.PolicyRegion | ||
import com.withpeace.withpeace.core.network.di.response.policy.UserPolicyFilterResponse | ||
|
||
fun UserPolicyFilterResponse.toDomain(): PolicyFilters { | ||
return PolicyFilters( | ||
regions = region.map { name -> | ||
PolicyRegion.entries.find { it.name == name } ?: PolicyRegion.기타 | ||
}, | ||
classifications = classification.map { name -> | ||
PolicyClassification.entries.find { it.name == name } ?: PolicyClassification.ETC | ||
}, | ||
) | ||
} |
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
7 changes: 7 additions & 0 deletions
7
core/domain/src/main/java/com/withpeace/withpeace/core/domain/model/post/RecentPost.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,7 @@ | ||
package com.withpeace.withpeace.core.domain.model.post | ||
|
||
data class RecentPost( | ||
val id: Long, | ||
val title: String, | ||
val type: PostTopic, | ||
) |
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
12 changes: 12 additions & 0 deletions
12
...domain/src/main/java/com/withpeace/withpeace/core/domain/usecase/GetHotPoliciesUseCase.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,12 @@ | ||
package com.withpeace.withpeace.core.domain.usecase | ||
|
||
import com.withpeace.withpeace.core.domain.model.error.CheonghaError | ||
import com.withpeace.withpeace.core.domain.repository.YouthPolicyRepository | ||
import javax.inject.Inject | ||
|
||
class GetHotPoliciesUseCase @Inject constructor( | ||
private val policyRepository: YouthPolicyRepository, | ||
) { | ||
operator fun invoke(onError: suspend (CheonghaError) -> Unit) = | ||
policyRepository.getHotPolicy(onError) | ||
} |
12 changes: 12 additions & 0 deletions
12
.../domain/src/main/java/com/withpeace/withpeace/core/domain/usecase/GetRecentPostUseCase.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,12 @@ | ||
package com.withpeace.withpeace.core.domain.usecase | ||
|
||
import com.withpeace.withpeace.core.domain.model.error.CheonghaError | ||
import com.withpeace.withpeace.core.domain.repository.PostRepository | ||
import javax.inject.Inject | ||
|
||
class GetRecentPostUseCase @Inject constructor( | ||
private val postRepository: PostRepository, | ||
) { | ||
operator fun invoke(onError: suspend (CheonghaError) -> Unit) = | ||
postRepository.getRecentPost(onError) | ||
} |
12 changes: 12 additions & 0 deletions
12
.../src/main/java/com/withpeace/withpeace/core/domain/usecase/GetRecommendPoliciesUseCase.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,12 @@ | ||
package com.withpeace.withpeace.core.domain.usecase | ||
|
||
import com.withpeace.withpeace.core.domain.model.error.CheonghaError | ||
import com.withpeace.withpeace.core.domain.repository.YouthPolicyRepository | ||
import javax.inject.Inject | ||
|
||
class GetRecommendPoliciesUseCase @Inject constructor( | ||
private val policyRepository: YouthPolicyRepository, | ||
) { | ||
operator fun invoke(onError: suspend (CheonghaError) -> Unit) = | ||
policyRepository.getRecommendPolicy(onError) | ||
} |
9 changes: 9 additions & 0 deletions
9
.../java/com/withpeace/withpeace/core/network/di/response/policy/UserPolicyFilterResponse.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 com.withpeace.withpeace.core.network.di.response.policy | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class UserPolicyFilterResponse( | ||
val classification: List<String>, | ||
val region: List<String>, | ||
) |
10 changes: 10 additions & 0 deletions
10
...src/main/java/com/withpeace/withpeace/core/network/di/response/post/RecentPostResponse.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.withpeace.withpeace.core.network.di.response.post | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class RecentPostResponse( | ||
val type: PostTopicResponse, | ||
val postId: Long, | ||
val title: String, | ||
) |
34 changes: 0 additions & 34 deletions
34
core/network/src/main/java/com/withpeace/withpeace/core/network/di/service/PolicyService.kt
This file was deleted.
Oops, something went wrong.
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.