January 2018
Intermediate to advanced
414 pages
10h 29m
English
We already have a create method in our repository, so let's modify our service to use it, but first, we need to modify our CustomerService interface:
package com.microservices.chapter5import reactor.core.publisher.Monointerface CustomerService { fun getCustomer(id: Int): Mono<Customer> fun createCustomer(customer: Mono<Customer>) : Mono<Customer>}
Then, let's implement it in our CustomerServiceImpl class by using our repository:
package com.microservices.chapter5import org.springframework.beans.factory.annotation.Autowiredimport org.springframework.stereotype.Serviceimport reactor.core.publisher.Mono@Serviceclass CustomerServiceImpl : CustomerService { @Autowired lateinit var customerRepository: CustomerRepository
Read now
Unlock full access