fixz
This commit is contained in:
parent
3118c07a83
commit
ba73348a74
3 changed files with 15 additions and 0 deletions
|
@ -31,6 +31,11 @@ public class ButtonDimmerController
|
||||||
this.buttonDimmerRepository = inputRepository;
|
this.buttonDimmerRepository = inputRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ButtonDimmer findById(@PathVariable("id") long id) throws NotFoundException {
|
||||||
|
return buttonDimmerRepository.findById(id).orElseThrow(NotFoundException::new);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public ButtonDimmer create(
|
public ButtonDimmer create(
|
||||||
@Valid @RequestBody final GenericDeviceSaveReguest bd, final Principal principal)
|
@Valid @RequestBody final GenericDeviceSaveReguest bd, final Principal principal)
|
||||||
|
|
|
@ -27,6 +27,11 @@ public class KnobDimmerController extends InputDeviceConnectionController<KnobDi
|
||||||
this.knobDimmerRepository = inputRepository;
|
this.knobDimmerRepository = inputRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public KnobDimmer findById(@PathVariable("id") long id) throws NotFoundException {
|
||||||
|
return knobDimmerRepository.findById(id).orElseThrow(NotFoundException::new);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public KnobDimmer create(
|
public KnobDimmer create(
|
||||||
@Valid @RequestBody GenericDeviceSaveReguest kd, final Principal principal)
|
@Valid @RequestBody GenericDeviceSaveReguest kd, final Principal principal)
|
||||||
|
|
|
@ -37,6 +37,11 @@ public class SwitchController extends InputDeviceConnectionController<Switch, Sw
|
||||||
this.switchRepository = inputRepository;
|
this.switchRepository = inputRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public Switch findById(@PathVariable("id") long id) throws NotFoundException {
|
||||||
|
return switchRepository.findById(id).orElseThrow(NotFoundException::new);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Switch create(@Valid @RequestBody GenericDeviceSaveReguest s, final Principal principal)
|
public Switch create(@Valid @RequestBody GenericDeviceSaveReguest s, final Principal principal)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
|
|
Loading…
Reference in a new issue