Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

set maven goals in eclipse

public Mono<ServerResponse> queryStore(ServerRequest request) { 

        Optional<String> postalCode = request.queryParam("postalCode");                            

        Mono<ServerResponse> badQuery = ServerResponse.badRequest().build();
        Mono<ServerResponse> notFound = ServerResponse.notFound().build();

        if (!postalCode.isPresent()) { return  badQuery; }

        Flux<Store> stores = this.repository
                .getNearByStores(postalCode.get(), 5);

        return ServerResponse.ok().contentType(APPLICATION_JSON)
                .body(stores, Store.class)
                .switchIfEmpty(notFound);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #maven #goals #eclipse
ADD COMMENT
Topic
Name
9+8 =