Merge branch 'fix' into 'dev'
fixz See merge request sa4-2020/the-sanmarinoes/backend!100
This commit is contained in:
commit
f7f7d3a2a9
3 changed files with 15 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -27,6 +27,11 @@ public class KnobDimmerController extends InputDeviceConnectionController<KnobDi
|
|||
this.knobDimmerRepository = inputRepository;
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public KnobDimmer findById(@PathVariable("id") long id) throws NotFoundException {
|
||||
return knobDimmerRepository.findById(id).orElseThrow(NotFoundException::new);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public KnobDimmer create(
|
||||
@Valid @RequestBody GenericDeviceSaveReguest kd, final Principal principal)
|
||||
|
|
|
@ -37,6 +37,11 @@ public class SwitchController extends InputDeviceConnectionController<Switch, Sw
|
|||
this.switchRepository = inputRepository;
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public Switch findById(@PathVariable("id") long id) throws NotFoundException {
|
||||
return switchRepository.findById(id).orElseThrow(NotFoundException::new);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public Switch create(@Valid @RequestBody GenericDeviceSaveReguest s, final Principal principal)
|
||||
throws NotFoundException {
|
||||
|
|
Loading…
Reference in a new issue