|
| 1 | +package com.wespot.common.dto |
| 2 | + |
| 3 | +import com.wespot.view.OnBoardingBottomSheetComponent |
| 4 | + |
| 5 | +data class OnBoardingResponse( |
| 6 | + val id: Long, |
| 7 | + val name: String, |
| 8 | +// val data: List<MessageOnBoardingPageResponse> |
| 9 | +) { |
| 10 | + |
| 11 | + companion object { |
| 12 | + |
| 13 | + fun from(onBoardingBottomSheetComponent: OnBoardingBottomSheetComponent): OnBoardingResponse { |
| 14 | + return OnBoardingResponse( |
| 15 | + id = 1, |
| 16 | + name = onBoardingBottomSheetComponent.name, |
| 17 | +// onBoardingBottomSheetComponent.data.map { MessageOnBoardingPageResponse.from(it) } |
| 18 | + ) |
| 19 | + } |
| 20 | + |
| 21 | + } |
| 22 | + |
| 23 | +// data class MessageOnBoardingPageResponse( |
| 24 | +// val page: Int, |
| 25 | +// val data: List<Any> |
| 26 | +// ) { |
| 27 | +// |
| 28 | +// data class TitleComponentResponse( |
| 29 | +// val type: String, |
| 30 | +// val text: String |
| 31 | +// ) { |
| 32 | +// |
| 33 | +// companion object { |
| 34 | +// |
| 35 | +// fun from(titleComponent: TitleComponent): TitleComponentResponse { |
| 36 | +// return TitleComponentResponse(titleComponent.type, titleComponent.text) |
| 37 | +// } |
| 38 | +// |
| 39 | +// } |
| 40 | +// |
| 41 | +// } |
| 42 | +// |
| 43 | +// data class ButtonComponentResponse( |
| 44 | +// val type: String, |
| 45 | +// val text: String |
| 46 | +// ) { |
| 47 | +// |
| 48 | +// companion object { |
| 49 | +// |
| 50 | +// fun from(buttonComponent: ButtonComponent): ButtonComponentResponse { |
| 51 | +// return ButtonComponentResponse(buttonComponent.type, buttonComponent.text) |
| 52 | +// } |
| 53 | +// |
| 54 | +// } |
| 55 | +// |
| 56 | +// } |
| 57 | +// |
| 58 | +// data class ImageComponentResponse( |
| 59 | +// val type: String, |
| 60 | +// val url: String, |
| 61 | +// val width: Int, |
| 62 | +// val height: Int |
| 63 | +// ) { |
| 64 | +// |
| 65 | +// companion object { |
| 66 | +// |
| 67 | +// fun from(imageComponent: ImageComponent): ImageComponentResponse { |
| 68 | +// return ImageComponentResponse( |
| 69 | +// imageComponent.type, |
| 70 | +// imageComponent.url, |
| 71 | +// imageComponent.width, |
| 72 | +// imageComponent.height |
| 73 | +// ) |
| 74 | +// } |
| 75 | +// |
| 76 | +// } |
| 77 | +// } |
| 78 | +// |
| 79 | +// data class TextLinesComponentResponse( |
| 80 | +// val type: String, |
| 81 | +// val textList: List<TextLineComponentResponse> |
| 82 | +// ) { |
| 83 | +// |
| 84 | +// companion object { |
| 85 | +// |
| 86 | +// fun from(textLinesComponent: TextLinesComponent): TextLinesComponentResponse { |
| 87 | +// return TextLinesComponentResponse( |
| 88 | +// textLinesComponent.type, |
| 89 | +// textLinesComponent.textLines.map { TextLineComponentResponse.of(it) } |
| 90 | +// ) |
| 91 | +// } |
| 92 | +// |
| 93 | +// } |
| 94 | +// |
| 95 | +// } |
| 96 | +// |
| 97 | +// data class TextLineComponentResponse( |
| 98 | +// val icon: String, |
| 99 | +// val text: String |
| 100 | +// ) { |
| 101 | +// companion object { |
| 102 | +// |
| 103 | +// fun of(textLineComponent: TextLineComponent): TextLineComponentResponse { |
| 104 | +// return TextLineComponentResponse(textLineComponent.icon, textLineComponent.text) |
| 105 | +// } |
| 106 | +// |
| 107 | +// } |
| 108 | +// } |
| 109 | +// |
| 110 | +// companion object { |
| 111 | +// fun fromWithImageComponent( |
| 112 | +// page: Int, |
| 113 | +// data: OnBoardingImageComponent |
| 114 | +// ): MessageOnBoardingPageResponse { |
| 115 | +// return MessageOnBoardingPageResponse( |
| 116 | +// page = page, |
| 117 | +// data = listOf( |
| 118 | +// TitleComponentResponse.from(data.titleComponent), |
| 119 | +// ImageComponentResponse.from(data.imageComponent), |
| 120 | +// ButtonComponentResponse.from(data.buttonComponent) |
| 121 | +// ) |
| 122 | +// ) |
| 123 | +// } |
| 124 | +// |
| 125 | +// fun fromWithDescriptionComponent( |
| 126 | +// page: Int, |
| 127 | +// data: com.wespot.view.OnBoardingDescriptionComponent |
| 128 | +// ): MessageOnBoardingPageResponse { |
| 129 | +// return MessageOnBoardingPageResponse( |
| 130 | +// page = page, |
| 131 | +// data = listOf( |
| 132 | +// TitleComponentResponse.from(data.titleComponent), |
| 133 | +// TextLinesComponentResponse.from(data.textLinesComponent), |
| 134 | +// ButtonComponentResponse.from(data.buttonComponent) |
| 135 | +// ) |
| 136 | +// ) |
| 137 | +// } |
| 138 | +// } |
| 139 | +// |
| 140 | +// } |
| 141 | +// |
| 142 | +// companion object { |
| 143 | +// fun from(onBoardingBottomSheetComponent: OnBoardingBottomSheetComponent): OnBoardingResponse { |
| 144 | +// return OnBoardingResponse( |
| 145 | +// id = 1, |
| 146 | +// name = onBoardingBottomSheetComponent.name, |
| 147 | +// data = listOf( |
| 148 | +// MessageOnBoardingPageResponse.fromWithImageComponent( |
| 149 | +// page = 1, |
| 150 | +// data = onBoardingBottomSheetComponent.onBoardingImageComponent |
| 151 | +// ), |
| 152 | +// MessageOnBoardingPageResponse.fromWithDescriptionComponent( |
| 153 | +// page = 2, |
| 154 | +// data = onBoardingBottomSheetComponent.onBoardingDescriptionComponent |
| 155 | +// ) |
| 156 | +// ) |
| 157 | +// ) |
| 158 | +// } |
| 159 | +// } |
| 160 | + |
| 161 | +} |
0 commit comments