Not null group response
This commit is contained in:
parent
c2c82b75ba
commit
7e45da1306
@ -64,9 +64,6 @@ public class GroupService {
|
||||
public HashMap<Long, Integer> getTakenPlaces(List<Groups> groups) {
|
||||
HashMap<Long, Integer> response = new HashMap<>();
|
||||
|
||||
// List<Object[]> respoonses = this.repo.getAssignedAmounts(
|
||||
// groups.stream().filter(Objects::nonNull).map(Groups::getId).collect(Collectors.toList()));
|
||||
|
||||
List<Object[]> respoonses = this.repo
|
||||
.getAssignedAmounts(groups.stream().filter(Objects::nonNull).map(new Function<Groups, Long>() {
|
||||
@Override
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.plannaplan.responses.models;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.plannaplan.entities.Assignment;
|
||||
import com.plannaplan.entities.Groups;
|
||||
import com.plannaplan.types.GroupType;
|
||||
@ -7,6 +8,7 @@ import com.plannaplan.types.GroupType;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(description = "Response shows information about given group.", value = "GroupDefaultResponse")
|
||||
public class GroupDefaultResponse {
|
||||
|
||||
@ -29,7 +31,7 @@ public class GroupDefaultResponse {
|
||||
private GroupType type;
|
||||
|
||||
@ApiModelProperty(value = "Value shows how many places is already taken by other students.")
|
||||
private int takenPlaces;
|
||||
private Integer takenPlaces;
|
||||
|
||||
public GroupDefaultResponse(Groups group) {
|
||||
this.id = group.getId() != null ? group.getId() : null;
|
||||
@ -73,7 +75,7 @@ public class GroupDefaultResponse {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getTakenPlaces() {
|
||||
public Integer getTakenPlaces() {
|
||||
return this.takenPlaces;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user