Works with native query now needst to be hql
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package com.plannaplan.controllers;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.plannaplan.App;
|
||||
@ -40,6 +41,12 @@ public class GroupController {
|
||||
@RequestParam(name = "capacity", defaultValue = "true") @ApiParam(value = "Boolean if we want to have capacity field in response") Boolean capacity,
|
||||
@RequestParam(name = "takenPlaces", defaultValue = "false") @ApiParam(value = "Boolean if we want to have respoonse with information about taken places by other students") Boolean takenPlaces) {
|
||||
List<Groups> groups = this.groupService.getGroupsByCourse(id);
|
||||
HashMap<Groups, Integer> ammounts;
|
||||
|
||||
if (takenPlaces) {
|
||||
ammounts = this.groupService.getTakenPlaces(groups);
|
||||
}
|
||||
|
||||
if (capacity) {
|
||||
return new ResponseEntity<>(GroupsMappers.mapToGetCourseGroupsWithCapacityResponse(groups), HttpStatus.OK);
|
||||
}
|
||||
|
Reference in New Issue
Block a user