January 2018
Intermediate to advanced
414 pages
10h 29m
English
Using Spring WebFlux, we can create a controller as before, but first, we need our Customer class, so let's add it to our project. Create a new class named Customer:
package com.microservices.chapter4data class Customer(var id: Int = 0, val name: String = "", val telephone: Telephone? = null) { data class Telephone(var countryCode: String = "", var telephoneNumber: String = "")}
Now, we can create a simple rest controller; in our case, it will be named CustomerController:
package com.microservices.chapter4import org.springframework.web.bind.annotation.GetMappingimport org.springframework.web.bind.annotation.PathVariableimport org.springframework.web.bind.annotation.RestController@RestControllerclass CustomerController ...
Read now
Unlock full access