manipulate slots

This commit is contained in:
Jottyfan
2023-11-18 19:29:35 +01:00
parent 0c18b2df56
commit 48525b7e20
20 changed files with 331 additions and 558 deletions

View File

@@ -0,0 +1,39 @@
package de.jottyfan.bico.modules.slot;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import de.jottyfan.bico.modules.slot.model.SlotBean;
/**
*
* @author jotty
*
*/
@Service
public class SlotService {
@Autowired
private SlotRepository repository;
public SlotBean loadSlot(Integer id) {
return repository.getSlot(id);
}
public Integer saveSlot(SlotBean slot) {
if (slot.getPkSlot() == null) {
return repository.addSlot(slot);
} else {
repository.changeSlot(slot);
return slot.getPkSlot();
}
}
public void removeSlot(Integer id) {
repository.deleteSlot(id);
}
public SlotBean loadDeletableSlot(Integer id) {
return repository.getSlotIfDeletable(id);
}
}