
com.mayhoo.examples.HelloRestController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of example Show documentation
Show all versions of example Show documentation
Example Application using Mayhoo Spring Boot Starter Parent pom
package com.mayhoo.examples;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
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 java.util.Map;
@Slf4j
@RestController
@RequestMapping("hello")
public class HelloRestController {
@Value("${parent.example.greeting:Hi}")
private String greeting;
@GetMapping(path = "/{name}", produces = "application/json")
public Map sayHello(@PathVariable String name) {
log.info("sayHello called with param: {}", name);
return Map.of("greeting", String.format("%s %s!", greeting, name));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy