Create new package config and move Gruppen2Config to it
This commit is contained in:
26
src/main/java/mops/gruppen2/config/Gruppen2Config.java
Normal file
26
src/main/java/mops/gruppen2/config/Gruppen2Config.java
Normal file
@ -0,0 +1,26 @@
|
||||
package mops.gruppen2.config;
|
||||
|
||||
import mops.gruppen2.domain.Exceptions.EventException;
|
||||
import mops.gruppen2.domain.Group;
|
||||
import mops.gruppen2.service.EventService;
|
||||
import mops.gruppen2.service.GroupService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
public class Gruppen2Config {
|
||||
|
||||
@Autowired
|
||||
GroupService groupService;
|
||||
@Autowired
|
||||
EventService eventService;
|
||||
|
||||
@Bean
|
||||
public List<Group> groups() throws EventException {
|
||||
return groupService.projectEventList(eventService.findAllEvents());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user