Added non registered statistic

This commit is contained in:
Filip Izydorczyk
2021-01-21 15:50:20 +01:00
parent 676070c8c7
commit 6a0d425c37
3 changed files with 54 additions and 0 deletions

View File

@ -55,4 +55,15 @@ public class StatisticsController {
return new ResponseEntity<>(response, HttpStatus.OK);
}
/**
* @return amount of students not registered to any groups
*/
@PreAuthorize("hasRole('ROLE_DEANERY')")
@GetMapping(path = "/users/noregistered")
public ResponseEntity<StatisticSimpleNumberResponse> getNonCommisionsAmmounts() {
final StatisticSimpleNumberResponse response = new StatisticSimpleNumberResponse(
this.userService.getAmmountOfUsersWithNoAssignedGroups());
return new ResponseEntity<>(response, HttpStatus.OK);
}
}