-
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.
[FEATURE]#218 : FeatureOverview API 구현
- Loading branch information
1 parent
fd1745d
commit 326cc20
Showing
8 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
core/model/src/main/kotlin/com/bff/wespot/model/dynamicui/FeatureOverview.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.bff.wespot.model.dynamicui | ||
|
||
import com.bff.wespot.model.dynamicui.component.ButtonComponent | ||
import com.bff.wespot.model.dynamicui.component.ImageComponent | ||
import com.bff.wespot.model.dynamicui.component.TextComponent | ||
|
||
data class FeatureOverview( | ||
val headerText: TextComponent = TextComponent("새로운 기능"), | ||
val overview: ImageComponent = ImageComponent(), | ||
val dismissButton: ButtonComponent = ButtonComponent(text = "다음에 하기"), | ||
val navigateButton: ButtonComponent = ButtonComponent(text = "설정하기"), | ||
) |
6 changes: 6 additions & 0 deletions
6
core/model/src/main/kotlin/com/bff/wespot/model/dynamicui/component/ButtonComponent.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,6 @@ | ||
package com.bff.wespot.model.dynamicui.component | ||
|
||
data class ButtonComponent( | ||
val text: String = "", | ||
val link: String = "", | ||
) : DynamicUiComponent |
3 changes: 3 additions & 0 deletions
3
core/model/src/main/kotlin/com/bff/wespot/model/dynamicui/component/DynamicUiComponent.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,3 @@ | ||
package com.bff.wespot.model.dynamicui.component | ||
|
||
sealed interface DynamicUiComponent |
10 changes: 10 additions & 0 deletions
10
core/model/src/main/kotlin/com/bff/wespot/model/dynamicui/component/ImageComponent.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.bff.wespot.model.dynamicui.component | ||
|
||
data class ImageComponent( | ||
val url: String = "", | ||
val width: Int = -1, | ||
val height: Int = -1, | ||
) : DynamicUiComponent { | ||
fun isFillMaxWidth() = this.width == 0 | ||
fun isFillMaxHeight() = this.height == 0 | ||
} |
5 changes: 5 additions & 0 deletions
5
core/model/src/main/kotlin/com/bff/wespot/model/dynamicui/component/TextComponent.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,5 @@ | ||
package com.bff.wespot.model.dynamicui.component | ||
|
||
data class TextComponent( | ||
val text: String = "", | ||
) : DynamicUiComponent |
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
18 changes: 18 additions & 0 deletions
18
data/src/main/kotlin/com/bff/wespot/data/repository/dynamicui/DynamicUiRepositoryImpl.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,18 @@ | ||
package com.bff.wespot.data.repository.dynamicui | ||
|
||
import com.bff.wespot.data.remote.source.dynamicui.DynamicUiDataSource | ||
import com.bff.wespot.domain.repository.dynamicui.DynamicUiRepository | ||
import com.bff.wespot.model.dynamicui.FeatureOverview | ||
import com.bff.wespot.model.notification.NotificationType | ||
import javax.inject.Inject | ||
|
||
class DynamicUiRepositoryImpl @Inject constructor( | ||
private val dynamicUiDataSource: DynamicUiDataSource, | ||
): DynamicUiRepository { | ||
override suspend fun getFeatureOverview( | ||
notificationType: NotificationType, | ||
): Result<FeatureOverview> = | ||
dynamicUiDataSource.getFeatureOverview(notificationType.name).mapCatching { response -> | ||
response.toFeatureOverview() | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
domain/src/main/kotlin/com/bff/wespot/domain/repository/dynamicui/DynamicUiRepository.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.bff.wespot.domain.repository.dynamicui | ||
|
||
import com.bff.wespot.model.dynamicui.FeatureOverview | ||
import com.bff.wespot.model.notification.NotificationType | ||
|
||
interface DynamicUiRepository { | ||
suspend fun getFeatureOverview(notificationType: NotificationType): Result<FeatureOverview> | ||
} |