Game calendar working
This commit is contained in:
@@ -148,4 +148,44 @@ public class RaidGroupController{
|
||||
|
||||
return returnNode;
|
||||
}
|
||||
|
||||
@GetMapping("/game/{gameId}")
|
||||
@AccountAuthorization(permissions = {AccountPermissionType.ADMIN, AccountPermissionType.USER})
|
||||
public List<RaidGroup> getRaidGroupsByGame(@PathVariable("gameId") UUID gameId, @RequestParam("page") int page, @RequestParam("pageSize") int pageSize, @RequestParam(value = "searchTerm", required = false) String searchTermString){
|
||||
log.info("Getting raid groups for game {} page {} of size {} with search term {}", gameId, page, pageSize, searchTermString);
|
||||
|
||||
|
||||
List<RaidGroup> raidGroups;
|
||||
if((searchTermString == null) || (searchTermString.isBlank())){
|
||||
raidGroups = raidGroupService.getRaidGroupsByGame(gameId, page, pageSize);
|
||||
}
|
||||
else{
|
||||
raidGroups = raidGroupService.getRaidGroupsByGame(gameId, page, pageSize, searchTermString);
|
||||
}
|
||||
|
||||
|
||||
return raidGroups;
|
||||
}
|
||||
|
||||
@GetMapping("/game/{gameId}/count")
|
||||
@AccountAuthorization(permissions = {AccountPermissionType.ADMIN, AccountPermissionType.USER})
|
||||
public ObjectNode getRaidGroupsCountByGame(@PathVariable("gameId") UUID gameId, @RequestParam(value = "searchTerm", required = false) String searchTerm){
|
||||
log.info("Getting raid groups count for game {} with search term {}", gameId, searchTerm);
|
||||
|
||||
|
||||
Long raidGroupsCount;
|
||||
if((searchTerm == null) || (searchTerm.isBlank())){
|
||||
raidGroupsCount = raidGroupService.getRaidGroupsCountByGame(gameId);
|
||||
}
|
||||
else{
|
||||
raidGroupsCount = raidGroupService.getRaidGroupsCountByGame(gameId, searchTerm);
|
||||
}
|
||||
|
||||
ObjectNode countNode = mapper.createObjectNode();
|
||||
countNode.put("count", raidGroupsCount);
|
||||
countNode.put("status", "success");
|
||||
|
||||
|
||||
return countNode;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user