diff --git a/app/src/main/java/keijumt/devandroid/api/response/mapper/PostCodeDataMapper.kt b/app/src/main/java/keijumt/devandroid/api/response/mapper/PostCodeDataMapper.kt new file mode 100644 index 0000000..4adf611 --- /dev/null +++ b/app/src/main/java/keijumt/devandroid/api/response/mapper/PostCodeDataMapper.kt @@ -0,0 +1,13 @@ +package keijumt.devandroid.api.response.mapper + +import keijumt.devandroid.api.response.PostalCode +import keijumt.devandroid.db.entity.AddressEntity + +fun PostalCode.toAddressEntity(): AddressEntity { + return AddressEntity( + postalCode = results!!.get(0).zipcode, + address = results!!.get(0).address1 + results!!.get(0).address2 + results!!.get(0).address3, + kana = results!!.get(0).kana1 + results!!.get(0).kana2 + results!!.get(0).kana3, + prefCode = results!!.get(0).prefcode.toInt() + ) +} \ No newline at end of file