getLatestData hinzugefügt
This commit is contained in:
parent
5904b0a451
commit
ae7dca5284
@ -34,6 +34,15 @@ class VzRestController {
|
|||||||
public VzRestController() {
|
public VzRestController() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/rest-vz/latest-data")
|
||||||
|
List<Aggregate> getLatestData(
|
||||||
|
@RequestParam("houseId")final int houseId,
|
||||||
|
@RequestParam("timeWindow")final int timeWindow) {
|
||||||
|
return jdbcTemplate.query("SELECT * FROM tobias_aggregate2 WHERE houseId=? ORDER BY timestamp_start DESC LIMIT ?;",
|
||||||
|
(rs, rowNum) -> new Aggregate(houseId, rs.getLong("timestamp_start"), rs.getLong("timestamp_end"), rs.getLong("produced_energy"), rs.getLong("obtained_energy"), rs.getLong("injected_energy")),
|
||||||
|
houseId, timeWindow);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/rest-vz/sums")
|
@GetMapping("/rest-vz/sums")
|
||||||
Aggregate getData(@RequestParam("timestampStart")final long timestampStart,
|
Aggregate getData(@RequestParam("timestampStart")final long timestampStart,
|
||||||
@RequestParam("timestampEnd")final long timestampEnd,
|
@RequestParam("timestampEnd")final long timestampEnd,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user