January 2018
Intermediate to advanced
414 pages
10h 29m
English
We can add a new service to handle our customers, so let's create a CustomerService interface:
package com.microservices.chapter4interface CustomerService { fun getCustomer(id: Int) : Customer? fun searchCustomers(nameFilter: String): List<Customer>}
Then, we can create our service implementing the interface, CustomerServiceImpl:
package com.microservices.chapter4import com.microservices.chapter4.Customer.Telephoneimport org.springframework.stereotype.Componentimport java.util.concurrent.ConcurrentHashMap@Componentclass CustomerServiceImpl : CustomerService { companion object { val initialCustomers = arrayOf(Customer(1, "Kotlin"), Customer(2, "Spring"), Customer(3, "Microservice", Telephone("+44", "7123456789" ...
Read now
Unlock full access