ScheduleEntry endpoints for 'type' and 'zenith'

This commit is contained in:
Patrick Haßel 2021-10-28 17:10:04 +02:00
parent d6b4323f55
commit 009109c8f2

View File

@ -50,6 +50,16 @@ public class ScheduleEntryController {
return scheduleEntryWriteService.set(id, ScheduleEntry::setSunday, value);
}
@PostMapping("set/{id}/type")
public ScheduleEntryDto setType(@PathVariable final long id, @RequestBody final String value) {
return scheduleEntryWriteService.set(id, ScheduleEntry::setType, ScheduleEntryType.valueOf(value));
}
@PostMapping("set/{id}/zenith")
public ScheduleEntryDto setZenith(@PathVariable final long id, @RequestBody final String value) {
return scheduleEntryWriteService.set(id, ScheduleEntry::setZenith, Double.parseDouble(value));
}
@PostMapping("set/{id}/hour")
public ScheduleEntryDto setHour(@PathVariable final long id, @RequestBody final int value) {
return scheduleEntryWriteService.set(id, ScheduleEntry::setHour, value);