From ba73348a743cb34e9c9a3456dc676228def4986d Mon Sep 17 00:00:00 2001 From: "Claudio Maggioni (maggicl)" Date: Tue, 28 Apr 2020 10:05:08 +0200 Subject: [PATCH] fixz --- .../smarthut/controller/ButtonDimmerController.java | 5 +++++ .../smarthut/controller/KnobDimmerController.java | 5 +++++ .../sanmarinoes/smarthut/controller/SwitchController.java | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/ButtonDimmerController.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/ButtonDimmerController.java index 6b13ca9..15f4825 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/ButtonDimmerController.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/ButtonDimmerController.java @@ -31,6 +31,11 @@ public class ButtonDimmerController this.buttonDimmerRepository = inputRepository; } + @GetMapping("/{id}") + public ButtonDimmer findById(@PathVariable("id") long id) throws NotFoundException { + return buttonDimmerRepository.findById(id).orElseThrow(NotFoundException::new); + } + @PostMapping public ButtonDimmer create( @Valid @RequestBody final GenericDeviceSaveReguest bd, final Principal principal) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/KnobDimmerController.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/KnobDimmerController.java index 9b30535..a8333f5 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/KnobDimmerController.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/KnobDimmerController.java @@ -27,6 +27,11 @@ public class KnobDimmerController extends InputDeviceConnectionController