{
"data": [
{
"id": "a3d9b20a-f84c-483e-81af-f8d6a7e2de0f",
"amount": 11000,
"transport": 29000,
"total": 183000,
"weight": 14,
"payment": "Cash",
"payment_id": null,
"payment_method": null,
"accepted": 0,
"customer": {
"id": "2c8693d9-76ff-4bad-b7bd-bc3a1446a5e5",
"name": "Admin",
"store": false,
"phone": null,
"photo": null,
"email": "admin@admin.com",
"address": null,
"role": "admin",
"created_at": "2021-01-27T03:50:24.000000Z"
},
"laundry": {
"id": "acfa7e2e-aeb9-40d6-a68c-b6c259468b6b",
"name": "Test 01",
"email": "gfg@jhjgj.gfu",
"phone": "5344454",
"address": "gfvfggfggkh",
"photo": "http://example.com/images/3a1690bd48161f941b99af72c0098e34-1611653771.jpg",
"verified": 1,
"created_at": "2021-01-26T02:36:12.000000Z"
},
"driver": {
"id": "7c5715e2-2e73-4103-a439-bc54d9982552",
"dob": "17-11-1888",
"gender": "male",
"expire_date": "11 22",
"plat_nu": "F 4152 FSD",
"vehicle_brand": "Suzuki",
"vehicle_type": "Motor",
"no_sim": null,
"exp_sim": null,
"no_skck": null,
"photo_sim": null,
"photo_ktp": null,
"orders": [
{
"id": "a3d9b20a-f84c-483e-81af-f8d6a7e2de0f",
"user_id": "2c8693d9-76ff-4bad-b7bd-bc3a1446a5e5",
"laundry_id": "acfa7e2e-aeb9-40d6-a68c-b6c259468b6b",
"driver_id": "7c5715e2-2e73-4103-a439-bc54d9982552",
"amount": 11000,
"transport": 29000,
"total": 183000,
"weight": 14,
"payment": "Cash",
"payment_id": null,
"payment_method": null,
"accepted": 0,
"created_at": "2021-01-31T02:21:37.000000Z",
"updated_at": "2021-01-31T02:21:37.000000Z"
},
{
"id": "c3d0b768-e461-48da-8dd6-c23d88562f9a",
"user_id": "2c8693d9-76ff-4bad-b7bd-bc3a1446a5e5",
"laundry_id": "acfa7e2e-aeb9-40d6-a68c-b6c259468b6b",
"driver_id": "7c5715e2-2e73-4103-a439-bc54d9982552",
"amount": 17000,
"transport": 15000,
"total": 267000,
"weight": 14,
"payment": "Cash",
"payment_id": null,
"payment_method": null,
"accepted": 0,
"created_at": "2021-02-01T02:19:25.000000Z",
"updated_at": "2021-02-01T02:19:25.000000Z"
}
],
"created_at": "2021-01-29T04:36:23.000000Z"
},
"progresses": [
{
"id": "6d4f502a-dab3-4419-8edf-84e73214b8be",
"order_id": "a3d9b20a-f84c-483e-81af-f8d6a7e2de0f",
"progress_id": "dc06eae1-a071-4ac0-a79d-a9c1ea737b05",
"created_at": "2021-01-31T02:21:37.000000Z",
"updated_at": "2021-01-31T02:21:37.000000Z",
"progress": {
"id": "dc06eae1-a071-4ac0-a79d-a9c1ea737b05",
"name": "Menginformasikan",
"photo": null,
"created_at": null,
"updated_at": null
}
}
],
"services": [
{
"id": "036ff19b-91e3-47ec-8804-333f21027db7",
"name": null,
"photo": null,
"created_at": "2021-01-31T02:21:37.000000Z"
},
{
"id": "9a895f79-492d-416f-96ea-670567a69375",
"name": null,
"photo": null,
"created_at": "2021-01-31T02:21:37.000000Z"
}
],
"created_at": "2021-01-31T02:21:37.000000Z"
}
],
"message": "Data are ready."
}
如您所见,我的主数据下有相对数据,有些是对象,有些是数组。
问题
data class
例如:
data class Orders (
val id: String?,
val amount: String?,
val transport: String?,
val total: String?,
val weight: String?,
val payment: String?,
val payment_id: String?,
val payment_method: String?,
val accepted: String?,
) {
}
-
customer
(对象)
-
laundry
-
driver
(对象->下面还有数组)
-
progresses
(数组)
-
services
(数组)