-
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
11aa2cf
commit d155e73
Showing
13 changed files
with
171 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
core/model/src/main/kotlin/com/bff/wespot/model/serverDriven/BaseComponent.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.serverDriven | ||
|
||
interface BaseComponent |
5 changes: 5 additions & 0 deletions
5
core/model/src/main/kotlin/com/bff/wespot/model/serverDriven/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,5 @@ | ||
package com.bff.wespot.model.serverDriven | ||
|
||
data class ButtonComponent( | ||
val text: String, | ||
) : BaseComponent |
7 changes: 7 additions & 0 deletions
7
core/model/src/main/kotlin/com/bff/wespot/model/serverDriven/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,7 @@ | ||
package com.bff.wespot.model.serverDriven | ||
|
||
data class ImageComponent( | ||
val url: String, | ||
val width: Int, | ||
val height: Int, | ||
) : BaseComponent |
12 changes: 12 additions & 0 deletions
12
core/model/src/main/kotlin/com/bff/wespot/model/serverDriven/OnBoarding.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.serverDriven | ||
|
||
data class OnBoarding( | ||
val id: Int, | ||
val name: String, | ||
val data: List<OnBoardingContent>, | ||
) | ||
|
||
data class OnBoardingContent( | ||
val page: Int, | ||
val data: List<BaseComponent>, | ||
) |
6 changes: 6 additions & 0 deletions
6
core/model/src/main/kotlin/com/bff/wespot/model/serverDriven/OnBoardingCategory.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.serverDriven | ||
|
||
enum class OnBoardingCategory { | ||
VOTE, | ||
MESSAGE, | ||
} |
10 changes: 10 additions & 0 deletions
10
core/model/src/main/kotlin/com/bff/wespot/model/serverDriven/TextListComponent.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.serverDriven | ||
|
||
data class TextListComponent( | ||
val textList: List<TextList>, | ||
) : BaseComponent | ||
|
||
data class TextList( | ||
val icon: String, | ||
val text: String, | ||
) |
5 changes: 5 additions & 0 deletions
5
core/model/src/main/kotlin/com/bff/wespot/model/serverDriven/TitleComponent.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.serverDriven | ||
|
||
data class TitleComponent( | ||
val text: String, | ||
) : BaseComponent |
9 changes: 9 additions & 0 deletions
9
...-remote/src/main/kotlin/com/bff/wespot/data/remote/model/serverDriven/BaseComponentDto.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.bff.wespot.data.remote.model.serverDriven | ||
|
||
import com.bff.wespot.model.serverDriven.BaseComponent | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
sealed interface BaseComponentDto { | ||
fun toDomain(): BaseComponent | ||
} |
17 changes: 17 additions & 0 deletions
17
...emote/src/main/kotlin/com/bff/wespot/data/remote/model/serverDriven/ButtonComponentDto.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.bff.wespot.data.remote.model.serverDriven | ||
|
||
import com.bff.wespot.model.serverDriven.ButtonComponent | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
@SerialName("buttonComponent") | ||
data class ButtonComponentDto( | ||
val text: String | ||
) : BaseComponentDto { | ||
override fun toDomain(): ButtonComponent { | ||
return ButtonComponent( | ||
text = text | ||
) | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...remote/src/main/kotlin/com/bff/wespot/data/remote/model/serverDriven/ImageComponentDto.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,21 @@ | ||
package com.bff.wespot.data.remote.model.serverDriven | ||
|
||
import com.bff.wespot.model.serverDriven.ImageComponent | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
@SerialName("imageComponent") | ||
data class ImageComponentDto( | ||
val url: String, | ||
val width: Int, | ||
val height: Int | ||
) : BaseComponentDto { | ||
override fun toDomain(): ImageComponent { | ||
return ImageComponent( | ||
url = url, | ||
width = width, | ||
height = height | ||
) | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...ote/src/main/kotlin/com/bff/wespot/data/remote/model/serverDriven/OnBoardingContentDto.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,29 @@ | ||
package com.bff.wespot.data.remote.model.serverDriven | ||
|
||
import com.bff.wespot.model.serverDriven.OnBoarding | ||
import com.bff.wespot.model.serverDriven.OnBoardingContent | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class OnBoardingDto( | ||
val id: Int, | ||
val name: String, | ||
val data: List<OnBoardingContentDto> | ||
) { | ||
fun toDomain() = OnBoarding( | ||
id = id, | ||
name = name, | ||
data = data.map { it.toDomain() } | ||
) | ||
} | ||
|
||
@Serializable | ||
data class OnBoardingContentDto( | ||
val page: Int, | ||
val data: List<BaseComponentDto> | ||
) { | ||
fun toDomain() = OnBoardingContent( | ||
page = page, | ||
data = data.map { it.toDomain() } | ||
) | ||
} |
29 changes: 29 additions & 0 deletions
29
...ote/src/main/kotlin/com/bff/wespot/data/remote/model/serverDriven/TextListComponentDto.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,29 @@ | ||
package com.bff.wespot.data.remote.model.serverDriven | ||
|
||
import com.bff.wespot.model.serverDriven.TextList | ||
import com.bff.wespot.model.serverDriven.TextListComponent | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
@SerialName("textListComponent") | ||
data class TextListComponentDto( | ||
val textList: List<TextListDto> | ||
) : BaseComponentDto { | ||
override fun toDomain(): TextListComponent { | ||
return TextListComponent( | ||
textList = textList.map { it.toDomain() } | ||
) | ||
} | ||
} | ||
|
||
@Serializable | ||
data class TextListDto( | ||
val icon: String, | ||
val text: String | ||
) { | ||
fun toDomain() = TextList( | ||
icon = icon, | ||
text = text | ||
) | ||
} |
18 changes: 18 additions & 0 deletions
18
...remote/src/main/kotlin/com/bff/wespot/data/remote/model/serverDriven/TitleComponentDto.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.remote.model.serverDriven | ||
|
||
import com.bff.wespot.model.serverDriven.TitleComponent | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
@SerialName("titleComponent") | ||
data class TitleComponentDto( | ||
val text: String | ||
|
||
) : BaseComponentDto { | ||
override fun toDomain(): TitleComponent { | ||
return TitleComponent( | ||
text = text | ||
) | ||
} | ||
} |