Mercurial > hg > SpringPlayground
diff spring-boot-playground/src/main/java/de/comline/spring/controller/HelloController.java @ 1:60afb461bf6c
Import des Spring boot playground
author | Dirk Olmes <dirk.olmes@codedo.de> |
---|---|
date | Tue, 11 Aug 2020 16:08:16 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spring-boot-playground/src/main/java/de/comline/spring/controller/HelloController.java Tue Aug 11 16:08:16 2020 +0200 @@ -0,0 +1,19 @@ +package de.comline.spring.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import de.comline.spring.model.json.Greeting; + +@RestController +public class HelloController { + @RequestMapping("/") + public String index() { + return "Greetings from Spring Boot!\n"; + } + + @RequestMapping(path = "/", consumes = "application/json", produces = "application/json") + public Greeting sayHello() { + return new Greeting(index()); + } +}