diff --git a/readme.md b/readme.md index 0d417ee..14ca349 100644 --- a/readme.md +++ b/readme.md @@ -36,3 +36,8 @@ Write an application that, at the endpoint specified by you, returns the yearly } ] ``` + +## Usage + +Temperature statistics endpoint: `/api/temperatures/{city}` +Returns HTTP 200 when city is found, 404 otherwise. diff --git a/src/main/java/eu/ztsh/lfr/web/TemperaturesController.java b/src/main/java/eu/ztsh/lfr/web/TemperaturesController.java new file mode 100644 index 0000000..fa5cd6b --- /dev/null +++ b/src/main/java/eu/ztsh/lfr/web/TemperaturesController.java @@ -0,0 +1,20 @@ +package eu.ztsh.lfr.web; + +import eu.ztsh.lfr.model.Entry; +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.List; + +@RestController +@RequestMapping("/api/temperatures") +public class TemperaturesController { + + @GetMapping("/{city}") + public List getTemperatures(@PathVariable String city) { + throw new UnsupportedOperationException("Not supported yet."); + } + +}