Maciek refactor works + delete unnecesery interface (conception changed)
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package com.plannaplan.services;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.plannaplan.entities.Groups;
|
||||
import com.plannaplan.repositories.GroupRepository;
|
||||
@ -16,7 +17,7 @@ public class GroupService {
|
||||
public GroupService() {
|
||||
}
|
||||
|
||||
public Groups find(int time, int capacity, String room) {
|
||||
public Optional<Groups> find(int time, int capacity, String room) {
|
||||
return this.repo.find(time, room, capacity);
|
||||
}
|
||||
|
||||
@ -24,15 +25,16 @@ public class GroupService {
|
||||
return this.repo.getByCourse(id);
|
||||
}
|
||||
|
||||
public void save(Groups group) {
|
||||
public Groups save(Groups group) {
|
||||
this.repo.save(group);
|
||||
return group;
|
||||
}
|
||||
|
||||
public void delete(Groups groups){
|
||||
public void delete(Groups groups) {
|
||||
this.repo.delete(groups);
|
||||
}
|
||||
|
||||
public int getGroupsAmmount(){
|
||||
return (int)this.repo.count();
|
||||
public int getGroupsAmmount() {
|
||||
return (int) this.repo.count();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user