Creating a model

In this project, we will create a REST API to see the list of user details where we can get a username, email ID, and contact number. So let's create a model of a user; the class name is UserModel.kt.

Here is the code of the model class:

data class UserModel(val id: Int,
val name: String,
val email: String,
val contact_number: String)

We have created a class named UserModel, where we have initialized id, name, email, and contact_number.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.218.221