generated from DO-SOPT-ANDROID/do-sopt-android-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ResponseReqresDto.kt
39 lines (35 loc) · 891 Bytes
/
ResponseReqresDto.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package org.sopt.dosopttemplate.data.dto.remote.respose
import kotlinx.serialization.Serializable
import org.sopt.dosopttemplate.domain.entity.ReqresEntity
@Serializable
data class ResponseReqresDto(
val data: List<Data>,
val page: Int,
val per_page: Int,
val support: Support,
val total: Int,
val total_pages: Int,
) {
@Serializable
data class Data(
val avatar: String,
val email: String,
val first_name: String,
val id: Int,
val last_name: String,
)
@Serializable
data class Support(
val text: String,
val url: String,
)
fun toReqresList(): List<ReqresEntity> = data.map {
ReqresEntity(
id = it.id,
email = it.email,
first_name = it.first_name,
last_name = it.last_name,
avatar = it.avatar,
)
}
}