feat: TemperaturesController
This commit is contained in:
parent
2a3bfb3a5b
commit
b34f5b3301
2 changed files with 25 additions and 0 deletions
|
@ -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.
|
||||
|
|
20
src/main/java/eu/ztsh/lfr/web/TemperaturesController.java
Normal file
20
src/main/java/eu/ztsh/lfr/web/TemperaturesController.java
Normal file
|
@ -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<Entry> getTemperatures(@PathVariable String city) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue