2019-03-19 22:29:12 +03:00
|
|
|
package com.baeldung.serverconfig;
|
2019-03-12 22:35:27 +03:00
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import reactor.core.publisher.Mono;
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/greet")
|
|
|
|
public class GreetingController {
|
|
|
|
|
|
|
|
private final GreetingService greetingService;
|
|
|
|
|
|
|
|
public GreetingController(GreetingService greetingService) {
|
|
|
|
this.greetingService = greetingService;
|
|
|
|
}
|
|
|
|
|
|
|
|
@GetMapping("/{name}")
|
|
|
|
private Mono<String> greet(@PathVariable String name) {
|
|
|
|
return greetingService.greet(name);
|
|
|
|
}
|
|
|
|
}
|