1

Intellij Code Cleaunp

Co-authored-by: Christoph <tobi@urpost.de>
This commit is contained in:
Christoph
2020-03-18 23:25:54 +01:00
parent a05ffe9e4c
commit e9bab1bf3f
6 changed files with 19 additions and 18 deletions

View File

@ -45,7 +45,7 @@ public class APIController {
@GetMapping("/getGroupIdsOfUser/{teilnehmer}")
@Secured("ROLE_api_user")
@ApiOperation("Gibt alle Gruppen zurück in denen sich ein Teilnehmer befindet")
public List<Long> getGroupsOfUser(@ApiParam("Teilnehmer dessen groupIds zurückgegeben werden sollen") @PathVariable String teilnehmer) throws EventException {
public List<Long> getGroupsOfUser(@ApiParam("Teilnehmer dessen groupIds zurückgegeben werden sollen") @PathVariable String teilnehmer) {
return eventService.getGroupsOfUser(teilnehmer);
}
@ -55,7 +55,7 @@ public class APIController {
public Group getGroupFromId(@ApiParam("GruppenId der gefordeten Gruppe") @PathVariable Long groupId) throws EventException {
List<Event> eventList = eventService.getEventsOfGroup(groupId);
List<Group> groups = groupService.projectEventList(eventList);
return groups.get(0);
}

View File

@ -10,7 +10,6 @@ import mops.gruppen2.domain.exception.EventException;
@JsonTypeInfo(
include = JsonTypeInfo.As.PROPERTY,
use = JsonTypeInfo.Id.NAME,
property = "type"
)

View File

@ -24,14 +24,14 @@ public interface EventRepository extends CrudRepository<EventDTO, Long> {
List<Long> findGroup_idsWhereVisibility(@Param("vis") Boolean visibility);
@Query("SELECT DISTINCT group_id FROM event WHERE event_id > :status")
public List<Long> findNewEventSinceStatus(@Param("status") Long status);
List<Long> findNewEventSinceStatus(@Param("status") Long status);
@Query("SELECT * FROM event WHERE group_id IN (:groupIds) ")
public List<EventDTO> findAllEventsOfGroups(@Param("groupIds") List<Long> groupIds);
List<EventDTO> findAllEventsOfGroups(@Param("groupIds") List<Long> groupIds);
@Query("SELECT MAX(event_id) FROM event")
public Long getHighesEvent_ID();
Long getHighesEvent_ID();
@Query("SELECT MAX(group_id) FROM event")
public Long getMaxGroupID();
Long getMaxGroupID();
}