https://kotlinlang.org logo
#ktor
Title
# ktor
c

cypher121

02/25/2021, 3:00 PM
I've been trying to figure out how to best organize locations for a simple CRUD wrapper, is there a better way to go about this? not sure if the Update class is even gonna work as it is
Copy code
@Location("/user/{id}") //GET and DELETE
data class UserById(val id: Int) {
    @Location("/") //PUT
    data class Update(
        val parent: UserById,
        val update: CreateUser
    )
}

@Location("/user") //POST
data class CreateUser(
    val name: String,
    val email: String,
    val password: String
)