Class QuotesAPIClient
java.lang.Object
info.ejava.examples.svc.content.quotes.client.QuotesAPIClient
- All Implemented Interfaces:
QuotesAPI
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final URI
private final org.springframework.http.MediaType
private final org.springframework.web.reactive.function.client.WebClient
Fields inherited from interface info.ejava.examples.svc.content.quotes.api.QuotesAPI
DATETIME_FORMAT, QUOTE_PATH, QUOTES_PATH, RANDOM_QUOTE_PATH
-
Constructor Summary
ConstructorsConstructorDescriptionQuotesAPIClient
(org.springframework.web.reactive.function.client.WebClient webClient, ServerConfig serverConfig) QuotesAPIClient
(org.springframework.web.reactive.function.client.WebClient webClient, ServerConfig serverConfig, String mediaType) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono
<org.springframework.http.ResponseEntity<Void>> containsQuote
(int id) reactor.core.publisher.Mono
<org.springframework.http.ResponseEntity<QuoteDTO>> createQuote
(QuoteDTO quote) reactor.core.publisher.Mono
<org.springframework.http.ResponseEntity<Void>> reactor.core.publisher.Mono
<org.springframework.http.ResponseEntity<Void>> deleteQuote
(int id) protected reactor.core.publisher.Mono
<org.springframework.http.ResponseEntity<Void>> reactor.core.publisher.Mono
<org.springframework.http.ResponseEntity<QuoteDTO>> getQuote
(int id) reactor.core.publisher.Mono
<org.springframework.http.ResponseEntity<QuoteListDTO>> reactor.core.publisher.Mono
<org.springframework.http.ResponseEntity<QuoteDTO>> reactor.core.publisher.Mono
<org.springframework.http.ResponseEntity<Void>> updateQuote
(int id, QuoteDTO quote)
-
Field Details
-
baseUrl
-
webClient
private final org.springframework.web.reactive.function.client.WebClient webClient -
mediaType
private final org.springframework.http.MediaType mediaType
-
-
Constructor Details
-
QuotesAPIClient
public QuotesAPIClient(org.springframework.web.reactive.function.client.WebClient webClient, ServerConfig serverConfig, String mediaType) -
QuotesAPIClient
public QuotesAPIClient(org.springframework.web.reactive.function.client.WebClient webClient, ServerConfig serverConfig)
-
-
Method Details
-
createQuote
public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<QuoteDTO>> createQuote(QuoteDTO quote) - Specified by:
createQuote
in interfaceQuotesAPI
-
updateQuote
public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Void>> updateQuote(int id, QuoteDTO quote) - Specified by:
updateQuote
in interfaceQuotesAPI
-
containsQuote
public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Void>> containsQuote(int id) - Specified by:
containsQuote
in interfaceQuotesAPI
-
getQuote
public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<QuoteDTO>> getQuote(int id) -
randomQuote
- Specified by:
randomQuote
in interfaceQuotesAPI
-
deleteQuote
public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Void>> deleteQuote(int id) - Specified by:
deleteQuote
in interfaceQuotesAPI
-
deleteAllQuotes
- Specified by:
deleteAllQuotes
in interfaceQuotesAPI
-
doDelete
-
getQuotes
public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<QuoteListDTO>> getQuotes(Integer offset, Integer limit)
-